diff options
author | aclement <aclement> | 2005-11-29 13:21:24 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-29 13:21:24 +0000 |
commit | 385d9ef905eb07bdd37fd25887ad0a8e69e06f45 (patch) | |
tree | 2e9b41bb67df4ca35c4edc2eccd61e23f1f7dca5 /org.aspectj.ajdt.core | |
parent | b6980f2f7b2697e41b454a16d3a7bd1e0135aa8d (diff) | |
download | aspectj-385d9ef905eb07bdd37fd25887ad0a8e69e06f45.tar.gz aspectj-385d9ef905eb07bdd37fd25887ad0a8e69e06f45.zip |
code for 116679: targetting a 1.2.1 runtime
Diffstat (limited to 'org.aspectj.ajdt.core')
6 files changed, 25 insertions, 0 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 9db08913d..2f4eea60e 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 @@ -20,6 +20,7 @@ import java.util.*; import org.aspectj.ajdt.internal.core.builder.*; import org.aspectj.bridge.*; import org.aspectj.util.*; +import org.aspectj.weaver.Constants; import org.aspectj.weaver.Dump; import org.aspectj.weaver.WeaverMessages; import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException; @@ -637,6 +638,14 @@ public class BuildArgParser extends Main { buildConfig.setProceedOnError(true); } else if (new File(arg).isDirectory()) { showError("dir arg not permitted: " + arg); + } else if (arg.startsWith("-Xajruntimetarget")) { + if (arg.endsWith(":1.2")) { + buildConfig.setTargetAspectjRuntimeLevel(Constants.RUNTIME_LEVEL_12); + } else if (arg.endsWith(":1.5")) { + buildConfig.setTargetAspectjRuntimeLevel(Constants.RUNTIME_LEVEL_15); + } else { + showError("-Xajruntimetarget:<level> only supports a target level of 1.2 or 1.5"); + } } else if (arg.equals("-1.5")) { buildConfig.setBehaveInJava5Way(true); unparsedArgs.add("-1.5"); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties index a297978ec..3feed9b3d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties @@ -131,6 +131,8 @@ xoption.usage = {0} non-standard options:\n\ \t-XserializableAspects allows aspects to implement serializable\n\ \t-XnoWeave compile classes but do not weave. Deprecated, use\n\ \t reweavable instead.\n\ +\t-Xajruntimelevel:<level> allows code to be generated that targets\n\ +\t a 1.2 or a 1.5 level AspectJ runtime (default 1.5)\n\ \t-XhasMember allow hasmethod() and hasfield type patterns in\n\ \t declare parents and declare @type\n ## options not documented above (per ..ajdt.ajc.BuildArgParser.java): 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 505b80844..25200a327 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 @@ -571,4 +571,12 @@ public class AjBuildConfig { public boolean getBehaveInJava5Way() { return options.behaveInJava5Way; } + + public void setTargetAspectjRuntimeLevel(String level) { + options.targetAspectjRuntimeLevel = level; + } + + public String getTargetAspectjRuntimeLevel() { + return options.targetAspectjRuntimeLevel; + } } 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 63ad260af..0cbb761db 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 @@ -608,6 +608,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc cp.addAll(buildConfig.getClasspath()); BcelWorld bcelWorld = new BcelWorld(cp, handler, null); bcelWorld.setBehaveInJava5Way(buildConfig.getBehaveInJava5Way()); + bcelWorld.setTargetAspectjRuntimeLevel(buildConfig.getTargetAspectjRuntimeLevel()); bcelWorld.setXnoInline(buildConfig.isXnoInline()); bcelWorld.setXlazyTjp(buildConfig.isXlazyTjp()); bcelWorld.setXHasMemberSupportEnabled(buildConfig.isXHasMemberEnabled()); 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 7481b4ffc..d5f04d885 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 @@ -17,6 +17,7 @@ import java.util.Map; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions; +import org.aspectj.weaver.Constants; /** @@ -73,6 +74,9 @@ public class AjCompilerOptions extends CompilerOptions { // If true - autoboxing behaves differently ... public boolean behaveInJava5Way = false; + // Specifies the level of the aspectjrt.jar we are targetting + public String targetAspectjRuntimeLevel = Constants.RUNTIME_LEVEL_DEFAULT; + // these next four not exposed by IDEs public boolean generateModel = false; public boolean generateJavaDocsInModel = false; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java index 8bfa9b9d6..84371f08a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java @@ -156,6 +156,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto cpManager = new EclipseClassPathManager(nameEnvironment); myBcelWorld = new BcelWorld(cpManager,new UnhandledMessageHandler(getProject()),null /*(xrefHandler)*/); myBcelWorld.setBehaveInJava5Way(options.behaveInJava5Way); + myBcelWorld.setTargetAspectjRuntimeLevel(options.targetAspectjRuntimeLevel); myBcelWorld.setXnoInline(options.xNoInline); myBcelWorld.setXlazyTjp(options.xLazyThisJoinPoint); myBcelWorld.setXHasMemberSupportEnabled(options.xHasMember); |