Tune build options for kotlin-test, kotlin-runtime, kotlin-stdlib, kotlin-stdlib-jre7/8

This commit is contained in:
Ilya Gorbunov
2017-01-19 05:15:53 +03:00
parent c5aa5ef571
commit 5755210498
7 changed files with 108 additions and 122 deletions
+5
View File
@@ -2,6 +2,7 @@
buildscript {
ext.kotlin_version = "1.1-SNAPSHOT"
ext.kotlin_language_version = "1.1"
repositories {
mavenCentral()
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap-1.1' }
@@ -11,6 +12,10 @@ buildscript {
}
}
ext.JDK_16 = System.getenv("JDK_16")
ext.JDK_17 = System.getenv("JDK_17")
ext.JDK_18 = System.getenv("JDK_18")
allprojects {
apply plugin: 'maven'
+1 -1
View File
@@ -34,7 +34,7 @@ artifacts {
}
compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-module-name", "${project.name}".toString()]
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-module-name", project.name]
}
compileTestKotlin {
+1 -1
View File
@@ -3,7 +3,7 @@ description = 'Kotlin Test'
dependencies {
compile project(':kotlin-runtime')
compile('junit:junit:4.12')
testCompile('junit:junit:4.12')
}
sourceSets {
+31 -37
View File
@@ -1,58 +1,52 @@
description = 'Kotlin stdlib'
description = 'Kotlin Standard Library'
dependencies {
compile project(':kotlin-runtime')
compile project(':kotlin-test-parent:kotlin-test')
compile('junit:junit:4.12')
testCompile project(':kotlin-test-parent:kotlin-test-junit')
compile project(':kotlin-runtime')
testCompile project(':kotlin-test-parent:kotlin-test-junit')
}
sourceSets {
main {
kotlin {
srcDir 'src'
main {
java {
srcDir 'src'
}
}
java {
srcDir 'src'
test {
kotlin {
srcDir 'test'
}
}
}
test {
kotlin {
srcDir 'test'
}
}
}
jar {
manifest {
attributes 'Kotlin-Runtime-Component': 'Core',
manifest {
attributes \
'Kotlin-Runtime-Component': 'Core',
'Kotlin-Version': "$kotlin_language_version",
'Implementation-Title': "${project.description ?: project.name}"
}
}
}
artifacts {
archives sourcesJar
archives javadocJar
archives sourcesJar
archives javadocJar
}
compileJava {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
compileTestJava {
sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.6
targetCompatibility = 1.6
options.fork = true
options.forkOptions.executable = "${JDK_16}/bin/javac"
}
compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xdump-declarations-to", "${buildDir}/stdlib-declarations.json".toString(),
"-module-name", "${project.name}".toString()]
}
compileTestKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
kotlinOptions {
jdkHome = JDK_16
freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xdump-declarations-to", "${buildDir}/stdlib-declarations.json".toString(),
"-module-name", "${project.name}".toString()
]
}
}
+28 -35
View File
@@ -1,56 +1,49 @@
description = 'Kotlin stdlib JRE 7'
description = 'Kotlin Standard Library JRE 7 extension'
dependencies {
compile project(':kotlin-stdlib')
testCompile project(':kotlin-test-parent:kotlin-test-junit')
compile project(':kotlin-stdlib')
testCompile project(':kotlin-test-parent:kotlin-test-junit')
}
sourceSets {
main {
kotlin {
srcDir 'src'
main {
kotlin {
srcDir 'src'
}
}
}
test {
kotlin {
srcDir 'test'
srcDir '../test'
test {
kotlin {
srcDir 'test'
srcDir '../test'
}
}
}
}
jar {
manifest {
attributes 'Kotlin-Runtime-Component': 'Core',
manifest {
attributes \
'Kotlin-Runtime-Component': 'Core',
'Kotlin-Version': "$kotlin_language_version",
'Implementation-Title': "${project.description ?: project.name}"
}
}
}
artifacts {
archives sourcesJar
archives javadocJar
}
compileJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
compileTestJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
archives sourcesJar
archives javadocJar
}
compileKotlin {
kotlinOptions.jdkHome = System.getenv('JDK_17')
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xdump-declarations-to", "${buildDir}/stdlib-declarations.json".toString(),
"-module-name", "${project.name}".toString()]
kotlinOptions.jdkHome = JDK_17
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xdump-declarations-to", "${buildDir}/stdlib-jre7-declarations.json",
"-module-name", project.name
]
}
compileTestKotlin {
kotlinOptions.jdkHome = System.getenv('JDK_17')
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
kotlinOptions.jdkHome = JDK_17
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
}
+32 -40
View File
@@ -1,61 +1,53 @@
description = 'Kotlin stdlib JRE 8'
description = 'Kotlin Standard Library JRE 8 extension'
dependencies {
compile project(':kotlin-stdlib')
compile project(':kotlin-stdlib-jre7')
testCompile project(':kotlin-test-parent:kotlin-test-junit')
testCompile project(':kotlin-stdlib-jre7')
compile project(':kotlin-stdlib')
compile project(':kotlin-stdlib-jre7')
testCompile project(':kotlin-test-parent:kotlin-test-junit')
}
sourceSets {
main {
kotlin {
srcDir 'src'
main {
kotlin {
srcDir 'src'
}
}
}
test {
kotlin {
srcDir 'test'
srcDir '../test'
srcDir '../jre7/test'
test {
kotlin {
srcDir 'test'
srcDir '../test'
srcDir '../jre7/test'
}
}
}
}
jar {
manifest {
attributes 'Kotlin-Runtime-Component': 'Core',
manifest {
attributes \
'Kotlin-Runtime-Component': 'Core',
'Kotlin-Version': "$kotlin_language_version",
'Implementation-Title': "${project.description ?: project.name}"
}
}
}
artifacts {
archives sourcesJar
archives javadocJar
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
archives sourcesJar
archives javadocJar
}
compileKotlin {
kotlinOptions.jdkHome = System.getenv('JDK_18')
kotlinOptions.jvmTarget = 1.8
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xdump-declarations-to", "${buildDir}/stdlib-declarations.json".toString(),
"-module-name", "${project.name}".toString()]
kotlinOptions.jdkHome = JDK_18
kotlinOptions.jvmTarget = 1.8
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xdump-declarations-to", "${buildDir}/stdlib-jre8-declarations.json",
"-module-name", project.name
]
}
compileTestKotlin {
kotlinOptions.jdkHome = System.getenv('JDK_18')
kotlinOptions.jvmTarget = 1.8
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
kotlinOptions.jdkHome = JDK_18
kotlinOptions.jvmTarget = 1.8
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
}
+10 -8
View File
@@ -42,15 +42,17 @@ compileJava {
sourceCompatibility = 1.6
targetCompatibility = 1.6
options.fork = true
// TODO: find how to fix on macos
// options.bootClasspath = "${System.getenv('JDK_16')}/jre/lib/rt.jar"
options.forkOptions.executable = "${JDK_16}/bin/javac"
}
compileKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xdump-declarations-to", "${buildDir}/runtime-declarations.json",
"-cp", "${rootDir}/../dist/builtins",
"-module-name", project.name
]
kotlinOptions {
jdkHome = JDK_16
freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xdump-declarations-to", "${buildDir}/runtime-declarations.json",
"-cp", "${rootDir}/../dist/builtins",
"-module-name", project.name
]
}
}