From 3848a0c7ae8b15e0f8168c73cfed713699539136 Mon Sep 17 00:00:00 2001 From: wisberg Date: Thu, 5 May 2005 07:53:56 +0000 Subject: Support for java5-testsrc - somewhat scattered. hmm. --- build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java | 8 +++++--- build/src/org/aspectj/internal/tools/build/Module.java | 6 ++++-- build/src/org/aspectj/internal/tools/build/Util.java | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'build') diff --git a/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java b/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java index 8b3021ab8..49d30f13f 100644 --- a/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java +++ b/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java @@ -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); } diff --git a/build/src/org/aspectj/internal/tools/build/Module.java b/build/src/org/aspectj/internal/tools/build/Module.java index 8aea24dff..b30388819 100644 --- a/build/src/org/aspectj/internal/tools/build/Module.java +++ b/build/src/org/aspectj/internal/tools/build/Module.java @@ -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(); } diff --git a/build/src/org/aspectj/internal/tools/build/Util.java b/build/src/org/aspectj/internal/tools/build/Util.java index 806154c20..3b676d4e4 100644 --- a/build/src/org/aspectj/internal/tools/build/Util.java +++ b/build/src/org/aspectj/internal/tools/build/Util.java @@ -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; -- cgit v1.2.3