mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
1. Old project update fixes
2. bug-fixing
This commit is contained in:
parent
c3778e90a7
commit
1315197b69
4 changed files with 44 additions and 23 deletions
|
@ -901,7 +901,7 @@ public class Builder extends BuildObject implements IBuilder, IMatchKeyProvider
|
|||
args = addCmd(args, stopOnErrCmd);
|
||||
args = addCmd(args, parallelBuildCmd);
|
||||
|
||||
return args;
|
||||
return args != null ? args.trim() : null;
|
||||
}
|
||||
|
||||
private String addCmd(String args, String cmd){
|
||||
|
|
|
@ -765,7 +765,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
// 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 == null || configuration.isExtensionElement()) return;
|
||||
|
||||
if (!configuration.equals(getDefaultConfiguration())) {
|
||||
IProject project = owner.getProject();
|
||||
|
|
|
@ -195,6 +195,12 @@ public class BuildLanguageData extends CLanguageData {
|
|||
}
|
||||
|
||||
private void initOptionStores(){
|
||||
if(!fOptionStoreInited){
|
||||
initOptionStoresSynch();
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void initOptionStoresSynch(){
|
||||
if(!fOptionStoreInited){
|
||||
calculateKindToOptionArrayStore();
|
||||
calculateKindToUndefOptionArrayStore();
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
||||
public class UpdateManagedProject31 {
|
||||
private static final String INEXISTEND_PROP_ID = "";
|
||||
|
||||
static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
|
||||
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
|
||||
|
@ -46,32 +47,46 @@ public class UpdateManagedProject31 {
|
|||
if(props == null)
|
||||
return;
|
||||
|
||||
IToolChain tc = cfg.getToolChain();
|
||||
IToolChain extTc = ManagedBuildManager.getExtensionToolChain(tc);
|
||||
if(tc == null)
|
||||
return;
|
||||
String id = extTc.getId();
|
||||
if(id == null)
|
||||
boolean artefactTypeSupported = props.supportsType(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID);
|
||||
boolean buildTypeSupported = props.supportsType(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID);
|
||||
if(!artefactTypeSupported && !buildTypeSupported)
|
||||
return;
|
||||
|
||||
if(props.supportsType(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID)){
|
||||
String val = getBuildArtefactTypeFromId(id);
|
||||
if(val != null && props.supportsValue(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, val)){
|
||||
try {
|
||||
props.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, val);
|
||||
} catch (CoreException e) {
|
||||
ManagedBuilderCorePlugin.log(e);
|
||||
String artefactType = artefactTypeSupported ? null : INEXISTEND_PROP_ID;
|
||||
String buildType = buildTypeSupported ? null : INEXISTEND_PROP_ID;
|
||||
|
||||
String id = cfg.getId();
|
||||
if(artefactType == null){
|
||||
artefactType = getBuildArtefactTypeFromId(id);
|
||||
}
|
||||
if(buildType == null){
|
||||
buildType = getBuildTypeFromId(id);
|
||||
}
|
||||
|
||||
if(artefactType == null || buildType == null){
|
||||
for(IToolChain tc = cfg.getToolChain(); tc != null && (artefactType == null || buildType == null); tc = tc.getSuperClass()){
|
||||
id = tc.getId();
|
||||
if(artefactType == null){
|
||||
artefactType = getBuildArtefactTypeFromId(id);
|
||||
}
|
||||
if(buildType == null){
|
||||
buildType = getBuildTypeFromId(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(props.supportsType(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID)){
|
||||
String val = getBuildTypeFromId(id);
|
||||
if(val != null && props.supportsValue(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID, val)){
|
||||
try {
|
||||
props.setProperty(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID, val);
|
||||
} catch (CoreException e) {
|
||||
ManagedBuilderCorePlugin.log(e);
|
||||
}
|
||||
|
||||
if(artefactType != null && artefactType != INEXISTEND_PROP_ID){
|
||||
try {
|
||||
props.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, artefactType);
|
||||
} catch (CoreException e) {
|
||||
ManagedBuilderCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
if(buildType != null && buildType != INEXISTEND_PROP_ID){
|
||||
try {
|
||||
props.setProperty(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID, buildType);
|
||||
} catch (CoreException e) {
|
||||
ManagedBuilderCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue