diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests20.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests20.java index 81cf3d296df..d982f432a59 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests20.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests20.java @@ -733,7 +733,8 @@ public class ManagedBuildCoreTests20 extends TestCase { private void addManagedBuildNature (IProject project) { // Create the buildinformation object for the project - ManagedBuildManager.createBuildInfo(project); + IManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project); + info.setValid(true); // Add the managed build nature try { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java index 050e857054d..0db12b59295 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java @@ -272,13 +272,21 @@ public interface IManagedBuildInfo { public boolean isHeaderFile(String ext); /** - * gets the read only status of Managed Build Info + * Gets the read only status of Managed Build Info * * @return true if Managed Build Info is read only * otherwise returns false */ public boolean isReadOnly(); - + + /** + * Gets the "valid" status of Managed Build Info. Managed Build Info is invalid + * if the loading of, or conversion to, the Managed Build Info failed. + * + * @return true if Managed Build Info is valid, + * otherwise returns false + */ + public boolean isValid(); /** * Answers whether the receiver has been changed and requires the @@ -314,11 +322,18 @@ public interface IManagedBuildInfo { public boolean setDefaultConfiguration(String configName); /** - * Set the dirty flag for the build model to the value of the argument. + * Sets the dirty flag for the build model to the value of the argument. * * @param isDirty */ public void setDirty(boolean isDirty); + + /** + * Sets the valid flag for the build model to the value of the argument. + * + * @param isValid + */ + public void setValid(boolean isValid); /** * Sets the ManagedProject associated with this build info diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java index 809416667c8..42a295f1499 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java @@ -95,7 +95,10 @@ public interface ITool extends IBuildObject { public IOption getOptionById(String id); /** - * Answers the options that may be customized for this tool. + * Returns the complete list of options that are available for this tool. + * The list is a merging of the options specified for this tool with the + * options of its superclasses. The lowest option instance in the hierarchy + * takes precedence. * * @return IOption[] */ diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java index 2b17a199f9d..ab6c6ed8830 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java @@ -79,6 +79,10 @@ import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.IJobManager; import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -807,7 +811,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project); // Save the build info - if (buildInfo != null && !buildInfo.isReadOnly() && (force == true || buildInfo.isDirty())) { + if (buildInfo != null && + !buildInfo.isReadOnly() && + buildInfo.isValid() && + (force == true || buildInfo.isDirty())) { // For post-2.0 projects, there will be a version String projectVersion = buildInfo.getVersion(); if (projectVersion != null) { @@ -1158,8 +1165,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI } } } catch (Exception e) { - buildInfo = null; - // TODO: Issue an error message that the managed build project file (.cdtbuild) is invalid + throw e; } try { @@ -1198,8 +1204,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI try{ UpdateManagedProjectManager.updateProject(project,buildInfo); } catch(CoreException e){ - //TODO: error occured while updating the project, - //handle error, log error or display the message + throw e; } } project.setSessionProperty(buildInfoProperty, buildInfo); @@ -1207,6 +1212,8 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI } catch (Exception e) { throw e; } + + buildInfo.setValid(true); return buildInfo; } @@ -1529,7 +1536,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI * * @param resource The resource the build information is associated with */ - public static void createBuildInfo(IResource resource) { + public static ManagedBuildInfo createBuildInfo(IResource resource) { ManagedBuildInfo buildInfo = new ManagedBuildInfo(resource); try { // Associate the build info with the project for the duration of the session @@ -1538,6 +1545,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI // There is no point in keeping the info around if it isn't associated with the project buildInfo = null; } + return buildInfo; } private static IManagedConfigElementProvider createConfigProvider( @@ -1673,7 +1681,28 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI try { buildInfo = loadBuildInfo(project); } catch (Exception e) { - // TODO: Issue error reagarding not being able to load the project file (.cdtbuild) + // Issue error regarding not being able to load the project file (.cdtbuild) + if (buildInfo == null) { + buildInfo = createBuildInfo(project); + } + buildInfo.setValid(false); + // Display error message + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if(window == null){ + IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + + final Shell shell = window.getShell(); + final String exceptionMsg = e.getMessage(); + shell.getDisplay().syncExec( new Runnable() { + public void run() { + MessageDialog.openError(shell, + ManagedMakeMessages.getResourceString("ManagedBuildManager.error.open_failed_title"), //$NON-NLS-1$ + ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.open_failed", //$NON-NLS-1$ + exceptionMsg)); + } + } ); } try { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java index 5c96e291eee..15d5a1d17ce 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java @@ -222,7 +222,11 @@ public class GeneratedMakefileBuilder extends ACBuilder { outputError(getProject().getName(), "Build information was not found"); //$NON-NLS-1$ return referencedProjects; } - + if (!info.isValid()) { + outputError(getProject().getName(), "Build information is not valid"); //$NON-NLS-1$ + return referencedProjects; + } + // Create a makefile generator for the build IManagedBuilderMakefileGenerator generator = ManagedBuildManager.getBuildfileGenerator(info.getDefaultConfiguration()); generator.initialize(getProject(), info, monitor); @@ -283,6 +287,10 @@ public class GeneratedMakefileBuilder extends ACBuilder { outputError(getProject().getName(), "Build information was not found"); //$NON-NLS-1$ return; } + if (!info.isValid()) { + outputError(getProject().getName(), "Build information is not valid"); //$NON-NLS-1$ + return; + } IPath buildDirPath = getProject().getLocation().append(info.getConfigurationName()); IWorkspace workspace = CCorePlugin.getWorkspace(); IContainer buildDir = workspace.getRoot().getContainerForLocation(buildDirPath); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java index 138762f5ff2..e10639dddc1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java @@ -72,6 +72,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { 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 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { 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 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { } // 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 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @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; @@ -814,6 +838,23 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { } } + /* (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) */ @@ -932,14 +973,4 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { } return targetList; } - - public void setReadOnly(boolean readOnly){ - if(!readOnly && isReadOnly) - setDirty(true); - isReadOnly = readOnly; - } - - public boolean isReadOnly(){ - return isReadOnly; - } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java index 67e154b3fab..affe5d53582 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java @@ -22,7 +22,13 @@ import org.eclipse.cdt.managedbuilder.core.IManagedProject; import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IncrementalProjectBuilder; +import org.eclipse.core.resources.IWorkspaceRunnable; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -231,16 +237,56 @@ public class ManagedProject extends BuildObject implements IManagedProject { * @see org.eclipse.cdt.managedbuilder.core.IManagedProject#removeConfiguration(java.lang.String) */ public void removeConfiguration(String id) { - // Remove the specified configuration from the list and map - Iterator iter = getConfigurationList().listIterator(); - while (iter.hasNext()) { - IConfiguration config = (IConfiguration)iter.next(); - if (config.getId().equals(id)) { - getConfigurationList().remove(config); - getConfigurationMap().remove(id); - break; - } + final String removeId = id; + IWorkspaceRunnable remover = new IWorkspaceRunnable() { + public void run(IProgressMonitor monitor) throws CoreException { + // Remove the specified configuration from the list and map + Iterator iter = getConfigurationList().listIterator(); + while (iter.hasNext()) { + IConfiguration config = (IConfiguration)iter.next(); + if (config.getId().equals(removeId)) { + // TODO: For now we clean the entire project. This may be overkill, but + // it avoids a problem with leaving the configuration output directory + // around and having the outputs try to be used by the makefile generator code. + IResource proj = config.getOwner(); + IManagedBuildInfo info = null; + if (proj instanceof IProject) { + info = ManagedBuildManager.getBuildInfo(proj); + } + IConfiguration currentConfig = null; + boolean isCurrent = true; + if (info != null) { + currentConfig = info.getDefaultConfiguration(); + if (!currentConfig.getId().equals(removeId)) { + info.setDefaultConfiguration(config); + isCurrent = false; + } + } + ((IProject)proj).build(IncrementalProjectBuilder.CLEAN_BUILD, monitor); + + getConfigurationList().remove(config); + getConfigurationMap().remove(removeId); + + if (info != null) { + if (!isCurrent) { + info.setDefaultConfiguration(currentConfig); + } else { + // If the current default config is the one being removed, reset the default config + String[] configs = info.getConfigurationNames(); + if (configs.length > 0) { + info.setDefaultConfiguration(configs[0]); + } + } + } + break; + } + } + } + }; + try { + ResourcesPlugin.getWorkspace().run( remover, null ); } + catch( CoreException e ) {} setDirty(true); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties index 47c7b2fbcd4..67a1eef678d 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties @@ -39,6 +39,8 @@ ManagedBuildManager.error.null_owner=addTarget: null owner ManagedBuildManager.error.owner_not_project=addTarget: owner not project ManagedBuildManager.error.manifest.version.error=The version of plugin file is higher than version of the build system ManagedBuildManager.error.project.version.error=The version of the project is higher than the build system +ManagedBuildManager.error.open_failed_title=Managed Make Project File Error +ManagedBuildManager.error.open_failed=The Managed Make project file could not be read because of the following error.\n\n{0}\n\nManaged Make functionality will not be available for this project. # Makefile Generator Messages MakefileGenerator.message.start.file=Building file: diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java index b3d963c907c..199edd1772c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java @@ -533,7 +533,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator { if (info.buildsFileType(ext)) { // look for the extension in the map StringBuffer bufferForExtension = new StringBuffer(); - bufferForExtension.append(extensionToRuleStringMap.get(ext).toString()); + if (extensionToRuleStringMap.containsKey(ext)) { + bufferForExtension.append(extensionToRuleStringMap.get(ext).toString()); + } if(bufferForExtension != null && !getOutputExtensions().contains(bufferForExtension.toString())) { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/PluginResources.properties index 0956f33209a..5afc9f231a6 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/PluginResources.properties +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/PluginResources.properties @@ -12,31 +12,33 @@ UpdateManagedProject20.0=Backing up the settings file for {0} UpdateManagedProject20.1=Updating build settings for project {0} UpdateManagedProject20.10=No configurations were found for project {0} -UpdateManagedProject20.11=Build exception occured while creating managed project {0} : {1} +UpdateManagedProject20.11=Build exception occurred while creating Managed Make project {0} : {1} UpdateManagedProject20.2=convertConfiguration: Configuration {0} was not found UpdateManagedProject20.3=convertToolRef: Tool ID attribute does not exist UpdateManagedProject20.4=convertToolRef: Toolchain does not contain tools UpdateManagedProject20.5=convertToolRef: Parent not found for tool {0} UpdateManagedProject20.6=convertOptionRef: option ID attribute does not exist UpdateManagedProject20.7=convertOptionRef: option {0} not found -UpdateManagedProject20.8=convertOptionRef: BuildException occured: {0} +UpdateManagedProject20.8=convertOptionRef: BuildException occurred: {0} UpdateManagedProject20.9=Project type {0} not found +UpdateManagedProject20.invalid_build_info=The Managed Make information for the project is not valid. UpdateManagedProject12.0=Backing up the settings file for {0} UpdateManagedProject12.1=Updating build settings for project {0} UpdateManagedProject12.2=configuration {0} not found UpdateManagedProject12.3=Parent not found for option {0} UpdateManagedProject12.4=option {0} not found -UpdateManagedProject12.5=convertOptionRef: BuildException occured: {0} +UpdateManagedProject12.5=convertOptionRef: BuildException occurred: {0} UpdateManagedProject12.6=Project type {0} not found UpdateManagedProject12.7=No configurations were found for project {0} -UpdateManagedProject12.8=Build exception occured while creating managed project {0} : {1} +UpdateManagedProject12.8=Build exception occurred while creating Managed Make project {0} : {1} UpdateManagedProject12.9=Toolchain does not contain tools UpdateManagedProject12.10=Parent not found for tool {0} UpdateManagedProject12.11=tool {0} not found +UpdateManagedProject12.invalid_build_info=The Managed Make information for the project is not valid. UpdateManagedProjectManager.0=Backup File Already Exists UpdateManagedProjectManager.1=A backup file {0} already exists for the project {1}.\n Do you want to convert the project anyway? UpdateManagedProjectManager.2=The update operation has been cancelled.\n The build system will not be able to read the project settings until you update the project. -UpdateManagedProjectManager.3=Update Managed Builder Project +UpdateManagedProjectManager.3=Update Managed Make Project UpdateManagedProjectManager.4=The project {0} build settings are stored in a format that is no longer supported (version {1}).\n\nWould you like to convert it to the newer version ({2})?\n\nNOTE: Converted projects can no longer be loaded by previous versions of the Managed Build System.\nIf you select "No", project settings will be available in readonly mode. -UpdateManagedProjectManager.5=Managed project conversion FAILED: \n ManagedBuildManager version {0} is not equivalent to ManagedProject version {1} (project ID = {2}) +UpdateManagedProjectManager.5=Managed Make project conversion failed: \n Managed Build System version {0} is not equivalent to the Managed Make project version {1} (project ID = {2}) UpdateManagedProjectManager.6=the project .cdtbuild file does not exist diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties index 0b4fba31e9c..015a75e92c4 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties @@ -4,7 +4,7 @@ ######################################### # ------- Project Update Messages ------- -ManagedBuilderStartup.update.20x.title=Update Managed Builder Project +ManagedBuilderStartup.update.20x.title=Update Managed Make Project ManagedBuilderStartup.update.20x.message=The project {0} has been detected in your workspace.\n Its build settings are stored in a format that is no longer supported.\n Would you like to convert them now? # ------- NewProjectCreationPluginPage------- @@ -54,7 +54,7 @@ BuildPropertyPage.tip.addconf=Add configurations for the platform BuildPropertyPage.tip.remconf=Remove configurations for the platform BuildPropertyPage.manage.title=Manage BuildPropertyPage.error.Unknown_tree_element=Unknown type of element in tree of type {0} -BuildPropertyPage.error.version_low=The project settings are stored in an earlier format.\nYou must upgrade the project before the settings can be upgraded. +BuildPropertyPage.error.version_low=The project settings are stored in an earlier format.\nYou must upgrade the project before the settings can be displayed. BuildPropertyPage.defaults.title=Reset Configuration Tools BuildPropertyPage.defaults.message=This action will reset all of the tools in the selected configuration to their default settings.\n\nDo you want to proceed? BuildPropertyPage.changes.save.title=Apply Configuration Changes @@ -87,6 +87,7 @@ ResourceBuildPropertyPage.selection.configuration.all=All configurations ResourceBuildPropertyPage.label.ToolTree=Tools ResourceBuildPropertyPage.label.ToolOptions=Options ResourceBuildPropertyPage.label.NotMBSFile=The project is closed or the file is not contained within a Managed Make project. +ResourceBuildPropertyPage.error.version_low=The project settings are stored in an earlier format.\nYou must upgrade the project before the settings can be displayed. # ----------- Entry Dialog ----------- BrowseEntryDialog.error.Folder_name_invalid = Folder name invalid diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java index 9e4dfcff147..13218e3dcb3 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java @@ -141,6 +141,7 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert invalidInfo.setFont(parent.getFont()); invalidInfo.setText(ManagedBuilderUIMessages.getResourceString("BuildPropertyPage.error.version_low")); //$NON-NLS-1$ invalidInfo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true, true)); + noDefaultAndApplyButton(); return; } projectTypes = ManagedBuildManager.getDefinedProjectTypes(); diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java index 88e4fe068ea..1a32873446b 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java @@ -152,6 +152,9 @@ public class ResourceBuildPropertyPage extends PropertyPage implements invalidInfo.setFont(composite.getFont()); invalidInfo.setText(ManagedBuilderUIMessages.getResourceString("ResourceBuildPropertyPage.error.version_low")); //$NON-NLS-1$ invalidInfo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING,GridData.VERTICAL_ALIGN_CENTER, true, true)); + noContentOnPage = true; + noDefaultAndApplyButton(); + return; } // Add a config selection area diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java index 3ca45f48be2..94399d2a511 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java @@ -21,6 +21,7 @@ import org.eclipse.cdt.managedbuilder.core.ITargetPlatform; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature; +import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderHelpContextIds; import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIMessages; import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; @@ -122,8 +123,9 @@ public class NewManagedProjectWizard extends NewCProjectWizard { // Add the ManagedProject to the project IManagedProject newManagedProject = null; + IManagedBuildInfo info = null; try { - ManagedBuildManager.createBuildInfo(newProject); + info = ManagedBuildManager.createBuildInfo(newProject); IProjectType parent = projectConfigurationPage.getSelectedProjectType(); newManagedProject = ManagedBuildManager.createManagedProject(newProject, parent); if (newManagedProject != null) { @@ -168,7 +170,10 @@ public class NewManagedProjectWizard extends NewCProjectWizard { // Save the build options monitor.subTask(ManagedBuilderUIMessages.getResourceString(MSG_SAVE)); - ManagedBuildManager.saveBuildInfo(newProject, true); + if (info != null) { + info.setValid(true); + ManagedBuildManager.saveBuildInfo(newProject, true); + } monitor.done(); }