]> source.dussan.org Git - aspectj.git/commitdiff
Final part of bug #46347 (-inpath): We do not copy resources from inpath directories...
authoraclement <aclement>
Thu, 26 Feb 2004 11:22:31 +0000 (11:22 +0000)
committeraclement <aclement>
Thu, 26 Feb 2004 11:22:31 +0000 (11:22 +0000)
ajde/testsrc/org/aspectj/ajde/InpathTestcase.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index 36d4b2a095f3a1570f51410f13a1bf099deb9e9c..ce7b3e5f38f029debf0243a4839bed208f1fb141 100644 (file)
@@ -73,9 +73,10 @@ public class InpathTestcase extends AjdeTestCase {
 
                Set expectedOutputJarContents = new HashSet();
                // From indir1
-               expectedOutputJarContents.add("META-INF/MANIFEST.MF");
-               expectedOutputJarContents.add("META-INF/test.xml");
-               expectedOutputJarContents.add("test/test.props");
+// If we don't copy resources, these next three files won't make it.
+//             expectedOutputJarContents.add("META-INF/MANIFEST.MF");
+//             expectedOutputJarContents.add("META-INF/test.xml");
+//             expectedOutputJarContents.add("test/test.props");
                expectedOutputJarContents.add("test/TestProperties.class");
                // From src
                expectedOutputJarContents.add("Main.class");
@@ -107,9 +108,10 @@ public class InpathTestcase extends AjdeTestCase {
 
                Set expectedBindirContents = new HashSet();
                // From indir1
-               expectedBindirContents.add("META-INF/MANIFEST.MF");
-               expectedBindirContents.add("META-INF/test.xml");
-               expectedBindirContents.add("test/test.props");
+// If we don't copy resources, these next three files won't make it
+//             expectedBindirContents.add("META-INF/MANIFEST.MF");
+//             expectedBindirContents.add("META-INF/test.xml");
+//             expectedBindirContents.add("test/test.props");
                expectedBindirContents.add("test/TestProperties.class");
                // From src
                expectedBindirContents.add("Main.class");
@@ -149,7 +151,9 @@ public class InpathTestcase extends AjdeTestCase {
                Set expectedOutputJarContents = new HashSet();
                // From indir1
                expectedOutputJarContents.add("example/HelloWorld.class");
-               expectedOutputJarContents.add("example/HelloWorld.java");
+
+//             If we don't copy resources, this file won't make it
+//             expectedOutputJarContents.add("example/HelloWorld.java");
                // From src
                expectedOutputJarContents.add("Aspect.class");
 
@@ -201,7 +205,9 @@ public class InpathTestcase extends AjdeTestCase {
 
                // From indir1
                expectedBindirContents.add("example/HelloWorld.class");
-               expectedBindirContents.add("example/HelloWorld.java");
+
+//             If we don't copy resources, this file won't make it
+//             expectedBindirContents.add("example/HelloWorld.java");
                // From injar.jar
                expectedBindirContents.add("props/resources.properties");
                // From src
index 2e599fa935ed8eecd99195f2c7d945657cf710b0..5d92584af4115ef3ac7ceadccc052c754453b2e3 100644 (file)
@@ -137,6 +137,9 @@ public class BcelWeaver implements IWeaver {
        }
 
 
+       // The ANT copy task should be used to copy resources across.
+       private final static boolean CopyResourcesFromInpathDirectoriesToOutput=false;
+       
        /**
         * Add any .class files in the directory to the outdir.  Anything other than .class files in
         * the directory (or its subdirectories) are considered resources and are also copied. 
@@ -168,8 +171,10 @@ public class BcelWeaver implements IWeaver {
                                // System.err.println("BCELWeaver: processing class from input directory "+classFile);
                                this.addClassFile(classFile);
                        } else {
+                         if (CopyResourcesFromInpathDirectoriesToOutput) {
                                // System.err.println("BCELWeaver: processing resource from input directory "+filename);
                                addResource(filename,classFile);
+                         }
                        }
                        fis.close();
                }