| description = 'Kotlin Common Standard Library' |
| |
| apply plugin: 'kotlin-platform-common' |
| |
| configurePublishing(project) |
| |
| def commonSrcDir = "../src" |
| def commonTestSrcDir = "../test" |
| |
| sourceSets { |
| main { |
| kotlin { |
| srcDir 'src' |
| srcDir commonSrcDir |
| srcDir '../unsigned/src' |
| } |
| } |
| test { |
| kotlin { |
| srcDir commonTestSrcDir |
| srcDir 'test' |
| } |
| } |
| } |
| |
| dependencies { |
| testCompile project(":kotlin-test:kotlin-test-common") |
| testCompile 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, |
| "-Xopt-in=kotlin.RequiresOptIn", |
| "-Xopt-in=kotlin.ExperimentalMultiplatform", |
| "-Xopt-in=kotlin.contracts.ExperimentalContracts", |
| "-Xinline-classes", |
| "-Xallow-kotlin-package", |
| "-Xallow-result-return-type" |
| ] |
| } |
| } |
| |
| compileTestKotlinCommon { |
| kotlinOptions { |
| freeCompilerArgs += [ |
| "-Xopt-in=kotlin.RequiresOptIn", |
| "-Xopt-in=kotlin.ExperimentalUnsignedTypes", |
| "-Xopt-in=kotlin.ExperimentalStdlibApi", |
| ] |
| } |
| } |
| |
| jar { |
| manifestAttributes(manifest, project, 'Main') |
| } |
| |
| task sourcesJar(type: Jar, dependsOn: classes) { |
| classifier = 'sources' |
| from sourceSets.main.kotlin |
| } |
| |
| configurations { |
| sources |
| } |
| |
| artifacts { |
| archives sourcesJar |
| sources sourcesJar |
| } |
| |
| javadocJar() |
| |
| classes.setDependsOn(classes.dependsOn.findAll { it != "compileJava" }) |