From 3b5227d6ea8a026dc17a01584708da5212ef1eeb Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 17 Apr 2018 14:44:56 +0300 Subject: [PATCH] Maven: Support "javaParameters" tag in Kotlin/JVM configurations #KT-23845 Fixed --- .../kotlin/idea/maven/KotlinMavenImporter.kt | 1 + .../idea/maven/KotlinMavenImporterTest.kt | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/idea/idea-maven/src/org/jetbrains/kotlin/idea/maven/KotlinMavenImporter.kt b/idea/idea-maven/src/org/jetbrains/kotlin/idea/maven/KotlinMavenImporter.kt index 07843544fc9..f2b1fd00f76 100644 --- a/idea/idea-maven/src/org/jetbrains/kotlin/idea/maven/KotlinMavenImporter.kt +++ b/idea/idea-maven/src/org/jetbrains/kotlin/idea/maven/KotlinMavenImporter.kt @@ -203,6 +203,7 @@ class KotlinMavenImporter : MavenImporter(KOTLIN_PLUGIN_GROUP_ID, KOTLIN_PLUGIN_ arguments.jdkHome = configuration?.getChild("jdkHome")?.text arguments.jvmTarget = configuration?.getChild("jvmTarget")?.text ?: mavenProject.properties["kotlin.compiler.jvmTarget"]?.toString() + arguments.javaParameters = configuration?.getChild("javaParameters")?.text?.toBoolean() ?: false } is K2JSCompilerArguments -> { arguments.sourceMap = configuration?.getChild("sourceMap")?.text?.trim()?.toBoolean() ?: false diff --git a/idea/idea-maven/test/org/jetbrains/kotlin/idea/maven/KotlinMavenImporterTest.kt b/idea/idea-maven/test/org/jetbrains/kotlin/idea/maven/KotlinMavenImporterTest.kt index 5bdb11696ce..d7d7bb20a90 100644 --- a/idea/idea-maven/test/org/jetbrains/kotlin/idea/maven/KotlinMavenImporterTest.kt +++ b/idea/idea-maven/test/org/jetbrains/kotlin/idea/maven/KotlinMavenImporterTest.kt @@ -492,6 +492,58 @@ class KotlinMavenImporterTest : MavenImportingTestCase() { } } + fun testJavaParameters() { + createProjectSubDirs("src/main/kotlin") + + importProject( + """ + test + project + 1.0.0 + + + + org.jetbrains.kotlin + kotlin-stdlib + $kotlinVersion + + + + + src/main/kotlin + + + + org.jetbrains.kotlin + kotlin-maven-plugin + + + + compile + compile + + compile + + + + + true + + + + + """ + ) + + assertModules("project") + assertImporterStatePresent() + + with(facetSettings) { + Assert.assertEquals("-java-parameters", compilerSettings!!.additionalArguments) + Assert.assertTrue((mergedCompilerArguments as K2JVMCompilerArguments).javaParameters) + } + } + fun testJvmFacetConfigurationFromProperties() { createProjectSubDirs("src/main/kotlin", "src/main/kotlin.jvm", "src/test/kotlin", "src/test/kotlin.jvm")