1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Fix for [Bug 192423] Project conversion should NOT occur in case the tool-chain definition is not installed

This commit is contained in:
Mikhail Sennikovsky 2007-06-14 16:40:26 +00:00
parent b71d4ab820
commit d8ba0d98a9
2 changed files with 14 additions and 9 deletions

View file

@ -29,7 +29,6 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICExternalSetting; import org.eclipse.cdt.core.settings.model.ICExternalSetting;
import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.ICStorageElement;
import org.eclipse.cdt.core.settings.model.WriteAccessException;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
import org.eclipse.cdt.core.settings.model.extension.ICProjectConverter; import org.eclipse.cdt.core.settings.model.extension.ICProjectConverter;
import org.eclipse.cdt.core.settings.model.util.PathEntryTranslator; import org.eclipse.cdt.core.settings.model.util.PathEntryTranslator;
@ -502,7 +501,7 @@ public class ProjectConverter implements ICProjectConverter {
convertOldStdMakeToNewStyle(project, false, monitor, true); convertOldStdMakeToNewStyle(project, false, monitor, true);
} }
private IManagedBuildInfo convertManagedBuildInfo(IProject project, ICProjectDescription newDes){ private IManagedBuildInfo convertManagedBuildInfo(IProject project, ICProjectDescription newDes) throws CoreException {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfoLegacy(project); IManagedBuildInfo info = ManagedBuildManager.getBuildInfoLegacy(project);
synchronized(LOCK){ synchronized(LOCK){
@ -516,21 +515,23 @@ public class ProjectConverter implements ICProjectConverter {
for(int i = 0; i < cfgs.length; i++){ for(int i = 0; i < cfgs.length; i++){
cfg = (Configuration)cfgs[i]; cfg = (Configuration)cfgs[i];
data = cfg.getConfigurationData(); data = cfg.getConfigurationData();
try { // try {
ICConfigurationDescription cfgDes = newDes.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data); ICConfigurationDescription cfgDes = newDes.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
if(cfg.getConfigurationDescription() != null) { if(cfg.getConfigurationDescription() != null) {
//copy cfg to avoid raise conditions //copy cfg to avoid raise conditions
cfg = ConfigurationDataProvider.copyCfg(cfg, cfgDes); cfg = ConfigurationDataProvider.copyCfg(cfg, cfgDes);
} }
cfg.setConfigurationDescription(cfgDes); cfg.setConfigurationDescription(cfgDes);
} catch (WriteAccessException e) { // } catch (WriteAccessException e) {
ManagedBuilderCorePlugin.log(e); // ManagedBuilderCorePlugin.log(e);
} catch (CoreException e) { // } catch (CoreException e) {
ManagedBuilderCorePlugin.log(e); // ManagedBuilderCorePlugin.log(e);
} // }
cfg.exportArtifactInfo(); cfg.exportArtifactInfo();
} }
} }
} else {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), "failed to load the build info for the old-style project"));
} }
} }
return info; return info;

View file

@ -288,7 +288,11 @@ implements IExecutableExtension, IWizardWithMemory
public IPath getLastProjectLocation() { public IPath getLastProjectLocation() {
return lastProjectLocation; return lastProjectLocation;
} }
public IProject getLastProject() {
return newProject;
}
// Methods below should provide data for language check // Methods below should provide data for language check
public String[] getLanguageIDs (){ public String[] getLanguageIDs (){
return EMPTY_ARR; return EMPTY_ARR;