summaryrefslogtreecommitdiffstats
path: root/build/src
diff options
context:
space:
mode:
authorwisberg <wisberg>2005-05-05 07:53:56 +0000
committerwisberg <wisberg>2005-05-05 07:53:56 +0000
commit3848a0c7ae8b15e0f8168c73cfed713699539136 (patch)
tree1aeabde1c5bd586dbcf4da2ffbe047b67735faae /build/src
parentcdede6da8be04746b9958a47e3ccdfe67bd0cd5a (diff)
downloadaspectj-3848a0c7ae8b15e0f8168c73cfed713699539136.tar.gz
aspectj-3848a0c7ae8b15e0f8168c73cfed713699539136.zip
Support for java5-testsrc - somewhat scattered. hmm.
Diffstat (limited to 'build/src')
-rw-r--r--build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java8
-rw-r--r--build/src/org/aspectj/internal/tools/build/Module.java6
-rw-r--r--build/src/org/aspectj/internal/tools/build/Util.java1
3 files changed, 10 insertions, 5 deletions
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;