From 2ff97f0cb94ee091962c46a6c911acfcad24f004 Mon Sep 17 00:00:00 2001 From: mkersten Date: Tue, 22 Jul 2003 15:56:26 +0000 Subject: [PATCH] Addes support for JDT's Java options map. --- ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java | 10 ++++++++++ .../src/org/aspectj/ajde/internal/CompilerAdapter.java | 6 ++++++ .../org/aspectj/ajde/ui/internal/AjcBuildOptions.java | 9 ++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java b/ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java index ea8905b71..7ac61377a 100644 --- a/ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java +++ b/ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java @@ -16,6 +16,7 @@ package org.aspectj.ajde; +import java.util.Map; import java.util.Set; /** @@ -45,6 +46,15 @@ public interface BuildOptionsAdapter { public static final String DEBUG_VARS = "vars"; public static final String DEBUG_ALL = "all"; + + /** + * This map shortcuts any other Java-specific options that would get set by return + * values from the other methods. + * + * @return a map of all the java-specific options, null if individual options will be passed + */ + public Map getJavaOptionsMap(); + /** * Use javac to generate .class files. The default is "false". * From -usejavac diff --git a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java index dd1bf57c0..0722b425a 100644 --- a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java +++ b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java @@ -45,6 +45,7 @@ import java.util.StringTokenizer; public class CompilerAdapter { + private Map optionsMap; private AjBuildManager buildManager = null; private MessageHandlerAdapter messageHandler = null; private BuildNotifierAdapter currNotifier = null; @@ -146,6 +147,8 @@ public class CompilerAdapter { * corresponding AjBuildConfig otherwise */ public AjBuildConfig genBuildConfig(String configFile) { + + init(); File config = new File(configFile); if (!config.exists()) { @@ -201,6 +204,9 @@ public class CompilerAdapter { * */ protected AjBuildConfig fixupBuildConfig(AjBuildConfig local, AjBuildConfig global, BuildOptionsAdapter buildOptions, ProjectPropertiesAdapter projectOptions) { + if (Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap() != null) { + local.getJavaOptions().putAll(Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap()); + } return local; } diff --git a/ajde/src/org/aspectj/ajde/ui/internal/AjcBuildOptions.java b/ajde/src/org/aspectj/ajde/ui/internal/AjcBuildOptions.java index 247474518..25029613d 100644 --- a/ajde/src/org/aspectj/ajde/ui/internal/AjcBuildOptions.java +++ b/ajde/src/org/aspectj/ajde/ui/internal/AjcBuildOptions.java @@ -19,6 +19,7 @@ package org.aspectj.ajde.ui.internal; import java.util.HashSet; import java.util.Iterator; +import java.util.Map; import java.util.Set; import java.util.StringTokenizer; @@ -50,9 +51,10 @@ public class AjcBuildOptions implements BuildOptionsAdapter { private static final String PRESERVE_LOCALS = AJC + ".preserveLocals"; private static final String DEFAULT = "default"; - public AjcBuildOptions(UserPreferencesAdapter userPreferencesAdapter) { this.preferencesAdapter = userPreferencesAdapter; + + } /** @deprecated */ @@ -307,4 +309,9 @@ public class AjcBuildOptions implements BuildOptionsAdapter { return debugOptions.toString(); } + + public Map getJavaOptionsMap() { + return null; + } + } -- 2.39.5