3db1613167
Produce special stdlib artifact with annotations for dist. Put js outputs to dist, they're required for JS backend tests. Use kotlin-compiler for maven, which has all required dependencies bundled. Clean local directory repository on clean. Change paths in tests to compiled artifacts.
123 lines
2.9 KiB
Groovy
123 lines
2.9 KiB
Groovy
description = 'Kotlin Standard Library'
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
configureJvmProject(project)
|
|
configurePublishing(project)
|
|
|
|
sourceSets {
|
|
annotations {
|
|
if(!System.properties.'idea.active') {
|
|
java {
|
|
srcDir "${rootDir}/../core/runtime.jvm/src"
|
|
include 'org/jetbrains/annotations/**'
|
|
}
|
|
kotlin {
|
|
exclude '**/*'
|
|
}
|
|
}
|
|
}
|
|
builtins {
|
|
java {
|
|
srcDir "${rootDir}/../core/builtins/src"
|
|
srcDir "${rootDir}/../core/runtime.jvm/src"
|
|
exclude 'org/jetbrains/annotations/**'
|
|
}
|
|
kotlin {
|
|
srcDir "${rootDir}/../core/builtins/src"
|
|
srcDir "${rootDir}/../core/runtime.jvm/src"
|
|
exclude 'org/jetbrains/annotations/**'
|
|
}
|
|
}
|
|
main {
|
|
java {
|
|
srcDir 'src'
|
|
}
|
|
}
|
|
test {
|
|
kotlin {
|
|
srcDir 'test'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
builtinsCompile group: 'org.jetbrains', name: 'annotations', version:'13.0'
|
|
compile group: 'org.jetbrains', name: 'annotations', version:'13.0'
|
|
compile sourceSets.builtins.output
|
|
|
|
testCompile project(':kotlin-test:kotlin-test-junit')
|
|
}
|
|
|
|
task originalStdlibJar(type: Jar) {
|
|
baseName = 'original-kotlin-stdlib'
|
|
from sourceSets.main.output
|
|
}
|
|
|
|
jar {
|
|
manifestAttributes(manifest, project, 'Main')
|
|
from("${rootDir}/../dist/builtins")
|
|
from sourceSets.builtins.output
|
|
}
|
|
|
|
task distJar(type: Jar) {
|
|
baseName = 'dist-kotlin-stdlib'
|
|
version = null
|
|
manifestAttributes(manifest, project, 'Main')
|
|
from("${rootDir}/../dist/builtins")
|
|
from sourceSets.annotations.output
|
|
from sourceSets.builtins.output
|
|
from sourceSets.main.output
|
|
}
|
|
|
|
sourcesJar {
|
|
from "${rootDir}/../core/builtins/native"
|
|
from sourceSets.builtins.kotlin
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
}
|
|
|
|
dist {
|
|
[distJar, sourcesJar].forEach {
|
|
from(it) {
|
|
rename('dist-', '')
|
|
}
|
|
// legacy
|
|
from(it) {
|
|
rename('dist-', '')
|
|
rename('kotlin-stdlib', 'kotlin-runtime')
|
|
}
|
|
}
|
|
from (configurations.compile) {
|
|
include 'annotations*.jar'
|
|
}
|
|
}
|
|
|
|
compileBuiltinsKotlin {
|
|
kotlinOptions {
|
|
freeCompilerArgs = [
|
|
"-version",
|
|
"-Xallow-kotlin-package",
|
|
"-Xdump-declarations-to", "${buildDir}/runtime-declarations.json",
|
|
"-cp", "${rootDir}/../dist/builtins",
|
|
"-module-name", "kotlin-runtime"
|
|
]
|
|
}
|
|
}
|
|
compileKotlin {
|
|
kotlinOptions {
|
|
freeCompilerArgs = [
|
|
"-version",
|
|
"-Xallow-kotlin-package",
|
|
"-Xmultifile-parts-inherit",
|
|
"-Xdump-declarations-to", "${buildDir}/stdlib-declarations.json",
|
|
"-module-name", project.name
|
|
]
|
|
}
|
|
}
|
|
|
|
kotlin.experimental.coroutines 'enable'
|