mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
correctly process file in packaging compiler if filename case is changed
This commit is contained in:
+2
-1
@@ -13,6 +13,7 @@ import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.text.FilePathHashingStrategy;
|
||||
import gnu.trove.THashMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -242,7 +243,7 @@ public class ProcessingItemsBuilder extends BuildInstructionVisitor {
|
||||
final VirtualFile[] children = sourceFile.getChildren();
|
||||
THashMap<String, VirtualFile> outputChildren = null;
|
||||
if (outputFile != null) {
|
||||
outputChildren = new THashMap<String, VirtualFile>();
|
||||
outputChildren = new THashMap<String, VirtualFile>(FilePathHashingStrategy.create());
|
||||
VirtualFile[] files = outputFile.getChildren();
|
||||
if (files != null) {
|
||||
for (VirtualFile file : files) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.intellij.openapi.roots.impl.OrderEntryUtil;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
@@ -204,6 +205,12 @@ public class DeploymentUtilImpl extends DeploymentUtil {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Copy file '" + fromFile + "' to '"+toFile+"'");
|
||||
}
|
||||
if (toFile.exists() && !SystemInfo.isFileSystemCaseSensitive) {
|
||||
File canonicalFile = toFile.getCanonicalFile();
|
||||
if (!canonicalFile.getAbsolutePath().equals(toFile.getAbsolutePath())) {
|
||||
FileUtil.delete(toFile);
|
||||
}
|
||||
}
|
||||
FileUtil.copy(fromFile, toFile);
|
||||
}
|
||||
catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user