Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Discrete Custom Build Step UI patch

Here are the patches which complete the Discrete Custom Build Step
support,
primarily completing the UI support.

In addition, they provide support to filter configurations by platform
and resolve
a problem with the restoration of defaults in the context of the Build
Settings UI.

Bob Monteleone
Intel 

Index: src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/sr
c/org/eclipse/cdt/managedbuilder/core/IConfiguration.java,v
retrieving revision 1.14
diff -u -r1.14 IConfiguration.java
--- src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java	2 May
2005 19:44:29 -0000	1.14
+++ src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java	9 May
2005 21:12:28 -0000
@@ -29,10 +29,10 @@
 public interface IConfiguration extends IBuildObject {
 	public static final String ARTIFACT_NAME = "artifactName";
//$NON-NLS-1$
 	public static final String CLEAN_COMMAND = "cleanCommand";
//$NON-NLS-1$
-       public static final String PREBUILD_STEP = "prebuildStep";
//$NON-NLS-1$ 
-       public static final String POSTBUILD_STEP = "postbuildStep";
//$NON-NLS-1$ 
-       public static final String PREANNOUNCEBUILD_STEP =
"preannouncebuildStep";              //$NON-NLS-1$ 
-       public static final String POSTANNOUNCEBUILD_STEP =
"postannouncebuildStep";    //$NON-NLS-1$ 
+    public static final String PREBUILD_STEP = "prebuildStep";
//$NON-NLS-1$ 
+    public static final String POSTBUILD_STEP = "postbuildStep";
//$NON-NLS-1$ 
+    public static final String PREANNOUNCEBUILD_STEP =
"preannouncebuildStep";      //$NON-NLS-1$ 
+    public static final String POSTANNOUNCEBUILD_STEP =
"postannouncebuildStep";    //$NON-NLS-1$ 
 	// Schema element names
 	public static final String CONFIGURATION_ELEMENT_NAME =
"configuration";	//$NON-NLS-1$
 	public static final String ERROR_PARSERS = "errorParsers";
//$NON-NLS-1$
@@ -106,28 +106,28 @@
 	public String getBuildCommand();
 	
 	/**
-     * Returns the prebuild step from this configuration's builder 
+     * Returns the prebuild step command
      * 
      * @return String 
      */ 
     public String getPrebuildStep(); 
        
     /** 
-     * Returns the postbuild step from this configuration's builder 
+     * Returns the postbuild step command 
      * 
      * @return String 
      */ 
     public String getPostbuildStep(); 
  
     /** 
-     * Returns the display string associated with the prebuild step
from this configuration's builder 
+     * Returns the display string associated with the prebuild step 
      * 
      * @return String 
      */ 
     public String getPreannouncebuildStep(); 
        
     /** 
-     * Returns the display string associated with the postbuild step
from this configuration's builder 
+     * Returns the display string associated with the postbuild step 
      * 
      * @return String 
      */ 
Index:
src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/sr
c/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java,v
retrieving revision 1.26
diff -u -r1.26 Configuration.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
9 May 2005 03:36:16 -0000	1.26
+++ src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
9 May 2005 21:12:29 -0000
@@ -271,7 +271,7 @@
 			preannouncebuildStep = new
String(cloneConfig.preannouncebuildStep);
 		}
 		if (cloneConfig.postannouncebuildStep != null) {
-			postannouncebuildStep = new String(
cloneConfig.postannouncebuildStep);
+			postannouncebuildStep = new
String(cloneConfig.postannouncebuildStep);
 		} 
 		
 		// Clone the configuration's children
@@ -1140,9 +1140,9 @@
     public void setPrebuildStep(String step) { 
         if (step == null && prebuildStep == null) return; 
         if (prebuildStep == null || step == null ||
!prebuildStep.equals(step)) { 
-                prebuildStep = step; 
-                setRebuildState(true); 
-                isDirty = true; 
+            prebuildStep = step; 
+            setRebuildState(true); 
+            isDirty = true; 
         } 
     } 
 	
@@ -1153,9 +1153,9 @@
     public void setPostbuildStep(String step) { 
         if (step == null && postbuildStep == null) return; 
         if (postbuildStep == null || step == null ||
!postbuildStep.equals(step)) { 
-                postbuildStep = step; 
-                setRebuildState(true); 
-                isDirty = true; 
+            postbuildStep = step; 
+            setRebuildState(true); 
+            isDirty = true; 
         }       
     } 
 	
@@ -1165,9 +1165,9 @@
     public void setPreannouncebuildStep(String announceStep) { 
         if (announceStep == null && preannouncebuildStep == null)
return; 
         if (preannouncebuildStep == null || announceStep == null ||
!preannouncebuildStep.equals(announceStep)) {
-                preannouncebuildStep = announceStep; 
-                setRebuildState(true); 
-                isDirty = true; 
+            preannouncebuildStep = announceStep; 
+            setRebuildState(true); 
+            isDirty = true; 
         } 
     } 
  
@@ -1177,9 +1177,9 @@
     public void setPostannouncebuildStep(String announceStep) { 
         if (announceStep == null && postannouncebuildStep == null)
return; 
         if (postannouncebuildStep == null || announceStep == null ||
!postannouncebuildStep.equals(announceStep)) {
-                postannouncebuildStep = announceStep; 
-                setRebuildState(true); 
-                isDirty = true; 
+            postannouncebuildStep = announceStep; 
+            setRebuildState(true); 
+            isDirty = true; 
         } 
     } 
 	
Index:
src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilde
r.java
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/sr
c/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.
java,v
retrieving revision 1.38
diff -u -r1.38 GeneratedMakefileBuilder.java
---
src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilde
r.java	2 May 2005 19:44:28 -0000	1.38
+++
src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilde
r.java	9 May 2005 21:12:30 -0000
@@ -655,10 +655,8 @@
 						boolean quit = false;
 						premakeArgs.add("-q");
//$NON-NLS-1$ 
 
premakeArgs.add("main-build"); //$NON-NLS-1$ 
-						premakeTargets =
(String[]) premakeArgs
-
.toArray(new String[premakeArgs.size()]);
-						proc =
launcher.execute(makeCommand, premakeTargets,
-								env,
workingDirectory);
+						premakeTargets =
(String[]) premakeArgs.toArray(new String[premakeArgs.size()]);
+						proc =
launcher.execute(makeCommand, premakeTargets, env, workingDirectory);
 						if (proc != null) {
 							try {
 								// Close
the input of the process since we will never write to it
@@ -674,8 +672,7 @@
 							errMsg =
launcher.getErrorMessage();
 						}
 
-						if ((errMsg != null &&
errMsg.length() > 0)
-								|| proc
== null) {
+						if ((errMsg != null &&
errMsg.length() > 0) || proc == null) {
 							// Can't tell if
the build is needed, so assume it is, and let any errors be triggered
 							// when the
"real" build is invoked below 
 
makeArgs.add("pre-build"); //$NON-NLS-1$ 
@@ -687,14 +684,13 @@
 
isuptodate = true;
 								//
Report that the build was up to date, and thus nothing needs to be built
 								String
uptodateMsg = ManagedMakeMessages
-
.getFormattedString(NOTHING_BUILT,
-
currentProject.getName());
+
.getFormattedString(NOTHING_BUILT, currentProject.getName());
+								buf =
new StringBuffer();
+
buf.append(System.getProperty("line.separator", "\n"));
//$NON-NLS-1$//$NON-NLS-2$
 
buf.append(uptodateMsg);
-
buf.append(System.getProperty(
-
"line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+
buf.append(System.getProperty("line.separator", "\n"));
//$NON-NLS-1$//$NON-NLS-2$
 								// Write
message on the console 
-
consoleOutStream.write(buf.toString()
-
.getBytes());
+
consoleOutStream.write(buf.toString().getBytes());
 
consoleOutStream.flush();
 
consoleOutStream.close();
 
stdout.close();
@@ -725,13 +721,12 @@
 
makeArgs.addAll(Arrays.asList(getMakeTargets(buildType)));
 				}
 
-				makeTargets = (String[])
makeArgs.toArray(new String[makeArgs
-						.size()]);
+				makeTargets = (String[])
makeArgs.toArray(new String[makeArgs.size()]);
 
 				// Launch make - main invocation 
 				if (!isuptodate) {
 					proc =
launcher.execute(makeCommand, makeTargets, env,
-
workingDirectory);
+
workingDirectory);
 					if (proc != null) {
 						try {
 							// Close the
input of the process since we will never write to it
Index:
src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.propert
ies
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/sr
c/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.propertie
s,v
retrieving revision 1.25
diff -u -r1.25 PluginResources.properties
---
src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.propert
ies	28 Apr 2005 16:54:40 -0000	1.25
+++
src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.propert
ies	9 May 2005 21:12:30 -0000
@@ -63,6 +63,7 @@
 MakefileGenerator.comment.build.rule = Each subdirectory must supply
rules for building sources it contributes
 MakefileGenerator.comment.build.toprules = Tool invocations
 MakefileGenerator.comment.build.alltarget = All Target
+MakefileGenerator.comment.build.mainbuildtarget = Main-build Target
 MakefileGenerator.comment.build.toptargets = Other Targets
 MakefileGenerator.comment.module.make.includes = Include the makefiles
for each source subdirectory
 MakefileGenerator.comment.module.dep.includes = Include
automatically-generated dependency list:
Index:
src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/sr
c/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java,v
retrieving revision 1.34
diff -u -r1.34 GnuMakefileGenerator.java
---
src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
9 May 2005 03:36:16 -0000	1.34
+++
src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
9 May 2005 21:12:31 -0000
@@ -232,6 +232,7 @@
 	private static final String MOD_RULES = COMMENT + ".build.rule";
//$NON-NLS-1$	
 	private static final String BUILD_TOP = COMMENT +
".build.toprules";	//$NON-NLS-1$	
 	private static final String ALL_TARGET = COMMENT +
".build.alltarget";	//$NON-NLS-1$	
+	private static final String MAINBUILD_TARGET = COMMENT +
".build.mainbuildtarget";	//$NON-NLS-1$
 	private static final String BUILD_TARGETS = COMMENT +
".build.toptargets";	//$NON-NLS-1$	
 	private static final String SRC_LISTS = COMMENT +
".source.list";	//$NON-NLS-1$
 	
@@ -1119,6 +1120,9 @@
 		String defaultTarget = "all:"; //$NON-NLS-1$
 		if (prebuildStep.length() > 0) {
 
+			// Add the comment for the "All" target
+			buffer.append(COMMENT_SYMBOL + WHITESPACE +
ManagedMakeMessages.getResourceString(ALL_TARGET) + NEWLINE);
+
 			buffer.append(defaultTarget + WHITESPACE);
 			buffer.append(PREBUILD + WHITESPACE);
 
@@ -1130,13 +1134,16 @@
 			// needed below
 			defaultTarget = defaultTarget.concat(COLON);
 			buffer.append(NEWLINE + NEWLINE);
+
+			// Add the comment for the "main-build" target
+			buffer.append(COMMENT_SYMBOL + WHITESPACE +
ManagedMakeMessages.getResourceString(MAINBUILD_TARGET) + NEWLINE);

 		}
+		else
+			// Add the comment for the "All" target
+			buffer.append(COMMENT_SYMBOL + WHITESPACE +
ManagedMakeMessages.getResourceString(ALL_TARGET) + NEWLINE);
 
 		// Write out the all target first in case someone just
runs make
 		// all: <target_name> or mainbuild: <target_name>
-
-		// Add the comment
-		buffer.append(COMMENT_SYMBOL + WHITESPACE +
ManagedMakeMessages.getResourceString(ALL_TARGET) + NEWLINE);
                
 		String outputPrefix = EMPTY_STRING;
 		if (targetTool != null) { 		
@@ -1279,20 +1286,13 @@
 		//  Get the target tool and generate the rule
 		if (targetTool != null) { 		
 			if (addRuleForTool(targetTool, buffer, true,
buildTargetName, buildTargetExt, 
-					outputVarsAdditionsList,
managedProjectOutputs)) {
+					outputVarsAdditionsList,
managedProjectOutputs, postbuildStep)) {
 				//  Mark the target tool as processed
 				for (int i=0; i<buildTools.length; i++)
{
 					if (targetTool == buildTools[i])
{
 						buildToolsUsed[i] =
true;
 					}
 				}
-			    // If there is a post build step, then add a
recursive invocation of MAKE to invoke it after the main build
-			    // Note that $(MAKE) will instantiate in the
recusive invocation to the make command that was used to invoke
-			    // the makefile originally 
-			    if (postbuildStep) { 
-			        buffer.append(TAB + AT + ECHO +
WHITESPACE + SINGLE_QUOTE + WHITESPACE + SINGLE_QUOTE + NEWLINE);
-			        buffer.append(TAB + MAKE + WHITESPACE +
NO_PRINT_DIR + WHITESPACE + POSTBUILD + NEWLINE);       
-			    } 
 			}
 		} else {
 			buffer.append(TAB + AT + ECHO + WHITESPACE +
SINGLE_QUOTE + MESSAGE_NO_TARGET_TOOL + WHITESPACE + OUT_MACRO +
SINGLE_QUOTE + NEWLINE);
@@ -1306,7 +1306,7 @@
 			IInputType type = tool.getPrimaryInputType();
 			if (type != null && type.getMultipleOfType()) {
 				if (!buildToolsUsed[i]) {
-					addRuleForTool(tool, buffer,
false, null, null, outputVarsAdditionsList, null);
+					addRuleForTool(tool, buffer,
false, null, null, outputVarsAdditionsList, null, false);
 					//  Mark the target tool as
processed
 					buildToolsUsed[i] = true;
 					// Look for tools that consume
the output
@@ -1352,9 +1352,10 @@
 	 * @param targetName  If this is the "targetTool", the target
file extension, else <code>null</code>
 	 * @param outputVarsAdditionsList  list to add needed build
output variables to
 	 * @param managedProjectOutputs  Other projects in the workspace
that this project depends upon
+	 * @param bPostBuildStep  Emit post-build step invocation
 	 */
 	protected boolean addRuleForTool(ITool tool, StringBuffer
buffer, boolean bTargetTool, String targetName, String targetExt, 
-			List outputVarsAdditionsList, Vector
managedProjectOutputs) {
+			List outputVarsAdditionsList, Vector
managedProjectOutputs, boolean bEmitPostBuildStepCall) {
 		
 		//  Get the tool's inputs and outputs
 		Vector inputs = new Vector();
@@ -1454,7 +1455,18 @@
 		} else {
 			buffer.append(TAB + AT + ECHO + WHITESPACE +
SINGLE_QUOTE + MESSAGE_FINISH_FILE + WHITESPACE + OUT_MACRO +
SINGLE_QUOTE + NEWLINE);
 		}
-		buffer.append(TAB + AT + ECHO + WHITESPACE +
SINGLE_QUOTE + WHITESPACE + SINGLE_QUOTE + NEWLINE + NEWLINE);
+		buffer.append(TAB + AT + ECHO + WHITESPACE +
SINGLE_QUOTE + WHITESPACE + SINGLE_QUOTE + NEWLINE);

+		
+		// If there is a post build step, then add a recursive
invocation of MAKE to invoke it after the main build
+	    // Note that $(MAKE) will instantiate in the recusive
invocation to the make command that was used to invoke
+	    // the makefile originally 
+	    if (bEmitPostBuildStepCall) {
+	        buffer.append(TAB + MAKE + WHITESPACE + NO_PRINT_DIR +
WHITESPACE + POSTBUILD + NEWLINE + NEWLINE);       
+	    }
+	    else {
+			// Just emit a blank line
+			buffer.append(NEWLINE);
+	    }
 		
 		// If we have secondary outputs, output dependency rules
without commands
 		if (enumeratedSecondaryOutputs.size() > 0) {
@@ -1465,7 +1477,6 @@
 			}
 			buffer.append(NEWLINE);
 		}
-				
 		return true;
 	}
 
@@ -1491,7 +1502,7 @@
 							    (outVariable
!= null && inVariable != null &&
 
outVariable.equals(inVariable))) {
 								if
(addRuleForTool(buildTools[k], buffer, false, null, null, 
-
outputVarsAdditionsList, null)) {
+
outputVarsAdditionsList, null, false)) {
 
buildToolsUsed[k] = true;
 
// Look for tools that consume the output
 
generateRulesForConsumers(buildTools[k], outputVarsAdditionsList,
buffer);
Index:
src/org/eclipse/cdt/managedbuilder/internal/ui/BuildSettingsBlock.java
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui/src/
org/eclipse/cdt/managedbuilder/internal/ui/BuildSettingsBlock.java,v
retrieving revision 1.1
diff -u -r1.1 BuildSettingsBlock.java
---
src/org/eclipse/cdt/managedbuilder/internal/ui/BuildSettingsBlock.java
28 Oct 2004 17:16:33 -0000	1.1
+++
src/org/eclipse/cdt/managedbuilder/internal/ui/BuildSettingsBlock.java
9 May 2005 21:12:06 -0000
@@ -23,6 +23,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.accessibility.AccessibleAdapter;
@@ -30,6 +31,7 @@
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.events.DisposeEvent;
 import org.eclipse.swt.events.DisposeListener;
@@ -250,6 +252,16 @@
 	 * @see
org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults()
 	 */
 	public void performDefaults() {
+		
+		// Display a "Confirm" dialog box, since:
+		//   1.  The defaults are immediately applied
+		//   2.  The action cannot be undone
+		Shell shell =
ManagedBuilderUIPlugin.getDefault().getShell();
+		boolean shouldDefault = MessageDialog.openConfirm(shell,
+
ManagedBuilderUIMessages.getResourceString("BuildSettingsBlock.defaults.
title"), //$NON-NLS-1$
+
ManagedBuilderUIMessages.getResourceString("BuildSettingsBlock.defaults.
message")); //$NON-NLS-1$
+		if (!shouldDefault) return;
+		
 		IConfiguration config =
parent.getSelectedConfiguration();
 
config.setArtifactName(config.getManagedProject().getDefaultArtifactName
());
 		config.setArtifactExtension(null);
@@ -257,9 +269,15 @@
 		if (!builder.isExtensionElement()) {
 			config.getToolChain().removeLocalBuilder();
 		}
+		
+		// Save the information that was reset
+
ManagedBuildManager.setDefaultConfiguration(parent.getProject(),
parent.getSelectedConfiguration());
+		ManagedBuildManager.saveBuildInfo(parent.getProject(),
false);
+		
 		setValues();
+		
 		makeCommandDefault.setSelection(true);
-		makeCommandEntry.setEditable(false);
+		makeCommandEntry.setEditable(false);	
 		
 		setDirty(false);
 	}
Index:
src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuildOptionBlock.j
ava
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui/src/
org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuildOptionBlock.java,
v
retrieving revision 1.2
diff -u -r1.2 ManagedBuildOptionBlock.java
---
src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuildOptionBlock.j
ava	28 Apr 2005 16:55:15 -0000	1.2
+++
src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuildOptionBlock.j
ava	9 May 2005 21:12:06 -0000
@@ -32,6 +32,7 @@
 
 	private ToolsSettingsBlock toolsSettingsBlock;
 	private BuildSettingsBlock buildSettingsBlock;
+	private BuildStepSettingsBlock buildStepSettingsBlock;
 	private ErrorParserBlock errParserBlock;
 	private BinaryParserBlock binaryParserBlock;
 	private EnvironmentSetBlock environmentBlock;
@@ -72,6 +73,7 @@
 		if (element instanceof IProject) {
 			addTab(toolsSettingsBlock = new
ToolsSettingsBlock((BuildPropertyPage) fParent, element));
 			addTab(buildSettingsBlock = new
BuildSettingsBlock((BuildPropertyPage) fParent));
+			addTab(buildStepSettingsBlock = new
BuildStepSettingsBlock((BuildPropertyPage) fParent));
 			addTab(errParserBlock = new ErrorParserBlock());
 			addTab(binaryParserBlock = new
BinaryParserBlock());
 			addTab(environmentBlock = new
EnvironmentSetBlock((BuildPropertyPage) fParent));
@@ -89,6 +91,10 @@
 	public BuildSettingsBlock getBuildSettingsBlock() {
 		return buildSettingsBlock;
 	}
+	
+	public BuildStepSettingsBlock getBuildStepSettingsBlock() {
+		return buildStepSettingsBlock;
+	}
 
 	public BinaryParserBlock getBinaryParserBlock() {
 		return binaryParserBlock;
@@ -125,6 +131,9 @@
 		if (getBuildSettingsBlock()!= null) {
 			getBuildSettingsBlock().initializeValues();
 		}
+		if (getBuildStepSettingsBlock()!= null) {
+			getBuildStepSettingsBlock().initializeValues();
+		}		
 		if (getErrorParserBlock()!= null) {
 			// TODO
 			//getErrorParserBlock().initializeValues();
@@ -145,6 +154,9 @@
 			if (getBuildSettingsBlock() != null) {
 				getBuildSettingsBlock().updateValues();
 			}
+			if (getBuildStepSettingsBlock() != null) {
+
getBuildStepSettingsBlock().updateValues();
+			}			
 			if (getErrorParserBlock() != null) {
 				getErrorParserBlock().updateValues();
 			}
@@ -174,6 +186,9 @@
 			if (getBuildSettingsBlock() != null) {
 				getBuildSettingsBlock().setValues();
 			}
+			if (getBuildStepSettingsBlock() != null) {
+				getBuildStepSettingsBlock().setValues();
+			}
 			if (getErrorParserBlock() != null) {
 				// TODO
 				//getErrorParserBlock().setValues();
@@ -204,6 +219,9 @@
 			if (getBuildSettingsBlock() != null) {
 
getBuildSettingsBlock().removeValues(id);
 			}
+			if (getBuildStepSettingsBlock() != null) {
+
getBuildStepSettingsBlock().removeValues(id);
+			}			
 			if (getErrorParserBlock() != null) {
 				// TODO
 
//getErrorParserBlock().removeValues(id);
@@ -233,6 +251,9 @@
 			if (getCurrentPage() instanceof
BuildSettingsBlock) {
 				return
buildSettingsBlock.getPreferenceStore();
 			}
+			if (getCurrentPage() instanceof
BuildStepSettingsBlock) {
+				return
buildStepSettingsBlock.getPreferenceStore();
+			}			
 			if (getCurrentPage() instanceof
ErrorParserBlock) {
 				return
errParserBlock.getPreferenceStore();
 			}
@@ -292,6 +313,8 @@
 			    ((BuildSettingsBlock)tab).setDirty(b);
 			} else if (tab instanceof ToolsSettingsBlock) {
 
((ToolsSettingsBlock)tab).setDirty(b);
+			} else if (tab instanceof
BuildStepSettingsBlock) {
+			    ((BuildStepSettingsBlock)tab).setDirty(b);

 			} else if (tab instanceof ErrorParserBlock) {
 			    ((ErrorParserBlock)tab).setDirty(b);
 			} else if (tab instanceof BinaryParserBlock) {
@@ -314,6 +337,8 @@
 			    if (((BuildSettingsBlock)tab).isDirty())
return true;
 			} else if (tab instanceof ToolsSettingsBlock) {
 			    if (((ToolsSettingsBlock)tab).isDirty())
return true;
+			} else if (tab instanceof
BuildStepSettingsBlock) {
+			    if (((BuildStepSettingsBlock)tab).isDirty())
return true;				
 			} else if (tab instanceof ErrorParserBlock) {
 			    if (((ErrorParserBlock)tab).isDirty())
return true;
 			} else if (tab instanceof BinaryParserBlock) {
Index:
src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.propertie
s
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui/src/
org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties,v
retrieving revision 1.30
diff -u -r1.30 PluginResources.properties
---
src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.propertie
s	2 May 2005 19:44:51 -0000	1.30
+++
src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.propertie
s	9 May 2005 21:12:06 -0000
@@ -32,6 +32,7 @@
 MngMakeProjectWizard.config.title=Select a type of project
 MngMakeProjectWizard.config.desc=Select the platform and configurations
you wish to deploy on
 PlatformBlock.tip.platform=Select the type of project for the build
goal
+PlatformBlock.tip.forcedconfigs=There are no buildable configurations
on this platform for this project type.\n By default, all configurations
selected.
 PlatformBlock.label.platform=Project Type:
 PlatformBlock.label.configs=Configurations:
 PlatformBlock.label.showall=Show All Project Types
@@ -86,6 +87,19 @@
 BuildSettingsBlock.label.output.group=Build output
 BuildSettingsBlock.label.output.name=Artifact name:
 BuildSettingsBlock.label.output.extension=Artifact extension:
+BuildSettingsBlock.defaults.title=Reset Build Settings
+BuildSettingsBlock.defaults.message=This action will reset the build
settings to their default settings.\n\nDo you want to proceed?
+
+# ----------- Build Steps Block -----------
+BuildStepSettingsBlock.label.Settings=Build Steps
+BuildStepSettingsBlock.label.prebuildstep.group=Pre-build step:
+BuildStepSettingsBlock.label.prebuildstep.cmd=Command:
+BuildStepSettingsBlock.label.prebuildstep.desc=Description:
+BuildStepSettingsBlock.label.postbuildstep.group=Post-build step:
+BuildStepSettingsBlock.label.postbuildstep.cmd=Command:
+BuildStepSettingsBlock.label.postbuildstep.desc=Description:
+BuildStepsSettingsBlock.defaults.title=Reset Build Steps
+BuildStepsSettingsBlock.defaults.message=This action will reset the
pre-build and post-build steps to their default settings.\n\nDo you want
to proceed?
 
 # ----------- Environment Set Block -----------
 EnvironmentSetBlock.label.environment=Environment
Index:
src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui/src/
org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java,v
retrieving revision 1.11
diff -u -r1.11 CProjectPlatformPage.java
---
src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
18 Apr 2005 04:15:07 -0000	1.11
+++
src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
9 May 2005 21:12:06 -0000
@@ -62,6 +62,8 @@
 	private static final String SHOWALL_CONFIG_LABEL = LABEL +
".showall.config"; //$NON-NLS-1$
 	private static final String TARGET_LABEL = LABEL + ".platform";
//$NON-NLS-1$
 	private static final String TARGET_TIP = TIP + ".platform";
//$NON-NLS-1$
+	private static final String FORCEDCONFIG_TIP = TIP +
".forcedconfigs"; //$NON-NLS-1$
+	
 
 	protected NewManagedProjectWizard parentWizard;
 	protected Combo platformSelection;
@@ -69,6 +71,7 @@
 	protected IProjectType selectedProjectType;
 	protected Button showAllProjTypes;
 	protected Button showAllConfigs;
+	protected boolean showAllConfigsForced;
 	protected CheckboxTableViewer tableViewer;
 	protected String[] projectTypeNames;
 	protected ArrayList projectTypes;
@@ -85,6 +88,7 @@
 		selectedProjectType = null;
 		selectedConfigurations = new ArrayList(0);
 		this.parentWizard = parentWizard;
+		showAllConfigsForced = false;
 	}
 
 	/**
@@ -187,7 +191,7 @@
 
showAllConfigs.setText(ManagedBuilderUIMessages.getResourceString(SHOWAL
L_CONFIG_LABEL));
 		showAllConfigs.addListener(SWT.Selection, new Listener()
{
 			public void handleEvent(Event e) {
-				populateConfigurations();
+				populateConfigurations(true);
 			}
 		});
 		showAllConfigs.addDisposeListener(new DisposeListener()
{
@@ -279,30 +283,73 @@
 
parentWizard.updateProjectTypeProperties();
 			}
 		}
-		populateConfigurations();
+		populateConfigurations(false);
 		setPageComplete(validatePage());
 	}
 
 	/**
 	 * Populate the table viewer with either all known
configurations
 	 * or only with the supported configurations depending on
whether a user
-	 * has chosen to diaplay unsupported configurations or not 
+	 * has chosen to display unsupported configurations or not 
 	 * By default, only supported configurations are selected.
 	 */
-	private void populateConfigurations() {
-		if(selectedProjectType == null)
+	private void populateConfigurations(boolean showallconfigsevent)
{
+		if (selectedProjectType == null)
 			return;
 		boolean showAll = showAllConfigs != null ?
showAllConfigs.getSelection() : false;
 		IConfiguration selected[] = null;
 		
-		if(showAll){
+		if (showAll) {
 			configurations =
selectedProjectType.getConfigurations();
 			selected =
filterSupportedConfigurations(configurations);
 		}
-		else{
+		else {
 			configurations =
filterSupportedConfigurations(selectedProjectType.getConfigurations());
 			selected = configurations;
 		}
+	
+		// Check for buildable configs on this platform
+		if (selected.length == 0) {
+			// No buildable configs on this platform
+			if (showallconfigsevent) {
+				// "Show All Configurations" button
pressed by user
+				if (showAll) {		
+					// "Show All Configurations"
check box "checked" by user
+					// For a project with no
buildable configs, all available 
+					// configs should be displayed
and checked
+					configurations =
selectedProjectType.getConfigurations();
+					selected = configurations;
+				}
+				if (showAllConfigsForced) {
+				    // The previous setting of this
check box was done automatically when a project type
+				    // with no buildable configs was
encountered; undo this state now and honor the 
+					// user's button click
+					setMessage(null, NONE);
+					showAllConfigsForced = false;
+				}
+			}
+			else {
+				configurations =
selectedProjectType.getConfigurations();
+				selected = configurations;
+				if (!showAll) {			    
+				    showAllConfigsForced = true;
+
showAllConfigs.setSelection(true);

+				}
+			}
+			// Indicate that there are no buildable
configurations on this platform for this project
+			// type and that all configurations will be
selected
+
setMessage(ManagedBuilderUIMessages.getResourceString(FORCEDCONFIG_TIP),
WARNING);
+		}
+		else { 
+			setMessage(null, NONE);
+			if (showAllConfigsForced) {
+			    showAllConfigsForced = false;
+			    showAllConfigs.setSelection(false);
+				// Redo filtering in light of reset of
"show all configs" to false
+				configurations =
filterSupportedConfigurations(selectedProjectType.getConfigurations());
+				selected = configurations;
+			}
+		}
 		
 		tableViewer.setInput(configurations);
 		tableViewer.setCheckedElements(selected);
@@ -310,14 +357,28 @@
 	}
 
 	/**
-	 * Returns the array of supported configurations found in the
configuurations
-	 * passes to this method
+	 * Returns the array of supported configurations found in the
configurations
+	 * passed to this method
 	 */
 	IConfiguration[] filterSupportedConfigurations(IConfiguration
cfgs[]){
 		ArrayList supported = new ArrayList();
-		for(int i = 0; i < cfgs.length; i++){
-			if(cfgs[i].isSupported())
-					supported.add(cfgs[i]);
+		String os = Platform.getOS();
+		String arch = Platform.getOSArch();
+
+		for (int i = 0; i < cfgs.length; i++) {
+			// First, filter on supported state
+			if (cfgs[i].isSupported()) {

+				// Now, apply the OS and ARCH filters to
determine if the configuration should be shown
+				// Determine if the configuration's
tool-chain supports this OS & Architecture.
+				IToolChain tc = cfgs[i].getToolChain();
+				List osList =
Arrays.asList(tc.getOSList());
+				if (osList.contains("all") ||
osList.contains(os)) {	//$NON-NLS-1$
+					List archList =
Arrays.asList(tc.getArchList());
+					if (archList.contains("all") ||
archList.contains(arch)) { //$NON-NLS-1$
+						supported.add(cfgs[i]);

+					}
+				}		
+			}
 		}
 		return (IConfiguration[])supported.toArray(new
IConfiguration[supported.size()]);
 	}
Index:
src/org/eclipse/cdt/managedbuilder/internal/ui/BuildStepSettingsBlock.ja
va
===================================================================
RCS file:
src/org/eclipse/cdt/managedbuilder/internal/ui/BuildStepSettingsBlock.ja
va
diff -N
src/org/eclipse/cdt/managedbuilder/internal/ui/BuildStepSettingsBlock.ja
va
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++
src/org/eclipse/cdt/managedbuilder/internal/ui/BuildStepSettingsBlock.ja
va	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,337 @@
+/**********************************************************************
*********
+ * Copyright (c) 2005 Intel Corporation and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ * 
+ * Contributors:
+ *     Intel Corporation - Initial API and implementation
+
************************************************************************
*******/
+package org.eclipse.cdt.managedbuilder.internal.ui;
+
+import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.ui.properties.BuildPropertyPage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+public class BuildStepSettingsBlock extends AbstractCOptionPage {
+
+	/*
+	 * String constants
+	 */
+	private static final String PREFIX = "BuildStepSettingsBlock";
//$NON-NLS-1$
+	private static final String LABEL = PREFIX + ".label";
//$NON-NLS-1$
+	private static final String SETTINGS_LABEL = LABEL +
".Settings";	//$NON-NLS-1$
+	private static final String PREBUILD_GROUP = LABEL +
".prebuildstep.group";	//$NON-NLS-1$	
+	private static final String PREBUILD_CMD = LABEL +
".prebuildstep.cmd";	//$NON-NLS-1$
+	private static final String PREBUILD_DESC = LABEL +
".prebuildstep.desc";	//$NON-NLS-1$
+	private static final String POSTBUILD_GROUP = LABEL +
".postbuildstep.group";	//$NON-NLS-1$
+	private static final String POSTBUILD_CMD = LABEL +
".postbuildstep.cmd";	//$NON-NLS-1$
+	private static final String POSTBUILD_DESC = LABEL +
".postbuildstep.desc";	//$NON-NLS-1$
+	private static final String EMPTY_STRING = new String();
+	
+	/*
+	 * Dialog widgets
+	 */
+	protected Text preBuildCmd;
+	protected Text preBuildAnnc;
+	protected Text postBuildCmd;
+	protected Text postBuildAnnc;
+
+	/*
+	 * Bookeeping variables
+	 */
+	private BuildPropertyPage parent;
+	private String preBuildCommand;
+	private String preBuildAnnounce;
+	private String postBuildCommand;
+	private String postBuildAnnounce;
+	
+	// Has the page been changed?
+	private boolean dirty = false;
+
+	private ModifyListener widgetModified = new ModifyListener() {
+	    public void modifyText(ModifyEvent e) {
+	        setDirty(true);
+	    }
+	};
+	
+	/*
+	 *  Constructor
+	 */
+	public BuildStepSettingsBlock(BuildPropertyPage parent)
+	{
+
super(ManagedBuilderUIMessages.getResourceString(SETTINGS_LABEL));
+		super.setContainer(parent);
+		this.parent = parent;
+	}
+
+	public void createControl(Composite parent)  {
+		Composite comp = new Composite(parent, SWT.NULL);
+		comp.setFont(parent.getFont());
+		comp.setLayout(new GridLayout(1, true));
+		comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+		setControl(comp);
+		
+		// Create a group for the prebuild step
+		createPreBuildStepGroup(comp);
+	
+		// Create a group for the postbuild step
+		createPostBuildStepGroup(comp);
+	}
+
+	/* (non-Javadoc)
+	 * Creates the group that contains the pre-build step controls.
+	 */
+	private void createPreBuildStepGroup(Composite parent) {
+		final Group preBuildStepGroup = new Group(parent,
SWT.NONE);
+		preBuildStepGroup.setFont(parent.getFont());
+
preBuildStepGroup.setText(ManagedBuilderUIMessages.getResourceString(PRE
BUILD_GROUP));
+		preBuildStepGroup.setLayout(new GridLayout(1, true));
+		preBuildStepGroup.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL)); 
+
+		// Pre-build command label
+		final Label cmdLabel = new Label(preBuildStepGroup,
SWT.LEFT);
+		cmdLabel.setFont(preBuildStepGroup.getFont());
+
cmdLabel.setText(ManagedBuilderUIMessages.getResourceString(PREBUILD_CMD
));
+		cmdLabel.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL));
+		
+		// Text widget for pre-build command
+		preBuildCmd = new Text(preBuildStepGroup, SWT.SINGLE |
SWT.BORDER);
+		preBuildCmd.setFont(preBuildStepGroup.getFont());
+		GridData data = new GridData(GridData.FILL_HORIZONTAL);
+		data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
+		preBuildCmd.setLayoutData(data);
+		preBuildCmd.addDisposeListener(new DisposeListener() {
+			public void widgetDisposed(DisposeEvent event) {
+				preBuildCmd = null;
+			}
+		});
+		preBuildCmd.getAccessible().addAccessibleListener(new
AccessibleAdapter(){
+			public void getName(AccessibleEvent e) {
+				e.result =
ManagedBuilderUIMessages.getResourceString(PREBUILD_CMD);
+			}
+		});
+		preBuildCmd.addModifyListener(widgetModified);
+		
+		final Label descLabel = new Label(preBuildStepGroup,
SWT.LEFT);
+		descLabel.setFont(preBuildStepGroup.getFont());
+
descLabel.setText(ManagedBuilderUIMessages.getResourceString(PREBUILD_DE
SC));
+		descLabel.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL));
+		
+		// Text widget for the pre-build description		
+		preBuildAnnc = new Text(preBuildStepGroup, SWT.SINGLE |
SWT.BORDER);
+		preBuildAnnc.setFont(preBuildStepGroup.getFont());
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		data.widthHint = (IDialogConstants.ENTRY_FIELD_WIDTH);
+		preBuildAnnc.setLayoutData(data);
+		preBuildAnnc.addDisposeListener(new DisposeListener() {
+			public void widgetDisposed(DisposeEvent e) {
+				preBuildAnnc = null;
+			}
+		});
+		preBuildAnnc.getAccessible().addAccessibleListener(new
AccessibleAdapter() {
+			public void getName(AccessibleEvent e) {
+				e.result =
ManagedBuilderUIMessages.getResourceString(PREBUILD_DESC);
+			}
+		});
+		preBuildAnnc.addModifyListener(widgetModified);
+	}
+
+	/* (non-Javadoc)
+	 * Creates the group that contains the post-build step controls.
+	 */
+	private void createPostBuildStepGroup(Composite parent) {
+		final Group postBuildStepGroup = new Group(parent,
SWT.NONE);
+		postBuildStepGroup.setFont(parent.getFont());
+
postBuildStepGroup.setText(ManagedBuilderUIMessages.getResourceString(PO
STBUILD_GROUP));
+		postBuildStepGroup.setLayout(new GridLayout(1, true));
+		postBuildStepGroup.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL)); 
+
+		// Post-build command label
+		final Label cmdLabel = new Label(postBuildStepGroup,
SWT.LEFT);
+		cmdLabel.setFont(postBuildStepGroup.getFont());
+
cmdLabel.setText(ManagedBuilderUIMessages.getResourceString(POSTBUILD_CM
D));
+		cmdLabel.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL));
+		
+		// Text widget for the post-build command
+		postBuildCmd = new Text(postBuildStepGroup, SWT.SINGLE |
SWT.BORDER);
+		postBuildCmd.setFont(postBuildStepGroup.getFont());
+		GridData data = new GridData(GridData.FILL_HORIZONTAL);
+		data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
+		postBuildCmd.setLayoutData(data);
+		postBuildCmd.addDisposeListener(new DisposeListener() {
+			public void widgetDisposed(DisposeEvent event) {
+				postBuildCmd = null;
+			}
+		});
+		postBuildCmd.getAccessible().addAccessibleListener(new
AccessibleAdapter(){
+			public void getName(AccessibleEvent e) {
+				e.result =
ManagedBuilderUIMessages.getResourceString(POSTBUILD_CMD);
+			}
+		});
+		postBuildCmd.addModifyListener(widgetModified);
+		
+		// Post-build description label
+		final Label descLabel = new Label(postBuildStepGroup,
SWT.LEFT);
+		descLabel.setFont(postBuildStepGroup.getFont());
+
descLabel.setText(ManagedBuilderUIMessages.getResourceString(POSTBUILD_D
ESC));
+		descLabel.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL));
+		
+		// Text widget for the post-build description		
+		postBuildAnnc = new Text(postBuildStepGroup, SWT.SINGLE
| SWT.BORDER);
+		postBuildAnnc.setFont(postBuildStepGroup.getFont());
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		data.widthHint = (IDialogConstants.ENTRY_FIELD_WIDTH);
+		postBuildAnnc.setLayoutData(data);
+		postBuildAnnc.addDisposeListener(new DisposeListener() {
+			public void widgetDisposed(DisposeEvent e) {
+				postBuildAnnc = null;
+			}
+		});
+		postBuildAnnc.getAccessible().addAccessibleListener(new
AccessibleAdapter() {
+			public void getName(AccessibleEvent e) {
+				e.result =
ManagedBuilderUIMessages.getResourceString(POSTBUILD_DESC);
+			}
+		});
+		postBuildAnnc.addModifyListener(widgetModified);
+	}
+		
+	protected void initializeValues() {
+		setValues();
+	}
+
+	public void updateValues() {
+		setValues();	
+	}
+
+	protected void setValues() {
+		// Fetch values from the current configuration and set
in the UI
+		preBuildCommand =
parent.getSelectedConfiguration().getPrebuildStep();
+		preBuildCmd.setText(preBuildCommand);
+		preBuildAnnounce =
parent.getSelectedConfiguration().getPreannouncebuildStep();
+		preBuildAnnc.setText(preBuildAnnounce);
+		postBuildCommand =
parent.getSelectedConfiguration().getPostbuildStep();
+		postBuildCmd.setText(postBuildCommand);
+		postBuildAnnounce =
parent.getSelectedConfiguration().getPostannouncebuildStep();
+		postBuildAnnc.setText(postBuildAnnounce);

+		setDirty(false);	//Indicate that the UI state is
consistent with internal state
+	}
+
+	public void removeValues(String id) {
+		// Nothing to do...
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see
org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults()
+	 */
+	public void performDefaults() {
+		IConfiguration config =
parent.getSelectedConfiguration();
+		boolean mustSetValue = false;
+		
+		// Display a "Confirm" dialog box, since:
+		//   1.  The defaults are immediately applied
+		//   2.  The action cannot be undone
+		Shell shell =
ManagedBuilderUIPlugin.getDefault().getShell();
+		boolean shouldDefault = MessageDialog.openConfirm(shell,
+
ManagedBuilderUIMessages.getResourceString("BuildStepsSettingsBlock.defa
ults.title"), //$NON-NLS-1$
+
ManagedBuilderUIMessages.getResourceString("BuildStepsSettingsBlock.defa
ults.message")); //$NON-NLS-1$
+		if (!shouldDefault) return;
+
+		// Set the build step entries to null; this will force
the next fetch of the entries to get the
+		// values from the parent of this configuration, which
should be the values from the .xml manifest
+		// file 
+		config.setPrebuildStep(null);
+		config.setPreannouncebuildStep(null);
+		config.setPostbuildStep(null);
+		config.setPostannouncebuildStep(null);
+
+		// Save the information that was reset
+
ManagedBuildManager.setDefaultConfiguration(parent.getProject(),
parent.getSelectedConfiguration());
+		ManagedBuildManager.saveBuildInfo(parent.getProject(),
false);
+		
+		// Fetch and set the default values to be displayed in
the UI
+		setValues();
+			
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see
org.eclipse.cdt.ui.dialogs.ICOptionPage#performApply(IProgressMonitor)
+	 */
+	public void performApply(IProgressMonitor monitor) throws
CoreException {
+		
+		// Fetch the build step values from the UI and store
+		preBuildCommand = preBuildCmd.getText().trim();
+		preBuildAnnounce = preBuildAnnc.getText().trim();
+		postBuildCommand = postBuildCmd.getText().trim();
+		postBuildAnnounce = postBuildAnnc.getText().trim();
+		
+		IConfiguration selectedConfiguration =
parent.getSelectedConfiguration();
+		boolean mustSetValue = false;
+		
+		if
(!selectedConfiguration.getPrebuildStep().equals(preBuildCommand)) {
+			mustSetValue = true;
+		}		
+		else if
(!selectedConfiguration.getPreannouncebuildStep().equals(preBuildAnnounc
e)) {
+			mustSetValue = true;
+		}
+		else if
(!selectedConfiguration.getPostbuildStep().equals(postBuildCommand)) {
+			mustSetValue = true;
+		}		
+		else if
(!selectedConfiguration.getPostannouncebuildStep().equals(postBuildAnnou
nce)) {
+			mustSetValue = true;
+		}
+
+		if (mustSetValue) {			
+			// Set all the build step values in the current
configuration
+
selectedConfiguration.setPrebuildStep(preBuildCommand);
+
selectedConfiguration.setPreannouncebuildStep(preBuildAnnounce);
+
selectedConfiguration.setPostbuildStep(postBuildCommand);
+
selectedConfiguration.setPostannouncebuildStep(postBuildAnnounce);
+		}
+		
+		setDirty(false);	//Indicate that the UI state is
consistent with internal state
+	}
+
+	public IPreferenceStore getPreferenceStore() {
+		return null;
+	}
+
+	/**
+	 * Sets the "dirty" state, which indicates whether or not the
state of the build step UI is consistent
+	 * with its corresponding internal state
+	 */
+	public void setDirty(boolean b) {
+	    dirty = b;
+	}
+
+	/**
+	 * Returns the "dirty" state, which indicates whether or not the
state of the build step UI is consistent
+	 * with its corresponding internal state
+	 */
+	public boolean isDirty() {
+	    return dirty;
+	}
+}



Back to the top