]> source.dussan.org Git - aspectj.git/commitdiff
Permit outjars to be used as injars in subsequent compile runs
authorwisberg <wisberg>
Thu, 27 Jan 2005 02:16:21 +0000 (02:16 +0000)
committerwisberg <wisberg>
Thu, 27 Jan 2005 02:16:21 +0000 (02:16 +0000)
testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java

index ba25fb4da06604e53695b0a7439a88f78d1850fc..0ab12ebb30b39fa617371c5811a9341884f24e82 100644 (file)
@@ -179,8 +179,9 @@ public class CompilerRun implements IAjcRun {
         // validate readable for sources
         if (!spec.badInput) {
             if (!validator.canRead(testBaseSrcDir, srcPaths, "sources")
-                || !validator.canRead(testBaseSrcDir, injarPaths, "injars")
-                || !validator.canRead(testBaseSrcDir, inpathPaths, "inpaths")
+                // moved validation of inpathPaths below due to ambiguous base dir
+                //|| !validator.canRead(testBaseSrcDir, injarPaths, "injars")
+                //|| !validator.canRead(testBaseSrcDir, inpathPaths, "inpaths")
                 || !validator.canRead(
                     testBaseSrcDir,
                     spec.argfiles,
@@ -231,7 +232,24 @@ public class CompilerRun implements IAjcRun {
             FileUtil.getBaseDirFiles(testBaseSrcDir, spec.classpath);
         final File[] xlintFiles = (null == spec.xlintfile ? new File[0]
             : FileUtil.getBaseDirFiles(testBaseSrcDir, new String[] {spec.xlintfile}));
-            
+
+        // injars might be outjars in the classes dir...
+        for (int i = 0; i < injarFiles.length; i++) {
+            if (!injarFiles[i].exists()) {
+                injarFiles[i] = new File(sandbox.classesDir, injarPaths[i]);
+            }
+        }
+        for (int i = 0; i < inpathFiles.length; i++) {
+            if (!inpathFiles[i].exists()) {
+                inpathFiles[i] = new File(sandbox.classesDir, inpathPaths[i]);
+            }
+        }
+        // moved after solving any injars that were outjars
+        if (!validator.canRead(injarFiles, "injars")
+                || !validator.canRead(injarFiles, "injars")) {
+            return false;
+        }
+        
         // hmm - duplicates validation above, verifying getBaseDirFiles?
         if (!spec.badInput) {
             if (!validator.canRead(argFiles, "argFiles")