Maven: support languageVersion parameter, linked to property kotlin.compiler.languageVersion.

This commit is contained in:
Ilya Gorbunov
2016-06-20 23:04:30 +03:00
parent 848599e940
commit 1157e052ee
2 changed files with 8 additions and 6 deletions
@@ -21,6 +21,10 @@
</dependency>
</dependencies>
<properties>
<kotlin.compiler.languageVersion>1.0</kotlin.compiler.languageVersion>
</properties>
<build>
<pluginManagement>
<plugins>
@@ -56,12 +60,6 @@
</goals>
</execution>
</executions>
<configuration>
<args>
<arg>-language-version</arg>
<arg>1.0</arg>
</args>
</configuration>
</plugin>
</plugins>
</build>
@@ -61,6 +61,9 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
@Parameter(defaultValue = "${project.artifactId}-test", required = true, readonly = true)
protected String testModuleName;
@Parameter(property = "kotlin.compiler.languageVersion", required = false, readonly = false)
protected String languageVersion;
@Parameter(property = "kotlin.compiler.jvmTarget", required = false, readonly = false)
protected String jvmTarget;
@@ -106,6 +109,7 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
getLog().info("Optimization is turned off");
}
arguments.languageVersion = languageVersion;
arguments.jvmTarget = jvmTarget;
}
}