From a9570ce0e77cf6f7a1a54a6870f42adfdf16dbdd Mon Sep 17 00:00:00 2001 From: nik Date: Tue, 3 Nov 2009 15:09:00 +0300 Subject: [PATCH] IDEADEV-41034: Artifact: manifest.mf name recognition is case-sensitive --- .../impl/elements/PackagingElementFactoryImpl.java | 12 +++++++++++- .../ElementWithManifestPropertiesPanel.form | 2 +- .../ElementWithManifestPropertiesPanel.java | 2 +- .../packaging/elements/PackagingElementFactory.java | 6 +++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/elements/PackagingElementFactoryImpl.java b/java/compiler/impl/src/com/intellij/packaging/impl/elements/PackagingElementFactoryImpl.java index 53c7dcbf22d8..0ca24141838e 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/elements/PackagingElementFactoryImpl.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/elements/PackagingElementFactoryImpl.java @@ -142,7 +142,17 @@ public class PackagingElementFactoryImpl extends PackagingElementFactory { @Override public void addFileCopy(@NotNull CompositePackagingElement root, @NotNull String outputDirectoryPath, @NotNull String sourceFilePath) { - getOrCreateDirectory(root, outputDirectoryPath).addOrFindChild(new FileCopyPackagingElement(sourceFilePath)); + addFileCopy(root, outputDirectoryPath, sourceFilePath, null); + } + + @Override + public void addFileCopy(@NotNull CompositePackagingElement root, @NotNull String outputDirectoryPath, @NotNull String sourceFilePath, + @Nullable String outputFileName) { + final String fileName = PathUtil.getFileName(sourceFilePath); + if (outputFileName != null && outputFileName.equals(fileName)) { + outputFileName = null; + } + getOrCreateDirectory(root, outputDirectoryPath).addOrFindChild(new FileCopyPackagingElement(sourceFilePath, outputFileName)); } @NotNull diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.form b/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.form index e78575bd42f5..f40bb99a4a92 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.form +++ b/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.form @@ -147,7 +147,7 @@ - + diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.java b/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.java index 36b8c52602d3..af75622de8b0 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.java @@ -170,7 +170,7 @@ public abstract class ElementWithManifestPropertiesPanel getOrCreateArchive(@NotNull CompositePackagingElement parent, @NotNull String relativePath); + public abstract void addFileCopy(@NotNull CompositePackagingElement root, @NotNull String outputDirectoryPath, @NotNull String sourceFilePath, + final String outputFileName); + public abstract void addFileCopy(@NotNull CompositePackagingElement root, @NotNull String outputDirectoryPath, @NotNull String sourceFilePath); @NotNull public abstract PackagingElement createParentDirectories(@NotNull String relativeOutputPath, @NotNull PackagingElement element); + @NotNull public abstract List> createParentDirectories(@NotNull String relativeOutputPath, @NotNull List> elements); - @NotNull + public abstract CompositePackagingElementType[] getCompositeElementTypes(); @Nullable