Maven: Support "javaParameters" tag in Kotlin/JVM configurations
#KT-23845 Fixed
This commit is contained in:
@@ -203,6 +203,7 @@ class KotlinMavenImporter : MavenImporter(KOTLIN_PLUGIN_GROUP_ID, KOTLIN_PLUGIN_
|
|||||||
arguments.jdkHome = configuration?.getChild("jdkHome")?.text
|
arguments.jdkHome = configuration?.getChild("jdkHome")?.text
|
||||||
arguments.jvmTarget = configuration?.getChild("jvmTarget")?.text ?:
|
arguments.jvmTarget = configuration?.getChild("jvmTarget")?.text ?:
|
||||||
mavenProject.properties["kotlin.compiler.jvmTarget"]?.toString()
|
mavenProject.properties["kotlin.compiler.jvmTarget"]?.toString()
|
||||||
|
arguments.javaParameters = configuration?.getChild("javaParameters")?.text?.toBoolean() ?: false
|
||||||
}
|
}
|
||||||
is K2JSCompilerArguments -> {
|
is K2JSCompilerArguments -> {
|
||||||
arguments.sourceMap = configuration?.getChild("sourceMap")?.text?.trim()?.toBoolean() ?: false
|
arguments.sourceMap = configuration?.getChild("sourceMap")?.text?.trim()?.toBoolean() ?: false
|
||||||
|
|||||||
@@ -492,6 +492,58 @@ class KotlinMavenImporterTest : MavenImportingTestCase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun testJavaParameters() {
|
||||||
|
createProjectSubDirs("src/main/kotlin")
|
||||||
|
|
||||||
|
importProject(
|
||||||
|
"""
|
||||||
|
<groupId>test</groupId>
|
||||||
|
<artifactId>project</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
<version>$kotlinVersion</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>src/main/kotlin</sourceDirectory>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
|
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>compile</id>
|
||||||
|
<phase>compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<javaParameters>true</javaParameters>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
assertModules("project")
|
||||||
|
assertImporterStatePresent()
|
||||||
|
|
||||||
|
with(facetSettings) {
|
||||||
|
Assert.assertEquals("-java-parameters", compilerSettings!!.additionalArguments)
|
||||||
|
Assert.assertTrue((mergedCompilerArguments as K2JVMCompilerArguments).javaParameters)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun testJvmFacetConfigurationFromProperties() {
|
fun testJvmFacetConfigurationFromProperties() {
|
||||||
createProjectSubDirs("src/main/kotlin", "src/main/kotlin.jvm", "src/test/kotlin", "src/test/kotlin.jvm")
|
createProjectSubDirs("src/main/kotlin", "src/main/kotlin.jvm", "src/test/kotlin", "src/test/kotlin.jvm")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user