builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java
branchC3_BUILDER_WORK
changeset 1755 e65ffeef96f7
parent 1749 0d2e2c9062b1
child 1757 ec3c1e4702be
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java	Tue Aug 03 11:44:01 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java	Tue Aug 03 14:18:04 2010 -0500
@@ -35,17 +35,16 @@
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 
-import com.nokia.carbide.cdt.builder.BuildArgumentsInfo;
 import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
 import com.nokia.carbide.cdt.builder.EpocEngineHelper;
 import com.nokia.carbide.cdt.builder.builder.CarbideCPPBuilder;
-import com.nokia.carbide.cdt.builder.project.IBuildArgumentsInfo;
 import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
 import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
 import com.nokia.carbide.cdt.builder.project.IEnvironmentVarsInfo;
 import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo;
 import com.nokia.carbide.cdt.internal.api.builder.SISBuilderInfo2;
 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine;
+import com.nokia.carbide.cpp.internal.api.sdk.BuildArgumentsInfo;
 import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1;
 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildContext;
 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo;
@@ -57,6 +56,7 @@
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
 import com.nokia.cpp.internal.api.utils.core.TrackedResource;
 
+@SuppressWarnings("deprecation")
 public class CarbideBuildConfiguration implements ICarbideBuildConfiguration {
 	
 	static final String NOT_INSTALLED = "(SDK not found)"; //$NON-NLS-1$
@@ -64,7 +64,6 @@
 	public static final String CARBIDE_STORAGE_ID = "CarbideConfigurationDataProvider"; //$NON-NLS-1$
 	protected final static String SIS_BUILDER_DATA_ID = "SIS_BUILDER_DATA_ID"; //$NON-NLS-1$
 	protected final static String ENV_VAR_DATA_ID = "ENV_VAR_DATA_ID"; //$NON-NLS-1$
-	protected final static String ARGUMENTS_DATA_ID = "ARGUMENTS_DATA_ID"; //$NON-NLS-1$
 	protected final static String ROM_BUILDER_DATA_ID = "ROM_BUILDER_DATA_ID"; //$NON-NLS-1$
 	
 	// SBSv2 only config settings 
@@ -74,7 +73,7 @@
 	protected TrackedResource projectTracker;
 	protected List<ISISBuilderInfo> sisBuilderInfoList;
 	protected EnvironmentVarsInfo2 envVarsInfo;
-	protected BuildArgumentsInfo buildArgumentsInfo;
+	
 	protected BuildConfigurationData buildConfigData;
 	protected SBSv2BuilderInfo sbsv2BuilderInfo;
 	protected boolean rebuildNeeded;
@@ -84,7 +83,7 @@
 		projectTracker = new TrackedResource(project);
 		sisBuilderInfoList = new ArrayList<ISISBuilderInfo>(0);
 		envVarsInfo = new EnvironmentVarsInfo2(project, context);
-		buildArgumentsInfo = new BuildArgumentsInfo(getSDK());
+		
 		buildConfigData = new BuildConfigurationData(this);
 		if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(project)){
 			sbsv2BuilderInfo = new SBSv2BuilderInfo((ISBSv2BuildContext)context);
@@ -107,13 +106,15 @@
 					}
 				} else if (se.getName().equals(ENV_VAR_DATA_ID)) {
 					envVarsInfo.loadFromStorage(se);
-				} else if (se.getName().equals(ARGUMENTS_DATA_ID)) {
-					loadBuildArgsFromStorage(se);
 				} else if (se.getName().equals(SBSV2_DATA_ID)){
 					if (sbsv2BuilderInfo != null){
 						sbsv2BuilderInfo.loadFromStorage(se);
 					}
 				}
+				
+				// Load build context specific settings.
+				getBuildContext().loadConfigurationSettings(se);
+				
 			}
 		} else {
 			throw new CoreException(new Status(IStatus.ERROR, CarbideBuilderPlugin.PLUGIN_ID, IStatus.OK, "Unable to load Carbide settings for project " + projectTracker.getProject().getName() + ", " + getDisplayString(), null));
@@ -131,7 +132,9 @@
 			}
 			
 			envVarsInfo.saveToStorage(rootStorage.createChild(ENV_VAR_DATA_ID));
-			saveBuildArgsToStorage(rootStorage.createChild(ARGUMENTS_DATA_ID));
+			
+			// Save build context specific settings.
+			this.getBuildContext().saveConfigurationSettings(rootStorage);
 			
 			if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(getCarbideProject().getProject())){ 
 				sbsv2BuilderInfo.saveToStorage(rootStorage.createChild(SBSV2_DATA_ID)); 
@@ -139,108 +142,7 @@
 		}
 	}
 	
-	private void loadBuildArgsFromStorage(ICStorageElement rootStorage) {
-		String value = rootStorage.getAttribute(BuildArgumentsInfo.BLDMAKEBLDFILESARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.bldmakeBldFilesArgs = value;
-		}
-		
-		value = rootStorage.getAttribute(BuildArgumentsInfo.BLDMAKECLEANARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.bldmakeCleanArgs = value;
-		}
 
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDBUILDARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldBuildArgs = value;
-		}
-
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDEXPORTARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldExportArgs = value;
-		}
-
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDMAKEFILEARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldMakefileArgs = value;
-		}
-
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDLIBRARYARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldLibraryArgs = value;
-		}
-
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDRESOURCEARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldResourceArgs = value;
-		}
-
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDTARGETARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldTargetArgs = value;
-		}
-
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDFINALARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldFinalArgs = value;
-		}
-
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDCLEANARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldCleanArgs = value;
-		}
-
-		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDFREEZEARGSSTORAGE);
-		if (value != null) {
-			buildArgumentsInfo.abldFreezeArgs = value;
-		}
-	}
-	
-	public void saveBuildArgsToStorage(ICStorageElement rootStorage) {
-		if (buildArgumentsInfo.bldmakeBldFilesArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.BLDMAKEBLDFILESARGSSTORAGE, buildArgumentsInfo.bldmakeBldFilesArgs);
-		}
-
-		if (buildArgumentsInfo.bldmakeCleanArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.BLDMAKECLEANARGSSTORAGE, buildArgumentsInfo.bldmakeCleanArgs);
-		}
-
-		if (buildArgumentsInfo.abldBuildArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDBUILDARGSSTORAGE, buildArgumentsInfo.abldBuildArgs);
-		}
-
-		if (buildArgumentsInfo.abldExportArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDEXPORTARGSSTORAGE, buildArgumentsInfo.abldExportArgs);
-		}
-
-		if (buildArgumentsInfo.abldMakefileArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDMAKEFILEARGSSTORAGE, buildArgumentsInfo.abldMakefileArgs);
-		}
-
-		if (buildArgumentsInfo.abldLibraryArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDLIBRARYARGSSTORAGE, buildArgumentsInfo.abldLibraryArgs);
-		}
-
-		if (buildArgumentsInfo.abldResourceArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDRESOURCEARGSSTORAGE, buildArgumentsInfo.abldResourceArgs);
-		}
-
-		if (buildArgumentsInfo.abldTargetArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDTARGETARGSSTORAGE, buildArgumentsInfo.abldTargetArgs);
-		}
-
-		if (buildArgumentsInfo.abldFinalArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDFINALARGSSTORAGE, buildArgumentsInfo.abldFinalArgs);
-		}
-
-		if (buildArgumentsInfo.abldCleanArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDCLEANARGSSTORAGE, buildArgumentsInfo.abldCleanArgs);
-		}
-
-		if (buildArgumentsInfo.abldFreezeArgs.trim().length() > 0) {
-			rootStorage.setAttribute(BuildArgumentsInfo.ABLDFREEZEARGSSTORAGE, buildArgumentsInfo.abldFreezeArgs);
-		}
-	}
 	
 	public ICarbideProjectInfo getCarbideProject() {
 		// we need to get the project info from the build manager to ensure we
@@ -368,26 +270,6 @@
 		return config;
 	}
 
-	public IBuildArgumentsInfo getBuildArgumentsInfo() {
-		return (IBuildArgumentsInfo)buildArgumentsInfo;
-	}
-	
-	public BuildArgumentsInfo getBuildArgumentsInfoCopy() {
-		return new BuildArgumentsInfo(buildArgumentsInfo);
-	}
-	
-	public void setBuildArgumentsInfo(BuildArgumentsInfo buildArgumentsInfo) {
-		this.buildArgumentsInfo = buildArgumentsInfo;
-	}
-
-	public ISBSv2BuildConfigInfo getSBSv2BuildConfigInfo(){
-		return sbsv2BuilderInfo;
-	}
-
-	public ISBSv2BuildConfigInfo getSBSv2ConfigInfo() {
-		return sbsv2BuilderInfo;
-	}
-
 	public IPath getTargetOutputDirectory() {
 		if (context instanceof ISBSv2BuildContext){
 			if (((ISBSv2BuildContext) context).getConfigQueryData() != null){