Simplify code in module script/xml generation
Pass classpath and annotation roots explicitly instead of wrapped in a callback
Original commit: 3ea59117ac
This commit is contained in:
+2
-13
@@ -47,8 +47,6 @@ import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import static org.jetbrains.kotlin.jps.build.JpsUtils.getAllDependencies;
|
||||
import static org.jetbrains.kotlin.modules.KotlinModuleDescriptionBuilder.DependencyProcessor;
|
||||
import static org.jetbrains.kotlin.modules.KotlinModuleDescriptionBuilder.DependencyProvider;
|
||||
|
||||
public class KotlinBuilderModuleScriptGenerator {
|
||||
|
||||
@@ -89,9 +87,10 @@ public class KotlinBuilderModuleScriptGenerator {
|
||||
builder.addModule(
|
||||
target.getId(),
|
||||
outputDir.getAbsolutePath(),
|
||||
getKotlinModuleDependencies(target),
|
||||
moduleSources,
|
||||
findSourceRoots(context, target),
|
||||
findClassPathRoots(target),
|
||||
findAnnotationRoots(target),
|
||||
target.isTests(),
|
||||
// this excludes the output directories from the class path, to be removed for true incremental compilation
|
||||
outputDirs
|
||||
@@ -116,16 +115,6 @@ public class KotlinBuilderModuleScriptGenerator {
|
||||
return outputDir;
|
||||
}
|
||||
|
||||
private static DependencyProvider getKotlinModuleDependencies(final ModuleBuildTarget target) {
|
||||
return new DependencyProvider() {
|
||||
@Override
|
||||
public void processClassPath(@NotNull DependencyProcessor processor) {
|
||||
processor.processClassPathSection("Classpath", findClassPathRoots(target));
|
||||
processor.processAnnotationRoots(findAnnotationRoots(target));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Collection<File> findClassPathRoots(@NotNull ModuleBuildTarget target) {
|
||||
return getAllDependencies(target).classes().getRoots();
|
||||
|
||||
Reference in New Issue
Block a user