diff --git a/ant/src/org/jetbrains/kotlin/ant/Kotlin2JvmTask.kt b/ant/src/org/jetbrains/kotlin/ant/Kotlin2JvmTask.kt index 6a26df13645..2285c40dad2 100644 --- a/ant/src/org/jetbrains/kotlin/ant/Kotlin2JvmTask.kt +++ b/ant/src/org/jetbrains/kotlin/ant/Kotlin2JvmTask.kt @@ -25,6 +25,7 @@ public class Kotlin2JvmTask : KotlinCompilerBaseTask() { public var externalAnnotations: Path? = null public var includeRuntime: Boolean = true + public var moduleName: String? = null private var compileClasspath: Path? = null diff --git a/ant/src/org/jetbrains/kotlin/ant/KotlinCompilerAdapter.java b/ant/src/org/jetbrains/kotlin/ant/KotlinCompilerAdapter.java index ef075360592..a4d6b09f93c 100644 --- a/ant/src/org/jetbrains/kotlin/ant/KotlinCompilerAdapter.java +++ b/ant/src/org/jetbrains/kotlin/ant/KotlinCompilerAdapter.java @@ -38,12 +38,19 @@ public class KotlinCompilerAdapter extends Javac13 { private static final List KOTLIN_EXTENSIONS = Arrays.asList("kt", "kts"); private Path externalAnnotations; + + private String moduleName; + public List additionalArguments = new ArrayList(0); public void setExternalAnnotations(Path externalAnnotations) { this.externalAnnotations = externalAnnotations; } + public void setModuleName(String moduleName) { + this.moduleName = moduleName; + } + public Path createExternalAnnotations() { if (externalAnnotations == null) { externalAnnotations = new Path(getProject()); @@ -85,6 +92,8 @@ public class KotlinCompilerAdapter extends Javac13 { kotlinc.setExternalAnnotations(externalAnnotations); + kotlinc.setModuleName(moduleName); + kotlinc.getAdditionalArguments().addAll(additionalArguments); // Javac13#execute passes everything in compileList to javac, which doesn't recognize .kt files