Build stdlib without dependency to kotlin-runtime and kotlin-test.
This commit is contained in:
@@ -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"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user