Save target type in Kotlin Builder
This commit is contained in:
+5
-1
@@ -26,6 +26,8 @@ import kotlin.io.IoPackage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.ModuleChunk;
|
||||
import org.jetbrains.jps.builders.BuildTargetType;
|
||||
import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
|
||||
import org.jetbrains.jps.builders.java.JavaSourceRootDescriptor;
|
||||
import org.jetbrains.jps.builders.logging.ProjectBuilderLogger;
|
||||
import org.jetbrains.jps.incremental.CompileContext;
|
||||
@@ -82,6 +84,8 @@ public class KotlinBuilderModuleScriptGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
BuildTargetType<?> targetType = target.getTargetType();
|
||||
assert targetType instanceof JavaModuleBuildTargetType;
|
||||
builder.addModule(
|
||||
target.getId(),
|
||||
outputDir.getAbsolutePath(),
|
||||
@@ -89,7 +93,7 @@ public class KotlinBuilderModuleScriptGenerator {
|
||||
findSourceRoots(context, target),
|
||||
findClassPathRoots(target),
|
||||
findAnnotationRoots(target),
|
||||
target.isTests(),
|
||||
(JavaModuleBuildTargetType) targetType,
|
||||
// this excludes the output directories from the class path, to be removed for true incremental compilation
|
||||
outputDirs
|
||||
);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.modules;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
|
||||
import org.jetbrains.kotlin.config.IncrementalCompilation;
|
||||
import org.jetbrains.kotlin.utils.Printer;
|
||||
|
||||
@@ -45,12 +46,12 @@ public class KotlinModuleXmlBuilder {
|
||||
List<File> javaSourceRoots,
|
||||
Collection<File> classpathRoots,
|
||||
List<File> annotationRoots,
|
||||
boolean tests,
|
||||
JavaModuleBuildTargetType targetType,
|
||||
Set<File> directoriesToFilterOut
|
||||
) {
|
||||
assert !done : "Already done";
|
||||
|
||||
if (tests) {
|
||||
if (targetType.isTests()) {
|
||||
p.println("<!-- Module script for tests -->");
|
||||
}
|
||||
else {
|
||||
@@ -59,6 +60,7 @@ public class KotlinModuleXmlBuilder {
|
||||
|
||||
p.println("<", MODULE, " ",
|
||||
NAME, "=\"", escapeXml(moduleName), "\" ",
|
||||
TYPE, "=\"", escapeXml(targetType.getTypeId()), "\" ",
|
||||
OUTPUT_DIR, "=\"", getEscapedPath(new File(outputDir)), "\">"
|
||||
);
|
||||
p.pushIndent();
|
||||
|
||||
Reference in New Issue
Block a user