// always force model generation in AJDE
config.setGenerateModelMode(true);
if (Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap() != null) {
- config.getJavaOptions().putAll(Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap());
+ config.getOptions().set(Ajde.getDefault().getBuildManager().getBuildOptions().getJavaOptionsMap());
}
return config;
// return fixupBuildConfig(config);
private static boolean configureBuildOptions( AjBuildConfig config, BuildOptionsAdapter options, IMessageHandler handler) {
LangUtil.throwIaxIfNull(options, "options");
LangUtil.throwIaxIfNull(config, "config");
- Map javaOptions = config.getJavaOptions();
- LangUtil.throwIaxIfNull(javaOptions, "javaOptions");
+ Map optionsToSet = new HashMap();
+ LangUtil.throwIaxIfNull(optionsToSet, "javaOptions");
if (options.getSourceOnePointFourMode()) {
- javaOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
- javaOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
+ optionsToSet.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
+ optionsToSet.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
}
String enc = options.getCharacterEncoding();
if (!LangUtil.isEmpty(enc)) {
- javaOptions.put(CompilerOptions.OPTION_Encoding, enc );
+ optionsToSet.put(CompilerOptions.OPTION_Encoding, enc );
}
String compliance = options.getComplianceLevel();
if ( compliance.equals( BuildOptionsAdapter.VERSION_13 ) ) {
version = CompilerOptions.VERSION_1_3;
}
- javaOptions.put(CompilerOptions.OPTION_Compliance, version );
- javaOptions.put(CompilerOptions.OPTION_Source, version );
+ optionsToSet.put(CompilerOptions.OPTION_Compliance, version );
+ optionsToSet.put(CompilerOptions.OPTION_Source, version );
}
String sourceLevel = options.getSourceCompatibilityLevel();
slVersion = CompilerOptions.VERSION_1_3;
}
// never set a lower source level than compliance level
- String setCompliance = (String) javaOptions.get( CompilerOptions.OPTION_Compliance);
+ String setCompliance = (String) optionsToSet.get( CompilerOptions.OPTION_Compliance);
if ( ! (setCompliance.equals( CompilerOptions.VERSION_1_4 )
&& slVersion.equals(CompilerOptions.VERSION_1_3)) ) {
- javaOptions.put(CompilerOptions.OPTION_Source, slVersion);
+ optionsToSet.put(CompilerOptions.OPTION_Source, slVersion);
}
}
Set warnings = options.getWarnings();
if (!LangUtil.isEmpty(warnings)) {
// turn off all warnings
- disableWarnings( javaOptions );
+ disableWarnings( optionsToSet );
// then selectively enable those in the set
- enableWarnings( javaOptions, warnings );
+ enableWarnings( optionsToSet, warnings );
}
Set debugOptions = options.getDebugLevel();
varAttr = true;
}
}
- if (sourceLine) javaOptions.put(CompilerOptions.OPTION_SourceFileAttribute,
+ if (sourceLine) optionsToSet.put(CompilerOptions.OPTION_SourceFileAttribute,
CompilerOptions.GENERATE);
- if (varAttr) javaOptions.put(CompilerOptions.OPTION_LocalVariableAttribute,
+ if (varAttr) optionsToSet.put(CompilerOptions.OPTION_LocalVariableAttribute,
CompilerOptions.GENERATE);
- if (lineNo) javaOptions.put(CompilerOptions.OPTION_LineNumberAttribute,
+ if (lineNo) optionsToSet.put(CompilerOptions.OPTION_LineNumberAttribute,
CompilerOptions.GENERATE);
}
//XXX we can't turn off import errors in 3.0 stream
// }
if ( options.getPreserveAllLocals() ) {
- javaOptions.put( CompilerOptions.OPTION_PreserveUnusedLocal,
+ optionsToSet.put( CompilerOptions.OPTION_PreserveUnusedLocal,
CompilerOptions.PRESERVE);
}
if ( !config.isIncrementalMode()
config.setIncrementalMode(true);
}
- config.setJavaOptions( javaOptions );
+ config.getOptions().set(optionsToSet);
String toAdd = options.getNonStandardOptions();
return LangUtil.isEmpty(toAdd)
? true
buildOptions.setCharacterEncoding( "12345" );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
String encoding = (String) options.get( CompilerOptions.OPTION_Encoding );
assertEquals( "character encoding", "12345", encoding );
}
buildOptions.setComplianceLevel( BuildOptionsAdapter.VERSION_14 );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
String compliance = (String) options.get(CompilerOptions.OPTION_Compliance);
String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source);
assertEquals( "compliance level", CompilerOptions.VERSION_1_4, compliance);
buildOptions.setSourceCompatibilityLevel( BuildOptionsAdapter.VERSION_14);
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
String compliance = (String) options.get(CompilerOptions.OPTION_Compliance);
String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source);
assertEquals( "compliance level", CompilerOptions.VERSION_1_3, compliance);
buildOptions.setSourceCompatibilityLevel( BuildOptionsAdapter.VERSION_13);
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
String compliance = (String) options.get(CompilerOptions.OPTION_Compliance);
String sourceLevel = (String) options.get(CompilerOptions.OPTION_Source);
assertEquals( "compliance level", CompilerOptions.VERSION_1_4, compliance);
buildOptions.setWarnings( null );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
// this should leave us with the default warnings
assertOptionEquals( "report overriding package default",
buildOptions.setWarnings( warnings );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
// this should leave us with all the user specifiable warnings
// turned on
buildOptions.setDebugLevel( null );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
// this should leave us with the default debug settings
assertOptionEquals( "debug source",
buildOptions.setDebugLevel( new HashSet() );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
// this should leave us with the debug on
assertOptionEquals( "debug source",
buildOptions.setDebugLevel( debugOpts );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
// this should leave us with all debug on
assertOptionEquals( "debug source",
buildOptions.setDebugLevel( debugOpts );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
// this should leave us with all debug on
assertOptionEquals( "debug source",
buildOptions.setPreserveAllLocals( true );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+ Map options = buildConfig.getOptions().getMap();
String preserve = (String) options.get( CompilerOptions.OPTION_PreserveUnusedLocal );
assertEquals( "preserve unused", CompilerOptions.PRESERVE, preserve );
}