store per-target build caches corresponding to modules with case-only different names in separate directories (IDEA-181766)

This commit is contained in:
Eugene Zhuravlev
2017-11-16 15:00:19 +01:00
parent 4976411181
commit d92d1de56b
3 changed files with 7 additions and 5 deletions
@@ -66,9 +66,8 @@ public final class BinaryContent {
if (parentFile == null) {
throw e;
}
if (!parentFile.mkdirs()) {
throw e;
}
//noinspection ResultOfMethodCallIgnored
parentFile.mkdirs();
// second attempt
_writeToFile(file, this);
}
@@ -49,6 +49,9 @@ public class BuildDataPathsImpl implements BuildDataPaths {
@Override
public File getTargetDataRoot(BuildTarget<?> target) {
return new File(getTargetTypeDataRoot(target.getTargetType()), PathUtilRt.suggestFileName(target.getId(), true, false));
final String targetId = target.getId();
// targetId may diff from another targetId only in case
// when used as a file name in case-insensitive file systems, both paths for different targets will point to the same dir
return new File(getTargetTypeDataRoot(target.getTargetType()), PathUtilRt.suggestFileName(targetId + "_" + Integer.toHexString(targetId.hashCode()), true, false));
}
}
@@ -43,7 +43,7 @@ import java.util.concurrent.ConcurrentMap;
* Date: 10/7/11
*/
public class BuildDataManager implements StorageOwner {
private static final int VERSION = 33 + (PersistentHashMapValueStorage.COMPRESSION_ENABLED ? 1:0);
private static final int VERSION = 35 + (PersistentHashMapValueStorage.COMPRESSION_ENABLED ? 1:0);
private static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.incremental.storage.BuildDataManager");
private static final String SRC_TO_FORM_STORAGE = "src-form";
private static final String OUT_TARGET_STORAGE = "out-target";