Fixed clearing incremental cache for removed source files.
For writing system-dependent paths were used, for deleting were system-independent. That's why cache was not cleared on Windows.
Original commit: 060796997e
This commit is contained in:
@@ -64,16 +64,22 @@ public class KotlinSourceFileCollector {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static List<String> getRemovedKotlinFiles(
|
||||
public static List<File> getRemovedKotlinFiles(
|
||||
@NotNull DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder,
|
||||
@NotNull ModuleBuildTarget target
|
||||
) throws IOException {
|
||||
return ContainerUtil.filter(dirtyFilesHolder.getRemovedFiles(target), new Condition<String>() {
|
||||
@Override
|
||||
public boolean value(String s) {
|
||||
return FileUtilRt.extensionEquals(s, "kt");
|
||||
}
|
||||
});
|
||||
return ContainerUtil.map(ContainerUtil.filter(dirtyFilesHolder.getRemovedFiles(target), new Condition<String>() {
|
||||
@Override
|
||||
public boolean value(String s) {
|
||||
return FileUtilRt.extensionEquals(s, "kt");
|
||||
}
|
||||
}),
|
||||
new Function<String, File>() {
|
||||
@Override
|
||||
public File fun(String s) {
|
||||
return new File(s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -96,7 +96,7 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
||||
return DO_NOTHING
|
||||
}
|
||||
|
||||
public fun clearCacheForRemovedFiles(removedSourceFiles: Collection<String>, outDirectory: File, compilationSuccessful: Boolean) {
|
||||
public fun clearCacheForRemovedFiles(removedSourceFiles: Collection<File>, outDirectory: File, compilationSuccessful: Boolean) {
|
||||
removedSourceFiles.forEach { packagePartMap.remove(it) }
|
||||
|
||||
if (compilationSuccessful) {
|
||||
@@ -398,8 +398,8 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
||||
map.put(sourceFile.getAbsolutePath(), className.getInternalName())
|
||||
}
|
||||
|
||||
public fun remove(sourceFile: String) {
|
||||
map.remove(sourceFile)
|
||||
public fun remove(sourceFile: File) {
|
||||
map.remove(sourceFile.getAbsolutePath())
|
||||
}
|
||||
|
||||
public fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
||||
|
||||
Reference in New Issue
Block a user