1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00

bug 416786: added message in log to indicate invalid option type used in .cproject

This commit is contained in:
Andrew Gvozdev 2013-09-10 10:02:20 -04:00
parent 67aac2386d
commit b61d716173
2 changed files with 29 additions and 21 deletions

View file

@ -44,6 +44,8 @@ import org.eclipse.cdt.managedbuilder.internal.macros.OptionContextData;
import org.eclipse.cdt.managedbuilder.macros.IOptionContextData; import org.eclipse.cdt.managedbuilder.macros.IOptionContextData;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.Version; import org.osgi.framework.Version;
public class Option extends BuildObject implements IOption, IBuildPropertiesRestriction { public class Option extends BuildObject implements IOption, IBuildPropertiesRestriction {
@ -776,7 +778,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} else if (valueTypeStr.equals(TYPE_TREE)) { } else if (valueTypeStr.equals(TYPE_TREE)) {
return TREE; return TREE;
} else { } else {
// TODO: This was the CDT 2.0 default - should we keep it? ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
"Invalid option type=\"" + valueTypeStr + "\" specified for option " + getId() )); //$NON-NLS-1$ //$NON-NLS-2$
// This was the CDT 2.0 default
return PREPROCESSOR_SYMBOLS; return PREPROCESSOR_SYMBOLS;
} }
} }

View file

@ -233,29 +233,33 @@ public class BuildEntryStorage extends AbstractEntryStorage {
List<UserEntryInfo> entryList = new ArrayList<UserEntryInfo>(); List<UserEntryInfo> entryList = new ArrayList<UserEntryInfo>();
for (IOption opt : options) { for (IOption opt : options) {
Option option = (Option)opt; Option option = (Option)opt;
@SuppressWarnings("unchecked") try {
List<OptionStringValue> list = usr ? (List<OptionStringValue>)option.getExactValue() : (List<OptionStringValue>)option.getExactBuiltinsList(); @SuppressWarnings("unchecked")
if (list != null) { List<OptionStringValue> list = usr ? (List<OptionStringValue>)option.getExactValue() : (List<OptionStringValue>)option.getExactBuiltinsList();
SupplierBasedCdtVariableSubstitutor subst = createSubstitutor(option, false); if (list != null) {
SupplierBasedCdtVariableSubstitutor bSVarsSubst = createSubstitutor(option, true); SupplierBasedCdtVariableSubstitutor subst = createSubstitutor(option, false);
for (int j = 0; j < list.size(); j++) { SupplierBasedCdtVariableSubstitutor bSVarsSubst = createSubstitutor(option, true);
OptionStringValue ve = list.get(j); for (int j = 0; j < list.size(); j++) {
OptionStringValue[] rVes = resolve(ve, option, bSVarsSubst); OptionStringValue ve = list.get(j);
if (rVes.length == 0) { OptionStringValue[] rVes = resolve(ve, option, bSVarsSubst);
// If not resolved, add EmptyEntryInfo based off the value entry if (rVes.length == 0) {
if (emptyValuesInfos != null) { // If not resolved, add EmptyEntryInfo based off the value entry
emptyValuesInfos.add(new EmptyEntryInfo(ve, j)); if (emptyValuesInfos != null) {
} emptyValuesInfos.add(new EmptyEntryInfo(ve, j));
} else { }
// If resolved, add each resolved entry as a separate UserEntryInfo } else {
boolean isMultiple = rVes.length > 1; // If resolved, add each resolved entry as a separate UserEntryInfo
List<UserEntryInfo> sequense = isMultiple ? new ArrayList<UserEntryInfo>(rVes.length) : null; boolean isMultiple = rVes.length > 1;
for (OptionStringValue rVe : rVes) { List<UserEntryInfo> sequense = isMultiple ? new ArrayList<UserEntryInfo>(rVes.length) : null;
ICLanguageSettingEntry entry = createUserEntry(option, rVe, flags, subst); for (OptionStringValue rVe : rVes) {
entryList.add(new UserEntryInfo(entry, ve, rVe, sequense)); ICLanguageSettingEntry entry = createUserEntry(option, rVe, flags, subst);
entryList.add(new UserEntryInfo(entry, ve, rVe, sequense));
}
} }
} }
} }
} catch (Exception e) {
ManagedBuilderCorePlugin.log(e);
} }
} }