[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] MBS bug fix - [Bug 78047] [MBS] Build all results in a 'clean all'
|
The patch is attached. Note that the patch includes changes
from my patch from this weekend, since this change is in one of the same
files. The only new change in this patch is in the routine ManagedBuildInfo.setRebuildState.
public void setRebuildState(boolean rebuild) {
@@ -822,7 +863,9 @@
rebuildNeeded = rebuild;
// TODO: Is the appropriate?
Should the rebuild state be stored in the project file?
// and in the managed project
- //managedProject.setRebuildNeeded(rebuild);
+ if (getDefaultConfiguration() !=
null) {
+ getDefaultConfiguration().setRebuildState(rebuild);
+ }
}
Regards,
Leo
|
Index: ManagedBuildInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java,v
retrieving revision 1.26
diff -u -r1.26 ManagedBuildInfo.java
--- ManagedBuildInfo.java 4 Nov 2004 16:56:27 -0000 1.26
+++ ManagedBuildInfo.java 8 Nov 2004 18:37:37 -0000
@@ -72,6 +72,7 @@
private IConfiguration defaultConfig;
private String defaultConfigId;
private boolean isDirty;
+ private boolean isValid = false;
private IResource owner;
private boolean rebuildNeeded;
private String version;
@@ -390,31 +391,33 @@
if (location == null) {
location = new Path("."); //$NON-NLS-1$
}
- IPath root = location.addTrailingSeparator().append(config.getName());
- ITool[] tools = config.getFilteredTools();
- for (int i = 0; i < tools.length; i++) {
- ITool tool = tools[i];
- // The tool checks out for this project, get its options
- IOption[] opts = tool.getOptions();
- for (int j = 0; j < opts.length; j++) {
- IOption option = opts[j];
- try {
- if (option.getValueType() == IOption.INCLUDE_PATH) {
- // Get all the user-defined paths from the option as absolute paths
- String[] userPaths = option.getIncludePaths();
- for (int index = 0; index < userPaths.length; ++index) {
- IPath userPath = new Path(userPaths[index]);
- if (userPath.isAbsolute()) {
- paths.add(userPath.toOSString());
- } else {
- IPath absPath = root.addTrailingSeparator().append(userPath);
- paths.add(absPath.makeAbsolute().toOSString());
+ if (config != null) {
+ IPath root = location.addTrailingSeparator().append(config.getName());
+ ITool[] tools = config.getFilteredTools();
+ for (int i = 0; i < tools.length; i++) {
+ ITool tool = tools[i];
+ // The tool checks out for this project, get its options
+ IOption[] opts = tool.getOptions();
+ for (int j = 0; j < opts.length; j++) {
+ IOption option = opts[j];
+ try {
+ if (option.getValueType() == IOption.INCLUDE_PATH) {
+ // Get all the user-defined paths from the option as absolute paths
+ String[] userPaths = option.getIncludePaths();
+ for (int index = 0; index < userPaths.length; ++index) {
+ IPath userPath = new Path(userPaths[index]);
+ if (userPath.isAbsolute()) {
+ paths.add(userPath.toOSString());
+ } else {
+ IPath absPath = root.addTrailingSeparator().append(userPath);
+ paths.add(absPath.makeAbsolute().toOSString());
+ }
}
}
+ } catch (BuildException e) {
+ // TODO: report error
+ continue;
}
- } catch (BuildException e) {
- // TODO: report error
- continue;
}
}
}
@@ -670,9 +673,27 @@
}
// Check if the project is dirty
- return managedProject.isDirty();
+ if (managedProject != null) {
+ return managedProject.isDirty();
+ }
+ return false;
}
-
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isValid()
+ */
+ public boolean isValid() {
+ // If the info has been flagged as valid, answer true
+ return isValid;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isReadOnly()
+ */
+ public boolean isReadOnly(){
+ return isReadOnly;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isHeaderFile(java.lang.String)
*/
@@ -773,8 +794,11 @@
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#setDefaultConfiguration(org.eclipse.cdt.core.build.managed.IConfiguration)
*/
public void setDefaultConfiguration(IConfiguration configuration) {
+ // TODO: This is probably wrong. I'll bet we don't handle the case where all configs are deleted...
+ // But, at least, our UI does not allow the last config to be deleted.
// Sanity
if (configuration == null) return;
+
if (!configuration.equals(getDefaultConfiguration())) {
// Save it
defaultConfig = configuration;
@@ -815,6 +839,23 @@
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setValid(boolean)
+ */
+ public void setValid(boolean isValid) {
+ // Reset the valid status
+ this.isValid = isValid;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setReadOnly(boolean)
+ */
+ public void setReadOnly(boolean readOnly){
+ if(!readOnly && isReadOnly)
+ setDirty(true);
+ isReadOnly = readOnly;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
*/
public void setRebuildState(boolean rebuild) {
@@ -822,7 +863,9 @@
rebuildNeeded = rebuild;
// TODO: Is the appropriate? Should the rebuild state be stored in the project file?
// and in the managed project
- //managedProject.setRebuildNeeded(rebuild);
+ if (getDefaultConfiguration() != null) {
+ getDefaultConfiguration().setRebuildState(rebuild);
+ }
}
/**
@@ -931,15 +974,5 @@
targetList = new ArrayList();
}
return targetList;
- }
-
- public void setReadOnly(boolean readOnly){
- if(!readOnly && isReadOnly)
- setDirty(true);
- isReadOnly = readOnly;
- }
-
- public boolean isReadOnly(){
- return isReadOnly;
}
}