mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05: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, stopOnErrCmd);
|
||||||
args = addCmd(args, parallelBuildCmd);
|
args = addCmd(args, parallelBuildCmd);
|
||||||
|
|
||||||
return args;
|
return args != null ? args.trim() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String addCmd(String args, String cmd){
|
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...
|
// 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.
|
// But, at least, our UI does not allow the last config to be deleted.
|
||||||
// Sanity
|
// Sanity
|
||||||
if (configuration == null) return;
|
if (configuration == null || configuration.isExtensionElement()) return;
|
||||||
|
|
||||||
if (!configuration.equals(getDefaultConfiguration())) {
|
if (!configuration.equals(getDefaultConfiguration())) {
|
||||||
IProject project = owner.getProject();
|
IProject project = owner.getProject();
|
||||||
|
|
|
@ -195,6 +195,12 @@ public class BuildLanguageData extends CLanguageData {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initOptionStores(){
|
private void initOptionStores(){
|
||||||
|
if(!fOptionStoreInited){
|
||||||
|
initOptionStoresSynch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void initOptionStoresSynch(){
|
||||||
if(!fOptionStoreInited){
|
if(!fOptionStoreInited){
|
||||||
calculateKindToOptionArrayStore();
|
calculateKindToOptionArrayStore();
|
||||||
calculateKindToUndefOptionArrayStore();
|
calculateKindToUndefOptionArrayStore();
|
||||||
|
|
|
@ -23,6 +23,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
|
||||||
public class UpdateManagedProject31 {
|
public class UpdateManagedProject31 {
|
||||||
|
private static final String INEXISTEND_PROP_ID = "";
|
||||||
|
|
||||||
static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
|
static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
|
||||||
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
|
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
|
||||||
|
@ -46,32 +47,46 @@ public class UpdateManagedProject31 {
|
||||||
if(props == null)
|
if(props == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IToolChain tc = cfg.getToolChain();
|
boolean artefactTypeSupported = props.supportsType(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID);
|
||||||
IToolChain extTc = ManagedBuildManager.getExtensionToolChain(tc);
|
boolean buildTypeSupported = props.supportsType(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID);
|
||||||
if(tc == null)
|
if(!artefactTypeSupported && !buildTypeSupported)
|
||||||
return;
|
|
||||||
String id = extTc.getId();
|
|
||||||
if(id == null)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(props.supportsType(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID)){
|
String artefactType = artefactTypeSupported ? null : INEXISTEND_PROP_ID;
|
||||||
String val = getBuildArtefactTypeFromId(id);
|
String buildType = buildTypeSupported ? null : INEXISTEND_PROP_ID;
|
||||||
if(val != null && props.supportsValue(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, val)){
|
|
||||||
try {
|
String id = cfg.getId();
|
||||||
props.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, val);
|
if(artefactType == null){
|
||||||
} catch (CoreException e) {
|
artefactType = getBuildArtefactTypeFromId(id);
|
||||||
ManagedBuilderCorePlugin.log(e);
|
}
|
||||||
|
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(artefactType != null && artefactType != INEXISTEND_PROP_ID){
|
||||||
if(val != null && props.supportsValue(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID, val)){
|
try {
|
||||||
try {
|
props.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, artefactType);
|
||||||
props.setProperty(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID, val);
|
} catch (CoreException e) {
|
||||||
} catch (CoreException e) {
|
ManagedBuilderCorePlugin.log(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