From 68f2d9977ee5bdd9eb48098e7d56ec461fd5db8f Mon Sep 17 00:00:00 2001 From: wisberg Date: Thu, 23 Oct 2003 15:53:35 +0000 Subject: [PATCH] support for -1.3, -1.4, and -1.5 --- .../testing/harness/bridge/CompilerRun.java | 51 ++++++++++++++++--- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java b/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java index 37d5ba9b5..91be27a0b 100644 --- a/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java +++ b/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java @@ -62,9 +62,13 @@ import java.util.ListIterator; * */ public class CompilerRun implements IAjcRun { + static final String BUILDER_COMPILER = + "org.aspectj.ajdt.internal.core.builder.Builder.Command"; static final String AJDE_COMPILER = CompileCommand.class.getName(); static final String AJCTASK_COMPILER = AjcTaskCompileCommand.class.getName(); + static final String JAVAC_COMPILER + = JavacCompileCommand.class.getName(); static final String[] RA_String = new String[0]; @@ -142,7 +146,7 @@ public class CompilerRun implements IAjcRun { if ((null == rdir) || (0 == rdir.length())) { testBaseSrcDir = sandbox.testBaseDir; } else { - testBaseSrcDir = new File(sandbox.testBaseDir, rdir); + testBaseSrcDir = new File(sandbox.testBaseDir, rdir); // XXX what if rdir is two levels deep? if (!validator.canReadDir(testBaseSrcDir, "sandbox.testBaseSrcDir")) { return false; } @@ -296,9 +300,11 @@ public class CompilerRun implements IAjcRun { sandbox.setAspectpath(aspectFiles, checkReadable, this); } - // set bootclasspath, if set as system property - urk! - if (!LangUtil.isEmpty(JavaRun.BOOTCLASSPATH)) { - sandbox.setBootclasspath(JavaRun.BOOTCLASSPATH, this); + // set bootclasspath if set for forking + AbstractRunSpec.Fork fork = spec.getFork(); + String bootclasspath = fork.getJavaBootclasspath(); + if (fork.fork() && (!LangUtil.isEmpty(bootclasspath))) { + sandbox.setBootclasspath(bootclasspath, this); } return true; } @@ -466,7 +472,17 @@ public class CompilerRun implements IAjcRun { private static final String[] INVALID_OPTIONS = new String[] { "-workingdir", "-argfile", "-sourceroots", "-outjar"}; // when updating these, update tests/harness/selectionTest.xml + + /** no support in the javac for these otherwise-valid options */ + private static final String[] INVALID_JAVAC_OPTIONS = new String[] + { "-lenient", "-strict", "-usejavac", "-preprocess", + "-XOcodeSize", "-XSerializable", "-XaddSafePrefix", + "-XtargetNearSource", + "-incremental", "-Xlint", "-aspectpath", + "workingdir", "-argfile", "-sourceroots", "-outjar", + }; + /** no support in the eclipse-based compiler for these otherwise-valid options */ private static final String[] INVALID_ECLIPSE_OPTIONS = new String[] { "-lenient", "-strict", "-usejavac", "-preprocess", @@ -478,12 +494,12 @@ public class CompilerRun implements IAjcRun { { SEEK_PREFIX, // eajc does not support -usejavac, -preprocess - // testFlag() handles -ajc, -eclipse, -ajdeCompiler, -ignoreWarnings + // testFlag() handles -ajc, -eclipse, -javac, -ajdeCompiler, -ignoreWarnings "-usejavac", "-preprocess", "-Xlint", "-lenient", "-strict", "-source14", "-verbose", "-emacssym", - "-ajc", "-eclipse", "-ajdeCompiler", "-ajctaskCompiler", - "-ignoreWarnings", + "-ajc", "-eclipse", "-ajdeCompiler", "-ajctaskCompiler", "-javac", + "-ignoreWarnings", "-1.3", "-1.4", "-1.5", // XXX consider adding [!^]ajdeCompiler "!usejavac", "!preprocess", "!Xlint", "!lenient", "!strict", @@ -738,6 +754,9 @@ public class CompilerRun implements IAjcRun { * as this will otherwise fail to process it correctly. * This converts it back to -source 1.4. *

+ * This also interprets any relevant System properties, + * e.g., from JavaRun.BOOTCLASSPATH_KEY. + *

* Finally, compiler limitations are enforced here by skipping * tests which the compiler cannot do: *