From 906c84944b2e740a1bd781e936d48b31ce09b9ac Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 12 Mar 2008 17:51:13 +0000 Subject: [PATCH] fix for 222437 - don't always ignore MANIFEST.MF --- .../ajdt/internal/core/builder/AjBuildManager.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 0bfb22d82..dd873aefd 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -461,7 +461,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc String filename = entry.getName(); // System.out.println("? copyResourcesFromJarFile() filename='" + filename +"'"); - if (!entry.isDirectory() && acceptResource(filename)) { + if (!entry.isDirectory() && acceptResource(filename,false)) { byte[] bytes = FileUtil.readAsByteArray(inStream); writeResource(filename,bytes,jarFile); } @@ -494,7 +494,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc } private void copyResourcesFromFile(File f,String filename,File src) throws IOException { - if (!acceptResource(filename)) return; + if (!acceptResource(filename,true)) return; FileInputStream fis = null; try { fis = new FileInputStream(f); @@ -572,7 +572,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc } } - private boolean acceptResource(String resourceName) { + private boolean acceptResource(String resourceName,boolean fromFile) { if ( (resourceName.startsWith("CVS/")) || (resourceName.indexOf("/CVS/") != -1) || @@ -581,7 +581,8 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc (resourceName.startsWith(".svn/")) || (resourceName.indexOf("/.svn/")!=-1) || (resourceName.endsWith("/.svn")) || - (resourceName.toUpperCase().equals(MANIFEST_NAME)) + // Do not copy manifests if either they are coming from a jar or we are writing to a jar + (resourceName.toUpperCase().equals(MANIFEST_NAME) && (!fromFile || zos!=null)) ) { return false; -- 2.39.5