Build stdlib without dependency to kotlin-runtime and kotlin-test.

This commit is contained in:
Ilya Gorbunov
2017-02-24 04:10:30 +03:00
parent decccfd0d1
commit 780e12f04a
2 changed files with 71 additions and 14 deletions
+66 -12
View File
@@ -1,16 +1,32 @@
description = 'Kotlin Standard Library' description = 'Kotlin Standard Library'
dependencies {
compile project(':kotlin-runtime')
testCompile project(':kotlin-test-parent:kotlin-test-junit')
}
sourceSets { sourceSets {
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 { main {
java { java {
srcDir 'src' srcDir 'src'
} }
} }
testLib {
kotlin {
srcDir '../kotlin.test/common/src/main/kotlin'
srcDir '../kotlin.test/jvm/src/main/kotlin'
srcDir '../kotlin.test/junit/src/main/kotlin'
//resources '../kotlin.test/junit/src/main/resources'
}
}
test { test {
kotlin { kotlin {
srcDir 'test' srcDir 'test'
@@ -18,8 +34,28 @@ sourceSets {
} }
} }
dependencies {
builtinsCompile group: 'org.jetbrains', name: 'annotations', version:'13.0'
compile sourceSets.builtins.output
// compile project(':kotlin-runtime')
// testCompile project(':kotlin-test-parent:kotlin-test-junit')
testLibCompile sourceSets.builtins.output
//testLibCompile sourceSets.main.output
testLibCompile('junit:junit:4.12')
testCompile configurations.testLibCompile
testCompile sourceSets.testLib.output
}
jar { jar {
manifestAttributes(manifest, project, 'Core') manifestAttributes(manifest, project, 'Core')
from("${rootDir}/../dist/builtins")
from sourceSets.builtins.output
}
sourcesJar {
from "${rootDir}/../core/builtins/native"
from sourceSets.builtins.kotlin
} }
artifacts { artifacts {
@@ -27,21 +63,39 @@ artifacts {
archives javadocJar archives javadocJar
} }
compileJava { [compileJava, compileBuiltinsJava].each { task ->
sourceCompatibility = 1.6 task.sourceCompatibility = 1.6
targetCompatibility = 1.6 task.targetCompatibility = 1.6
options.fork = true task.options.fork = true
options.forkOptions.executable = "${JDK_16}/bin/javac" task.options.forkOptions.executable = "${JDK_16}/bin/javac"
} }
compileBuiltinsKotlin {
kotlinOptions {
jdkHome = JDK_16
freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xdump-declarations-to", "${buildDir}/runtime-declarations.json",
"-cp", "${rootDir}/../dist/builtins",
"-module-name", "kotlin-runtime"
]
}
}
compileKotlin { compileKotlin {
kotlinOptions { kotlinOptions {
jdkHome = JDK_16 jdkHome = JDK_16
freeCompilerArgs = [ freeCompilerArgs = [
"-Xallow-kotlin-package", "-Xallow-kotlin-package",
"-Xmultifile-parts-inherit", "-Xmultifile-parts-inherit",
"-Xdump-declarations-to", "${buildDir}/stdlib-declarations.json".toString(), "-Xdump-declarations-to", "${buildDir}/stdlib-declarations.json",
"-module-name", "${project.name}".toString() "-module-name", project.name
] ]
} }
} }
compileTestLibKotlin {
kotlinOptions {
jdkHome = JDK_16
freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
}
}
+5 -2
View File
@@ -2,7 +2,7 @@
description 'Kotlin Script Runtime' description 'Kotlin Script Runtime'
dependencies { dependencies {
compile project(':kotlin-runtime') compileOnly project(':kotlin-stdlib')
} }
sourceSets { sourceSets {
@@ -23,5 +23,8 @@ artifacts {
} }
compileKotlin { compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-module-name", "${project.name}".toString()] kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-module-name", project.name
]
} }