Skip to content

Commit 692e432

Browse files
committed
Generate Java 8 bytecode with Kotlin compiler
This commit also updates Kotlin from beta 2 to RC. Issue: SPR-15183
1 parent 4d48fde commit 692e432

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

build.gradle

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
dependencies {
77
classpath("io.spring.gradle:propdeps-plugin:0.0.8")
88
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
9-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0-beta-38")
9+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0-rc-91")
1010
classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
1111
classpath("io.spring.gradle:dependency-management-plugin:1.0.0.BUILD-SNAPSHOT")
1212
}
@@ -71,7 +71,7 @@ configure(allprojects) { project ->
7171
ext.junitVersion = "4.12"
7272
ext.junitJupiterVersion = '5.0.0-M3'
7373
ext.junitPlatformVersion = '1.0.0-M3'
74-
ext.kotlinVersion = "1.1.0-beta-38" // also change kotlin-gradle-plugin version when upgrading
74+
ext.kotlinVersion = "1.1.0-rc-91" // also change kotlin-gradle-plugin version when upgrading
7575
ext.log4jVersion = '2.8'
7676
ext.nettyVersion = "4.1.8.Final"
7777
ext.okhttpVersion = "2.7.5"
@@ -110,6 +110,12 @@ configure(allprojects) { project ->
110110
// Kotlin compiler does not support JDK 9 yet, see https://youtrack.jetbrains.com/issue/KT-14988
111111
if (!JavaVersion.current().java9Compatible) {
112112
apply plugin: "kotlin"
113+
compileKotlin {
114+
kotlinOptions.jvmTarget = "1.8"
115+
}
116+
compileTestKotlin {
117+
kotlinOptions.jvmTarget = "1.8"
118+
}
113119
}
114120

115121
configurations {
@@ -403,7 +409,7 @@ project("spring-core") {
403409
optional("net.sf.jopt-simple:jopt-simple:5.0.3")
404410
optional("org.aspectj:aspectjweaver:${aspectjVersion}")
405411
optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
406-
optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
412+
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
407413
optional("org.reactivestreams:reactive-streams")
408414
optional("io.projectreactor:reactor-core")
409415
optional "io.reactivex:rxjava:${rxjavaVersion}"
@@ -441,7 +447,7 @@ project("spring-beans") {
441447
compile(files(project(":spring-core").cglibRepackJar))
442448
optional("javax.inject:javax.inject:1")
443449
optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
444-
optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
450+
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
445451
optional("org.yaml:snakeyaml:${snakeyamlVersion}")
446452
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
447453
}
@@ -536,7 +542,7 @@ project("spring-context") {
536542
optional("org.aspectj:aspectjweaver:${aspectjVersion}")
537543
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
538544
optional("org.beanshell:bsh:2.0b5")
539-
optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
545+
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
540546
testCompile("org.apache.commons:commons-pool2:2.4.2")
541547
testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
542548
testCompile("javax.inject:javax.inject-tck:1")
@@ -614,7 +620,7 @@ project("spring-messaging") {
614620
testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
615621
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
616622
testCompile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
617-
testCompile("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
623+
testCompile("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
618624
testRuntime("javax.activation:activation:${activationApiVersion}")
619625
testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
620626
testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
@@ -678,7 +684,7 @@ project("spring-jdbc") {
678684
optional("org.apache.derby:derby:10.13.1.1")
679685
optional("org.apache.derby:derbyclient:10.13.1.1")
680686
optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
681-
optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
687+
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
682688
}
683689
}
684690

@@ -780,7 +786,7 @@ project("spring-web") {
780786
optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
781787
optional("javax.xml.ws:jaxws-api:${jaxwsVersion}")
782788
optional("javax.mail:javax.mail-api:${javamailVersion}")
783-
optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
789+
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
784790
testCompile(project(":spring-context-support")) // for JafMediaTypeFactory
785791
testCompile("io.projectreactor.addons:reactor-test")
786792
testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
@@ -843,7 +849,7 @@ project("spring-webflux") {
843849
exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec"
844850
}
845851
optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
846-
optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
852+
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
847853
testCompile("io.projectreactor.addons:reactor-test")
848854
testCompile("javax.validation:validation-api:${beanvalVersion}")
849855
testCompile("org.hibernate:hibernate-validator:${hibval5Version}")

0 commit comments

Comments
 (0)