Browse Source

Support for "-Xset:name=value,name=value,name=value". The name/value data is stored in a properties object in the world and is accessible through getExtraConfiguration(). This will enable easier tailoring of weaver/world behaviour since you wont need to add new X option processing for every little thing. Should possibly only be used for tuning parameters.

tags/POST_MEMORY_CHANGES
aclement 18 years ago
parent
commit
2c55408317

+ 2
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java View 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")) {

+ 8
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java View 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;
}

+ 1
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java View 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());

+ 2
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java View 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;

+ 31
- 0
weaver/src/org/aspectj/weaver/World.java View 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;
}

Loading…
Cancel
Save