Ignore all output directories in a chunk
Otherwise the class files generated by previous builds for one of the targets in the chunk would interfere with source definitions, and we get overload resolution ambiguities and such
This commit is contained in:
@@ -41,9 +41,7 @@ import org.jetbrains.jps.model.module.JpsSdkDependency;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import static org.jetbrains.jet.compiler.runner.KotlinModuleDescriptionBuilder.DependencyProcessor;
|
||||
import static org.jetbrains.jet.compiler.runner.KotlinModuleDescriptionBuilder.DependencyProvider;
|
||||
@@ -61,6 +59,10 @@ public class KotlinBuilderModuleScriptGenerator {
|
||||
|
||||
boolean noSources = true;
|
||||
|
||||
Set<File> outputDirs = new HashSet<File>();
|
||||
for (ModuleBuildTarget target : chunk.getTargets()) {
|
||||
outputDirs.add(getOutputDir(target));
|
||||
}
|
||||
for (ModuleBuildTarget target : chunk.getTargets()) {
|
||||
File outputDir = getOutputDir(target);
|
||||
|
||||
@@ -73,8 +75,8 @@ public class KotlinBuilderModuleScriptGenerator {
|
||||
getKotlinModuleDependencies(context, target),
|
||||
sourceFiles,
|
||||
target.isTests(),
|
||||
// this excludes the output directory from the class path, to be removed for true incremental compilation
|
||||
Collections.singleton(outputDir)
|
||||
// this excludes the output directories from the class path, to be removed for true incremental compilation
|
||||
outputDirs
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ public class KotlinJpsBuildTestCase extends AbstractKotlinJpsBuildTestCase {
|
||||
private void assertOutputDeleted(String sourceFileName, String packageClassFqName, String moduleName) {
|
||||
File file = new File(workDir, sourceFileName);
|
||||
change(file.getAbsolutePath());
|
||||
makeAll();
|
||||
makeAll().assertSuccessful();
|
||||
|
||||
String outputDirPrefix = "out/production/" + moduleName + "/";
|
||||
assertDeleted(outputDirPrefix + packageClassFqName.replace('.', '/') + ".class",
|
||||
|
||||
Reference in New Issue
Block a user