]> source.dussan.org Git - aspectj.git/commitdiff
fix dup entries for target when assembling
authorwisberg <wisberg>
Fri, 14 Oct 2005 05:04:56 +0000 (05:04 +0000)
committerwisberg <wisberg>
Fri, 14 Oct 2005 05:04:56 +0000 (05:04 +0000)
build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java

index 17ac98fac04b1fe47a1f764297fac605caddc84d..88370753fba4f10d9eb7dbf6375899b8be178f24 100644 (file)
@@ -468,7 +468,7 @@ public class AntBuilder extends Builder {
         zip.setDestFile(result.getOutputFile());
         ZipFileSet zipfileset = null;
         final Module module = result.getModule();
-        List known = result.findKnownJarAntecedants();
+        List known = result.findJarRequirements();
         removeLibraryFilesToSkip(module, known);
         // -- merge any antecedents, less any manifest
         for (Iterator iter = known.iterator(); iter.hasNext();) {
@@ -477,20 +477,17 @@ public class AntBuilder extends Builder {
             zipfileset.setProject(project);
             zipfileset.setSrc(jarFile);
             zipfileset.setIncludes("**/*");
-            zipfileset.setExcludes("META-INF/MANIFEST.MF");  // XXXFileLiteral
-            zipfileset.setExcludes("META-INF/manifest.mf");
-            zipfileset.setExcludes("meta-inf/manifest.mf");
-            zipfileset.setExcludes("meta-inf/MANIFEST.MF");
+            String name = jarFile.getName();
+            name = name.substring(0, name.length()-4); // ".jar".length()
+            // required includes self - exclude manifest from others
+            if (!module.name.equals(name)) {
+                zipfileset.setExcludes("META-INF/MANIFEST.MF");  // XXXFileLiteral
+                zipfileset.setExcludes("META-INF/manifest.mf");
+                zipfileset.setExcludes("meta-inf/manifest.mf");
+                zipfileset.setExcludes("meta-inf/MANIFEST.MF");
+            }
             zip.addZipfileset(zipfileset);
         }
-        
-        // merge the module jar itself, including same manifest (?)
-        zipfileset = new ZipFileSet();
-        zipfileset.setProject(project);
-        Kind normal = Result.kind(result.getKind().isNormal(), !Result.ASSEMBLE);
-        File src = module.getResult(normal).getOutputFile();
-        zipfileset.setSrc(src);
-        zip.addZipfileset(zipfileset);
 
         try {
             handler.log("assembling all " + module