Generate parameters metadata for java 8 reflection

This commit is contained in:
Mikhael Bogdanov
2016-11-10 12:43:27 +01:00
parent 7721aa189f
commit 61da8be260
17 changed files with 244 additions and 1 deletions
@@ -72,6 +72,10 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
@ValueDescription("<version>")
public String jvmTarget;
@GradleOption(DefaultValues.BooleanFalseDefault.class)
@Argument(value = "java-parameters", description = "Generate metadata for Java 1.8 reflection on method parameters")
public boolean javaParameters;
// Advanced options
@Argument(value = "Xno-call-assertions", description = "Don't generate not-null assertion after each invocation of method returning not-null")
public boolean noCallAssertions;
@@ -139,6 +139,8 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
}
}
configuration.put(JVMConfigurationKeys.PARAMETERS_METADATA, arguments.javaParameters)
if (arguments.interfaceCompatibility) {
val target = configuration.get(JVMConfigurationKeys.JVM_TARGET)
if (target != JvmTarget.JVM_1_8) {