]> source.dussan.org Git - aspectj.git/commitdiff
Support for "-Xset:name=value,name=value,name=value". The name/value data is stored...
authoraclement <aclement>
Thu, 16 Feb 2006 09:04:13 +0000 (09:04 +0000)
committeraclement <aclement>
Thu, 16 Feb 2006 09:04:13 +0000 (09:04 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java
weaver/src/org/aspectj/weaver/World.java

index 0ab15004638f40cf838c36e0348fc5f8ba863b3d..c11e1fc5989a699233d6d56b283173ad21e65062 100644 (file)
@@ -549,6 +549,8 @@ public class BuildArgParser extends Main {
                if (arg.endsWith(":compress")) {
                        showWarning("-Xreweavable:compress is no longer available - reweavable is now default");
                }
+                       } else if (arg.startsWith("-Xset:")) {
+                               buildConfig.setXconfigurationInfo(arg.substring(6));
                        } else if (arg.startsWith("-XnotReweavable")) {
                buildConfig.setXnotReweavable(true);
                        } else if (arg.equals("-XnoInline")) {
index 70cd246c4b08dcd14c70354d63c59dcde940c5f7..9bf4e865bb9b619c914a0a1b5a1fa63610ed8309 100644 (file)
@@ -386,6 +386,7 @@ public class AjBuildConfig {
         if (!isXNotReweavable() && global.isXNotReweavable()) {
                setXnotReweavable(true);
         }
+        setXconfigurationInfo(global.getXconfigurationInfo());
     }
 
     void join(Collection local, Collection global) {
@@ -499,6 +500,13 @@ public class AjBuildConfig {
                options.xNotReweavable = b;
        }
        
+       public void setXconfigurationInfo(String info) {
+               options.xConfigurationInfo = info;
+       }
+       public String getXconfigurationInfo() {
+               return options.xConfigurationInfo;
+       }
+       
        public void setXHasMemberSupport(boolean enabled) {
                options.xHasMember = enabled;
        }
index 4e5230a91ce38adf9aec7fbb17c76fda869f4eb1..526086446cee1f45088372ba79fbb13f0158b0af 100644 (file)
@@ -625,6 +625,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
                cp.addAll(buildConfig.getClasspath());
                BcelWorld bcelWorld = new BcelWorld(cp, handler, null);
                bcelWorld.setBehaveInJava5Way(buildConfig.getBehaveInJava5Way());
+               bcelWorld.performExtraConfiguration(buildConfig.getXconfigurationInfo());
                bcelWorld.setTargetAspectjRuntimeLevel(buildConfig.getTargetAspectjRuntimeLevel());
                bcelWorld.setOptionalJoinpoints(buildConfig.getXJoinpoints());
                bcelWorld.setXnoInline(buildConfig.isXnoInline());
index 1519e462ec0069a7de2052c82f78d7ebb0ec425b..636772c00f955fd3e1820f2d54897665c855e734 100644 (file)
@@ -79,6 +79,8 @@ public class AjCompilerOptions extends CompilerOptions {
        // Specifies the level of the aspectjrt.jar we are targetting
        public String targetAspectjRuntimeLevel = Constants.RUNTIME_LEVEL_DEFAULT;
        
+       public String xConfigurationInfo;
+       
        // these next four not exposed by IDEs
        public boolean generateModel = false;
        public boolean generateJavaDocsInModel = false;
index 03ff28c3b9a9bcfa32bd68dccc6d1e2d34587db8..38c808c9848904593c3c9cf0595884c365a2a145 100644 (file)
@@ -22,6 +22,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.WeakHashMap;
 
 import org.aspectj.asm.IHierarchy;
@@ -89,6 +90,7 @@ public abstract class World implements Dump.INode {
     /** Flags for the new joinpoints that are 'optional' */
     private boolean optionalJoinpoint_ArrayConstruction = false;  // Command line flag: "arrayconstruction"
     
+    private Properties extraConfiguration = null;
     
     /** 
      * A list of RuntimeExceptions containing full stack information for every
@@ -656,6 +658,35 @@ public abstract class World implements Dump.INode {
        behaveInJava5Way = b;
     }
        
+       public void performExtraConfiguration(String config) {
+               if (config==null) return;
+               // Bunch of name value pairs to split
+               extraConfiguration = new Properties();
+               int pos =-1;
+               while ((pos=config.indexOf(","))!=-1) {
+                       String nvpair = config.substring(0,pos);
+                       int pos2 = nvpair.indexOf("=");
+                       if (pos2!=-1) {
+                               String n = nvpair.substring(0,pos2);
+                               String v = nvpair.substring(pos2+1);
+                               extraConfiguration.setProperty(n,v);
+                       }
+                       config = config.substring(pos+1);
+               }
+               if (config.length()>0) {
+                       int pos2 = config.indexOf("=");
+                       if (pos2!=-1) {
+                               String n = config.substring(0,pos2);
+                               String v = config.substring(pos2+1);
+                               extraConfiguration.setProperty(n,v);
+                       }
+               }
+       }
+       
+       public Properties getExtraConfiguration() {
+               return extraConfiguration;
+       }
+       
        public boolean isInJava5Mode() {
                return behaveInJava5Way;
        }