29d2679e8d
This change avoids compiling kotlin-compiler-embeddable, kotlin-gradle-plugin, and other gradle plugins, when running `./gradlew dist`
81 lines
1.8 KiB
Groovy
81 lines
1.8 KiB
Groovy
description = 'Kotlin Common Standard Library'
|
|
|
|
apply plugin: 'kotlin-platform-common'
|
|
|
|
configureDist(project)
|
|
configurePublishing(project)
|
|
|
|
def commonSrcDir = "${buildDir}/common-sources"
|
|
def commonTestSrcDir = "${buildDir}/common-test-sources"
|
|
|
|
sourceSets {
|
|
main {
|
|
kotlin {
|
|
srcDir 'src'
|
|
srcDir commonSrcDir
|
|
}
|
|
}
|
|
test {
|
|
kotlin {
|
|
srcDir commonTestSrcDir
|
|
srcDir 'test'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testCompile project(":kotlin-test:kotlin-test-common")
|
|
testCompile project(":kotlin-test:kotlin-test-annotations-common")
|
|
}
|
|
|
|
createPreprocessorTask(project, "Main", "${projectDir}/../src/kotlin", commonSrcDir)
|
|
createPreprocessorTask(project, "Test", "${projectDir}/../test", commonTestSrcDir)
|
|
|
|
compileKotlinCommon {
|
|
dependsOn preprocessSourcesMain
|
|
// dependsOn ":prepare:compiler:prepare-compiler-with-bootstrap-runtime"
|
|
// compilerJarFile = compilerJarWithBootstrapRuntime
|
|
}
|
|
|
|
/*
|
|
// TODO: currently unsupported
|
|
compileKotlinCommon {
|
|
kotlinOptions {
|
|
freeCompilerArgs = [
|
|
"-module-name", "${project.name}".toString()
|
|
]
|
|
}
|
|
}
|
|
*/
|
|
|
|
compileTestKotlinCommon {
|
|
dependsOn preprocessSourcesTest
|
|
}
|
|
|
|
kotlin.experimental.coroutines 'enable'
|
|
|
|
jar {
|
|
manifestAttributes(manifest, project, 'Main')
|
|
}
|
|
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
classifier = 'sources'
|
|
from sourceSets.main.kotlin
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
}
|
|
|
|
// TODO: call the "dist" task instead, once we need to publish kotlin-stdlib-common.jar with the compiler distribution
|
|
task distCommon(type: Copy) {
|
|
from(jar)
|
|
into "$distDir/common"
|
|
rename "-${java.util.regex.Pattern.quote(version)}", ''
|
|
}
|
|
|
|
dist.dependsOn distCommon
|
|
|
|
classes.setDependsOn(classes.dependsOn.findAll { it != "compileJava" }) |