Skip to content

Commit

Permalink
Duplicate resources are now handled properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmil committed Sep 13, 2014
1 parent a426a56 commit 3efb1d5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
47 changes: 23 additions & 24 deletions META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
<idea-plugin version="2">
<id>pl.cmil.wuff.plugin</id>
<name>Wuff IntelliJ Plugin</name>
<version>0.1.0</version>
<vendor email="cmilmichal@gmail.com" url="https://github.com/mcmil/wuff-intellij-plugin">Michal Ćmil</vendor>
<id>pl.cmil.wuff.plugin</id>
<name>Wuff IntelliJ Plugin</name>
<version>0.1.0</version>
<vendor email="cmilmichal@gmail.com" url="https://github.com/mcmil/wuff-intellij-plugin">Michal Ćmil</vendor>

<description><![CDATA[
<description><![CDATA[
A plugin which attempts to ease Eclipse E4 development using Wuff in IntelliJ IDEA.
]]></description>

<change-notes><![CDATA[
Initial release
<change-notes><![CDATA[
Initial release. Provides Wuff Run Configuration which allows to make changes in the application without a full gradle build.
]]>
</change-notes>
</change-notes>

<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
<idea-version since-build="135"/>
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
<idea-version since-build="135"/>


<extensions defaultExtensionNs="com.intellij">
<!-- Add your extensions here -->
<configurationType implementation="pl.cmil.wuff.plugin.WuffConfigurationType"/>

<extensions defaultExtensionNs="com.intellij">
<!-- Add your extensions here -->
<configurationType implementation="pl.cmil.wuff.plugin.WuffConfigurationType"/>
</extensions>

</extensions>
<application-components>
<!-- Add your application components here -->
</application-components>

<application-components>
<!-- Add your application components here -->
</application-components>
<project-components>
<!-- Add your project components here -->
</project-components>

<project-components>
<!-- Add your project components here -->
</project-components>

<actions>
<!-- Add your actions here -->
</actions>
<actions>
<!-- Add your actions here -->
</actions>

</idea-plugin>
9 changes: 6 additions & 3 deletions src/pl/cmil/wuff/plugin/EquinoxJavaCommandLineState.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.vfs.VirtualFile;
import org.apache.tools.ant.taskdefs.Jar;
import org.apache.tools.ant.taskdefs.Zip;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.types.FileSet;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -96,6 +98,7 @@ private void rebuildModuleJar(Module module) throws ExecutionException {

if (isProjectPrebuiltByGradle(manifestFile)) {
Jar moduleJar = new Jar();
moduleJar.setDuplicate((Zip.Duplicate) Zip.Duplicate.getInstance(Zip.Duplicate.class, "preserve"));
moduleJar.setProject(new org.apache.tools.ant.Project());
moduleJar.setManifest(manifestFile);

Expand All @@ -118,9 +121,9 @@ private void rebuildModuleJar(Module module) throws ExecutionException {
}

private void addDirectoryToJar(Jar moduleJar, File dir) {
FileSet classSet = new FileSet();
classSet.setDir(dir);
moduleJar.addFileset(classSet);
FileSet fileSet = new FileSet();
fileSet.setDir(dir);
moduleJar.addFileset(fileSet);
}

private boolean isProjectPrebuiltByGradle(File manifestFile) {
Expand Down

0 comments on commit 3efb1d5

Please sign in to comment.