]> source.dussan.org Git - aspectj.git/commitdiff
Support for java5-testsrc - somewhat scattered. hmm.
authorwisberg <wisberg>
Thu, 5 May 2005 07:53:56 +0000 (07:53 +0000)
committerwisberg <wisberg>
Thu, 5 May 2005 07:53:56 +0000 (07:53 +0000)
build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
build/src/org/aspectj/internal/tools/build/Module.java
build/src/org/aspectj/internal/tools/build/Util.java

index 8b3021ab8652d73b8247175d6e82f8f334daf37f..49d30f13f9abed743704f57b5ab4ed6eb665fa98 100644 (file)
@@ -223,7 +223,8 @@ public class AntBuilder extends Builder {
             File file = (File) iter.next();
             path.createPathElement().setLocation(file);
             if (!isJava5Compile 
-                    && Util.Constants.JAVA5_SRC.equals(file.getName())) {
+                    && (Util.Constants.JAVA5_SRC.equals(file.getName())
+                        || Util.Constants.JAVA5_TESTSRC.equals(file.getName()))) {
                 isJava5Compile = true;
             }
             if (!hasSourceDirectories) {
@@ -284,12 +285,13 @@ public class AntBuilder extends Builder {
             javac.setSource("1.3");
         } else {
             javac.setSource("1.5");
-            javac.setTarget("1.5"); 
+            javac.setTarget("1.5");
+            // TODO allow modules to mix 1.5 and prior code by omitting 1.5
             // gack if non-java5 and non-testsrc in this build
             for (Iterator iter = module.getSrcDirs().iterator(); iter.hasNext();) {
                 String name = ((File) iter.next()).getName();
                 if (!Util.Constants.JAVA5_SRC.equals(name)
-                    && !Util.Constants.TESTSRC.equals(name)) {
+                    && !Util.Constants.JAVA5_TESTSRC.equals(name)) {
                     String m = "modules mixing pre-15 and 15 source are built with -target 1.5";
                     throw new BuildException(m + ": " + name);
                 }
index 8aea24dffd0278e694ecb29eebdb88c748c561ec..b3038881945ed07b321f78d468e273ffd7a84837 100644 (file)
@@ -489,10 +489,12 @@ public class Module {
                 File srcDir = (File) iter.next();
                 String lcname = srcDir.getName().toLowerCase();
                 if (trimTesting 
-                        && Util.Constants.TESTSRC.equals(lcname)) { 
+                        && (Util.Constants.TESTSRC.equals(lcname)
+                           || Util.Constants.JAVA5_TESTSRC.equals(lcname))) { 
                     iter.remove();
                 } else if (!Util.JAVA5_VM 
-                        && Util.Constants.JAVA5_SRC.equals(lcname)) {
+                        && (Util.Constants.JAVA5_SRC.equals(lcname)
+                            || Util.Constants.JAVA5_TESTSRC.equals(lcname))) {
                     // assume optional for pre-1.5 builds
                     iter.remove();
                 }
index 806154c200a4c302afae1ab147c562f9319c4576..3b676d4e48d36514a30b515b3f7b59bfaf9d28ee 100644 (file)
@@ -29,6 +29,7 @@ public class Util {
     public static class Constants {
         public static final String TESTSRC = "testsrc";
         public static final String JAVA5_SRC = "java5-src";
+        public static final String JAVA5_TESTSRC = "java5-testsrc";
     }
     // XXX quick hack for Java 5 support
     public static final boolean JAVA5_VM;