diff options
author | aclement <aclement> | 2008-05-13 23:03:00 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-05-13 23:03:00 +0000 |
commit | 71fa6407d3fcd3e4aa4c2d938694d4e76c668bf0 (patch) | |
tree | 6ca2f16f876382a9657850fa175ce890a760bdf4 /org.aspectj.ajdt.core | |
parent | a8739e3359b0da1fdb60e2201f8fe37265aa9d04 (diff) | |
download | aspectj-71fa6407d3fcd3e4aa4c2d938694d4e76c668bf0.tar.gz aspectj-71fa6407d3fcd3e4aa4c2d938694d4e76c668bf0.zip |
231963: implementation, allow -checkRuntimeVersion:true or false
Diffstat (limited to 'org.aspectj.ajdt.core')
4 files changed, 41 insertions, 12 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java index b63f6bf58..b8d925505 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -545,6 +545,15 @@ public class BuildArgParser extends Main { } else if (arg.equals("-crossrefs")) { buildConfig.setGenerateCrossRefsMode(true); buildConfig.setGenerateModelMode(true); + } else if (arg.startsWith("-checkRuntimeVersion:")) { + String lcArg = arg.toLowerCase(); + if (lcArg.endsWith(":false")) { + buildConfig.setCheckRuntimeVersion(false); + } else if (lcArg.endsWith(":true")) { + buildConfig.setCheckRuntimeVersion(true); + } else { + showError("bad value for -checkRuntimeVersion option, must be true or false"); + } } else if (arg.equals("-emacssym")) { buildConfig.setEmacsSymMode(true); buildConfig.setGenerateModelMode(true); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java index 963951dee..dc495fead 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java @@ -355,6 +355,11 @@ public class AjBuildConfig { if (!incrementalMode && global.incrementalMode) { incrementalMode = true; } + + if (isCheckRuntimeVersion() && !global.isCheckRuntimeVersion()) { + setCheckRuntimeVersion(false); + } + join(inJars, global.inJars); join(inPath, global.inPath); if ((null == lintMode) @@ -563,6 +568,14 @@ public class AjBuildConfig { public void setGenerateCrossRefsMode(boolean on) { options.generateCrossRefs = on; } + + public boolean isCheckRuntimeVersion() { + return options.checkRuntimeVersion; + } + + public void setCheckRuntimeVersion(boolean on) { + options.checkRuntimeVersion = on; + } public boolean isEmacsSymMode() { return options.generateEmacsSymFiles; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 2b6202217..13488e224 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -218,18 +218,20 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc this.handler = CountingMessageHandler.makeCountingMessageHandler(baseHandler); - if (DO_RUNTIME_VERSION_CHECK) { - String check = checkRtJar(buildConfig); - if (check != null) { - if (FAIL_IF_RUNTIME_NOT_FOUND) { - MessageUtil.error(handler, check); - CompilationAndWeavingContext.leavingPhase(ct); - return false; - } else { - MessageUtil.warn(handler, check); - } - } - } + if (buildConfig==null || buildConfig.isCheckRuntimeVersion()) { + if (DO_RUNTIME_VERSION_CHECK) { + String check = checkRtJar(buildConfig); + if (check != null) { + if (FAIL_IF_RUNTIME_NOT_FOUND) { + MessageUtil.error(handler, check); + CompilationAndWeavingContext.leavingPhase(ct); + return false; + } else { + MessageUtil.warn(handler, check); + } + } + } + } // if (batch) { setBuildConfig(buildConfig); @@ -1189,8 +1191,10 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc return null; } + if (buildConfig == null || buildConfig.getFullClasspath() == null) return "no classpath specified"; + String ret = null; for (Iterator it = buildConfig.getFullClasspath().iterator(); it.hasNext(); ) { File p = new File( (String)it.next() ); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java index 469d7ea78..9ca9e7ea1 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java @@ -94,6 +94,9 @@ public class AjCompilerOptions extends CompilerOptions { */ public boolean generateCrossRefs = false; + // Check aspectjrt*.jar exists and within it the version number is right (see AjBuildManager.checkRtJar()) + public boolean checkRuntimeVersion = true; + public boolean proceedOnError = false; |