Configure Kotlin compiler to use -java-parameters by default
See gh-12641
This commit is contained in:
committed by
Andy Wilkinson
parent
404f22e5f9
commit
5e2726f896
@@ -52,4 +52,17 @@ public class KotlinPluginActionIntegrationTests {
|
||||
.containsPattern("org.jetbrains.kotlin:kotlin-stdlib-jdk8:* -> 1.2.10");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void kotlinCompileTasksUseJavaParametersFlagByDefault() {
|
||||
assertThat(this.gradleBuild.build("kotlinCompileTasksJavaParameters").getOutput())
|
||||
.contains("compileKotlin java parameters: true")
|
||||
.contains("compileTestKotlin java parameters: true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void kotlinCompileTasksCanOverrideDefaultJavaParametersFlag() {
|
||||
assertThat(this.gradleBuild.build("kotlinCompileTasksJavaParameters").getOutput())
|
||||
.contains("compileKotlin java parameters: false")
|
||||
.contains("compileTestKotlin java parameters: false");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.2.10'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
||||
|
||||
tasks.withType(KotlinCompile) {
|
||||
kotlinOptions.javaParameters = false
|
||||
}
|
||||
|
||||
task('kotlinCompileTasksJavaParameters') {
|
||||
doFirst {
|
||||
tasks.withType(KotlinCompile) {
|
||||
println "$name java parameters: ${kotlinOptions.javaParameters}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.2.10'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
||||
|
||||
task('kotlinCompileTasksJavaParameters') {
|
||||
doFirst {
|
||||
tasks.withType(KotlinCompile) {
|
||||
println "$name java parameters: ${kotlinOptions.javaParameters}"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user