77 lines
2.0 KiB
Groovy
77 lines
2.0 KiB
Groovy
description = 'Kotlin Common Standard Library'
|
|
|
|
apply plugin: 'kotlin-platform-common'
|
|
|
|
configurePublishing(project)
|
|
|
|
JvmToolchain.updateJvmTarget(project, "1.8")
|
|
|
|
def commonSrcDir = "../src"
|
|
def commonTestSrcDir = "../test"
|
|
|
|
sourceSets {
|
|
main {
|
|
kotlin {
|
|
srcDir 'src'
|
|
srcDir commonSrcDir
|
|
srcDir '../unsigned/src'
|
|
if(!BuildPropertiesKt.getKotlinBuildProperties(project).inIdeaSync) {
|
|
srcDir "$rootDir/core/builtins/src/kotlin/internal"
|
|
}
|
|
}
|
|
}
|
|
test {
|
|
kotlin {
|
|
srcDir commonTestSrcDir
|
|
srcDir 'test'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testApi project(":kotlin-test:kotlin-test-common")
|
|
testApi project(":kotlin-test:kotlin-test-annotations-common")
|
|
}
|
|
|
|
compileKotlinCommon {
|
|
dependsOn(":prepare:build.version:writeStdlibVersion")
|
|
// dependsOn ":prepare:compiler:prepare-compiler-with-bootstrap-runtime"
|
|
// compilerJarFile = compilerJarWithBootstrapRuntime
|
|
}
|
|
|
|
compileKotlinCommon {
|
|
kotlinOptions {
|
|
freeCompilerArgs = [
|
|
"-module-name", project.name,
|
|
"-opt-in=kotlin.RequiresOptIn",
|
|
"-opt-in=kotlin.ExperimentalMultiplatform",
|
|
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
|
"-Xallow-kotlin-package",
|
|
"-XXLanguage:+RangeUntilOperator",
|
|
]
|
|
}
|
|
}
|
|
|
|
compileTestKotlinCommon {
|
|
kotlinOptions {
|
|
freeCompilerArgs += [
|
|
"-opt-in=kotlin.RequiresOptIn",
|
|
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
|
"-opt-in=kotlin.ExperimentalStdlibApi",
|
|
"-opt-in=kotlin.io.encoding.ExperimentalEncodingApi",
|
|
"-XXLanguage:+RangeUntilOperator",
|
|
]
|
|
}
|
|
}
|
|
|
|
jar {
|
|
manifestAttributes(manifest, project, 'Main')
|
|
}
|
|
|
|
configureSourcesJar()
|
|
configureJavadocJar()
|
|
|
|
sourcesJar.dependsOn(":prepare:build.version:writeStdlibVersion")
|
|
|
|
classes.setDependsOn(classes.dependsOn.findAll { it != "compileJava" })
|