mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 00:45:28 +02:00
Fix for [Bug 178716] No way to get rid of built-in includes
This commit is contained in:
parent
be452903f0
commit
6fa7029c9f
30 changed files with 731 additions and 83 deletions
|
@ -349,7 +349,7 @@
|
|||
</inputType>
|
||||
<option
|
||||
id="org.eclipse.cdt.build.core.settings.holder.incpaths"
|
||||
name="include paths"
|
||||
name="Include Paths"
|
||||
browseType="directory"
|
||||
valueType="includePath"
|
||||
/>
|
||||
|
@ -370,6 +370,31 @@
|
|||
browseType="file"
|
||||
valueType="includeFiles"
|
||||
/>
|
||||
|
||||
<option
|
||||
id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths"
|
||||
name="Undefined Include Paths"
|
||||
browseType="directory"
|
||||
valueType="undefIncludePath"
|
||||
/>
|
||||
<option
|
||||
id="org.eclipse.cdt.build.core.settings.holder.undef.symbols"
|
||||
name="Undefined Symbols"
|
||||
valueType="undefDefinedSymbols"
|
||||
/>
|
||||
<option
|
||||
id="org.eclipse.cdt.build.core.settings.holder.undef.symbolfiles"
|
||||
name="Undefined Symbol Files"
|
||||
browseType="file"
|
||||
valueType="undefSymbolFiles"
|
||||
/>
|
||||
<option
|
||||
id="org.eclipse.cdt.build.core.settings.holder.undef.includefiles"
|
||||
name="Undefined Include Files"
|
||||
browseType="file"
|
||||
valueType="undefIncludeFiles"
|
||||
/>
|
||||
|
||||
<!--option
|
||||
id="org.eclipse.cdt.build.core.settings.holder.includes"
|
||||
name="holder for includes"
|
||||
|
|
|
@ -1213,6 +1213,18 @@ Additional special types exist to flag options of special relevance to the build
|
|||
</enumeration>
|
||||
<enumeration value="libFiles">
|
||||
</enumeration>
|
||||
<enumeration value="undefIncludePath">
|
||||
</enumeration>
|
||||
<enumeration value="undefDefinedSymbols">
|
||||
</enumeration>
|
||||
<enumeration value="undefLibPaths">
|
||||
</enumeration>
|
||||
<enumeration value="undefLibFiles">
|
||||
</enumeration>
|
||||
<enumeration value="undefIncludeFiles">
|
||||
</enumeration>
|
||||
<enumeration value="undefSymbolFiles">
|
||||
</enumeration>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
</attribute>
|
||||
|
|
|
@ -29,6 +29,13 @@ public interface IOption extends IBuildObject {
|
|||
public static final int LIBRARY_PATHS = 9;
|
||||
public static final int LIBRARY_FILES = 10;
|
||||
public static final int MACRO_FILES = 11;
|
||||
|
||||
public static final int UNDEF_INCLUDE_PATH = -INCLUDE_PATH;
|
||||
public static final int UNDEF_PREPROCESSOR_SYMBOLS = -PREPROCESSOR_SYMBOLS;
|
||||
public static final int UNDEF_INCLUDE_FILES = -INCLUDE_FILES;
|
||||
public static final int UNDEF_LIBRARY_PATHS = -LIBRARY_PATHS;
|
||||
public static final int UNDEF_LIBRARY_FILES = -LIBRARY_FILES;
|
||||
public static final int UNDEF_MACRO_FILES = -MACRO_FILES;
|
||||
|
||||
// Browse type
|
||||
public static final int BROWSE_NONE = 0;
|
||||
|
@ -69,6 +76,13 @@ public interface IOption extends IBuildObject {
|
|||
public static final String TYPE_LIB_FILES = "libFiles"; //$NON-NLS-1$
|
||||
public static final String TYPE_INC_FILES = "includeFiles"; //$NON-NLS-1$
|
||||
public static final String TYPE_SYMBOL_FILES = "symbolFiles"; //$NON-NLS-1$
|
||||
public static final String TYPE_UNDEF_INC_PATH = "undefIncludePath"; //$NON-NLS-1$
|
||||
public static final String TYPE_UNDEF_DEFINED_SYMBOLS = "undefDefinedSymbols"; //$NON-NLS-1$
|
||||
public static final String TYPE_UNDEF_LIB_PATHS = "undefLibPaths"; //$NON-NLS-1$
|
||||
public static final String TYPE_UNDEF_LIB_FILES = "undefLibFiles"; //$NON-NLS-1$
|
||||
public static final String TYPE_UNDEF_INC_FILES = "undefIncludeFiles"; //$NON-NLS-1$
|
||||
public static final String TYPE_UNDEF_SYMBOL_FILES = "undefSymbolFiles"; //$NON-NLS-1$
|
||||
|
||||
public static final String VALUE = "value"; //$NON-NLS-1$
|
||||
public static final String VALUE_TYPE = "valueType"; //$NON-NLS-1$
|
||||
public static final String VALUE_HANDLER = "valueHandler"; //$NON-NLS-1$
|
||||
|
|
|
@ -863,6 +863,12 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
&& option.getValueType() != IOption.LIBRARY_PATHS
|
||||
&& option.getValueType() != IOption.LIBRARY_FILES
|
||||
&& option.getValueType() != IOption.MACRO_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_INCLUDE_PATH
|
||||
&& option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS
|
||||
&& option.getValueType() != IOption.UNDEF_INCLUDE_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_LIBRARY_PATHS
|
||||
&& option.getValueType() != IOption.UNDEF_LIBRARY_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_MACRO_FILES
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
|
@ -890,6 +896,12 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
&& option.getValueType() != IOption.LIBRARY_PATHS
|
||||
&& option.getValueType() != IOption.LIBRARY_FILES
|
||||
&& option.getValueType() != IOption.MACRO_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_INCLUDE_PATH
|
||||
&& option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS
|
||||
&& option.getValueType() != IOption.UNDEF_INCLUDE_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_LIBRARY_PATHS
|
||||
&& option.getValueType() != IOption.UNDEF_LIBRARY_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_MACRO_FILES
|
||||
))
|
||||
return;
|
||||
} catch (BuildException e){
|
||||
|
@ -919,6 +931,12 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
&& option.getValueType() != IOption.LIBRARY_PATHS
|
||||
&& option.getValueType() != IOption.LIBRARY_FILES
|
||||
&& option.getValueType() != IOption.MACRO_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_INCLUDE_PATH
|
||||
&& option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS
|
||||
&& option.getValueType() != IOption.UNDEF_INCLUDE_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_LIBRARY_PATHS
|
||||
&& option.getValueType() != IOption.UNDEF_LIBRARY_FILES
|
||||
&& option.getValueType() != IOption.UNDEF_MACRO_FILES
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
|
@ -3562,6 +3580,26 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
case IOption.MACRO_FILES:
|
||||
return ICLanguageSettingEntry.MACRO_FILE;
|
||||
// case IOption.LIBRARIES:
|
||||
// return ICLanguageSettingEntry.LIBRARY_PATH;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int optionUndefTypeToEntryKind(int type){
|
||||
switch(type){
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
return ICLanguageSettingEntry.INCLUDE_PATH;
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
return ICLanguageSettingEntry.MACRO;
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
return ICLanguageSettingEntry.INCLUDE_FILE;
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
return ICLanguageSettingEntry.LIBRARY_PATH;
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
return ICLanguageSettingEntry.LIBRARY_FILE;
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
return ICLanguageSettingEntry.MACRO_FILE;
|
||||
// case IOption.LIBRARIES:
|
||||
// return ICLanguageSettingEntry.LIBRARY_PATH;
|
||||
}
|
||||
return 0;
|
||||
|
@ -3585,6 +3623,23 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
return 0;
|
||||
}
|
||||
|
||||
public static int entryKindToUndefOptionType(int kind){
|
||||
switch(kind){
|
||||
case ICLanguageSettingEntry.INCLUDE_PATH:
|
||||
return IOption.UNDEF_INCLUDE_PATH;
|
||||
case ICLanguageSettingEntry.INCLUDE_FILE:
|
||||
return IOption.UNDEF_INCLUDE_FILES;
|
||||
case ICLanguageSettingEntry.MACRO:
|
||||
return IOption.UNDEF_PREPROCESSOR_SYMBOLS;
|
||||
case ICLanguageSettingEntry.MACRO_FILE:
|
||||
return IOption.UNDEF_MACRO_FILES;
|
||||
case ICLanguageSettingEntry.LIBRARY_PATH:
|
||||
return IOption.UNDEF_LIBRARY_PATHS;//TODO IOption.LIBRARIES;
|
||||
case ICLanguageSettingEntry.LIBRARY_FILE:
|
||||
return IOption.UNDEF_LIBRARY_FILES;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public static ICConfigurationDescription getDescriptionForConfiguration(IConfiguration cfg){
|
||||
ICConfigurationDescription des = ((Configuration)cfg).getConfigurationDescription();
|
||||
if(des == null){
|
||||
|
|
|
@ -119,6 +119,7 @@ public class ManagedOptionValueHandler implements
|
|||
}
|
||||
break;
|
||||
case IOption.INCLUDE_PATH:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
if (Arrays.equals(option.getIncludePaths(), (String[])defaultValue)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -129,6 +130,7 @@ public class ManagedOptionValueHandler implements
|
|||
}
|
||||
break;
|
||||
case IOption.PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
if (Arrays.equals(option.getDefinedSymbols(), (String[])defaultValue)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -147,6 +149,10 @@ public class ManagedOptionValueHandler implements
|
|||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
default:
|
||||
if (Arrays.equals(option.getBasicStringListValue(), (String[])defaultValue)) {
|
||||
return true;
|
||||
|
|
|
@ -1113,7 +1113,13 @@ public class BuildDescription implements IBuildDescription {
|
|||
optType == IOption.INCLUDE_FILES ||
|
||||
optType == IOption.LIBRARY_PATHS ||
|
||||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES) {
|
||||
optType == IOption.MACRO_FILES ||
|
||||
optType == IOption.UNDEF_INCLUDE_PATH ||
|
||||
optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS ||
|
||||
optType == IOption.UNDEF_INCLUDE_FILES ||
|
||||
optType == IOption.UNDEF_LIBRARY_PATHS ||
|
||||
optType == IOption.UNDEF_LIBRARY_FILES ||
|
||||
optType == IOption.UNDEF_MACRO_FILES) {
|
||||
List outputList = (List)option.getValue();
|
||||
// Add outputPrefix to each if necessary
|
||||
if(outputList != null && outputList.size() > 0){
|
||||
|
@ -1419,7 +1425,13 @@ public class BuildDescription implements IBuildDescription {
|
|||
optType == IOption.INCLUDE_FILES ||
|
||||
optType == IOption.LIBRARY_PATHS ||
|
||||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES
|
||||
optType == IOption.MACRO_FILES ||
|
||||
optType == IOption.UNDEF_INCLUDE_PATH ||
|
||||
optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS ||
|
||||
optType == IOption.UNDEF_INCLUDE_FILES ||
|
||||
optType == IOption.UNDEF_LIBRARY_PATHS ||
|
||||
optType == IOption.UNDEF_LIBRARY_FILES ||
|
||||
optType == IOption.UNDEF_MACRO_FILES
|
||||
) {
|
||||
inputs = (List)option.getValue();
|
||||
}
|
||||
|
|
|
@ -573,7 +573,13 @@ public class BuildStep implements IBuildStep {
|
|||
optType == IOption.INCLUDE_FILES ||
|
||||
optType == IOption.LIBRARY_PATHS ||
|
||||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES){
|
||||
optType == IOption.MACRO_FILES ||
|
||||
optType == IOption.UNDEF_INCLUDE_PATH ||
|
||||
optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS ||
|
||||
optType == IOption.UNDEF_INCLUDE_FILES ||
|
||||
optType == IOption.UNDEF_LIBRARY_PATHS ||
|
||||
optType == IOption.UNDEF_LIBRARY_FILES ||
|
||||
optType == IOption.UNDEF_MACRO_FILES){
|
||||
// Mote that when using the enumerated inputs, the path(s) must be translated from project relative
|
||||
// to top build directory relative
|
||||
String[] paths = new String[bRcs.length];
|
||||
|
|
|
@ -248,10 +248,17 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
|
|||
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#removeOption(IOption)
|
||||
*/
|
||||
public void removeOption(IOption option) {
|
||||
if(option.getParent() != this)
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
getOptionList().remove(option);
|
||||
getOptionMap().remove(option.getId());
|
||||
setDirty(true);
|
||||
setRebuildState(true);
|
||||
|
||||
if(!isExtensionElement()){
|
||||
NotificationManager.getInstance().optionRemoved(getParentResourceInfo(), this, option);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -10,10 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||
|
||||
public interface ISettingsChangeListener {
|
||||
void optionChanged(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, Object oldValue);
|
||||
void settingsChanged(SettingsChangeEvent event);
|
||||
}
|
||||
|
|
|
@ -32,13 +32,31 @@ public class NotificationManager /*implements ISettingsChangeListener */{
|
|||
return fInstance;
|
||||
}
|
||||
|
||||
public void optionRemoved(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
|
||||
SettingsChangeEvent event = createOptionRemovedEvent(rcInfo, holder, option);
|
||||
notifyListeners(event);
|
||||
}
|
||||
|
||||
public void optionChanged(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, Object oldValue) {
|
||||
for(Iterator iter = fListeners.iterator(); iter.hasNext();){
|
||||
ISettingsChangeListener listener = (ISettingsChangeListener)iter.next();
|
||||
listener.optionChanged(rcInfo, holder, option, oldValue);
|
||||
SettingsChangeEvent event = createOptionChangedEvent(rcInfo, holder, option, oldValue);
|
||||
notifyListeners(event);
|
||||
}
|
||||
|
||||
private void notifyListeners(SettingsChangeEvent event){
|
||||
ISettingsChangeListener listeners[] = (ISettingsChangeListener[])fListeners.toArray(new ISettingsChangeListener[fListeners.size()]);
|
||||
for(int i = 0; i < listeners.length; i++){
|
||||
listeners[i].settingsChanged(event);
|
||||
}
|
||||
}
|
||||
|
||||
private static SettingsChangeEvent createOptionChangedEvent(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, Object oldValue){
|
||||
return new SettingsChangeEvent(SettingsChangeEvent.CHANGED, rcInfo, holder, option, oldValue);
|
||||
}
|
||||
|
||||
private static SettingsChangeEvent createOptionRemovedEvent(IResourceInfo rcInfo, IHoldsOptions holder, IOption option){
|
||||
return new SettingsChangeEvent(SettingsChangeEvent.REMOVED, rcInfo, holder, option, null);
|
||||
}
|
||||
|
||||
public void subscribe(ISettingsChangeListener listener){
|
||||
// synchronized (this) {
|
||||
fListeners.add(listener);
|
||||
|
|
|
@ -242,6 +242,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
case LIBRARY_PATHS:
|
||||
case LIBRARY_FILES:
|
||||
case MACRO_FILES:
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
case UNDEF_MACRO_FILES:
|
||||
if (option.value != null) {
|
||||
value = new ArrayList((ArrayList)option.value);
|
||||
}
|
||||
|
@ -513,6 +519,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
case LIBRARY_PATHS:
|
||||
case LIBRARY_FILES:
|
||||
case MACRO_FILES:
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
case UNDEF_MACRO_FILES:
|
||||
// Note: These string-list options do not load either the "value" or
|
||||
// "defaultValue" attributes. Instead, the ListOptionValue children
|
||||
// are loaded in the value field.
|
||||
|
@ -628,6 +640,18 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
return INCLUDE_FILES;
|
||||
else if (valueTypeStr.equals(TYPE_SYMBOL_FILES))
|
||||
return MACRO_FILES;
|
||||
else if (valueTypeStr.equals(TYPE_UNDEF_INC_PATH))
|
||||
return UNDEF_INCLUDE_PATH;
|
||||
else if (valueTypeStr.equals(TYPE_UNDEF_DEFINED_SYMBOLS))
|
||||
return UNDEF_PREPROCESSOR_SYMBOLS;
|
||||
else if (valueTypeStr.equals(TYPE_UNDEF_LIB_PATHS))
|
||||
return UNDEF_LIBRARY_PATHS;
|
||||
else if (valueTypeStr.equals(TYPE_UNDEF_LIB_FILES))
|
||||
return UNDEF_LIBRARY_FILES;
|
||||
else if (valueTypeStr.equals(TYPE_UNDEF_INC_FILES))
|
||||
return UNDEF_INCLUDE_FILES;
|
||||
else if (valueTypeStr.equals(TYPE_UNDEF_SYMBOL_FILES))
|
||||
return UNDEF_MACRO_FILES;
|
||||
else {
|
||||
// TODO: This was the CDT 2.0 default - should we keep it?
|
||||
return PREPROCESSOR_SYMBOLS;
|
||||
|
@ -697,6 +721,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
case LIBRARY_PATHS:
|
||||
case LIBRARY_FILES:
|
||||
case MACRO_FILES:
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
case UNDEF_MACRO_FILES:
|
||||
if (value != null) {
|
||||
ArrayList stringList = (ArrayList)value;
|
||||
ListIterator iter = stringList.listIterator();
|
||||
|
@ -774,6 +804,24 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
case MACRO_FILES:
|
||||
str = TYPE_SYMBOL_FILES;
|
||||
break;
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
str = TYPE_UNDEF_INC_PATH;
|
||||
break;
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
str = TYPE_UNDEF_DEFINED_SYMBOLS;
|
||||
break;
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
str = TYPE_UNDEF_INC_FILES;
|
||||
break;
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
str = TYPE_UNDEF_LIB_PATHS;
|
||||
break;
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
str = TYPE_UNDEF_LIB_FILES;
|
||||
break;
|
||||
case UNDEF_MACRO_FILES:
|
||||
str = TYPE_UNDEF_SYMBOL_FILES;
|
||||
break;
|
||||
default:
|
||||
// TODO; is this a problem...
|
||||
str = EMPTY_STRING;
|
||||
|
@ -1335,6 +1383,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
case LIBRARY_PATHS:
|
||||
case LIBRARY_FILES:
|
||||
case MACRO_FILES:
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
case UNDEF_MACRO_FILES:
|
||||
val = new ArrayList();
|
||||
break;
|
||||
default:
|
||||
|
@ -1516,6 +1570,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
|| getValueType() == LIBRARY_PATHS
|
||||
|| getValueType() == LIBRARY_FILES
|
||||
|| getValueType() == MACRO_FILES
|
||||
|| getValueType() == UNDEF_INCLUDE_PATH
|
||||
|| getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
|
||||
|| getValueType() == UNDEF_INCLUDE_FILES
|
||||
|| getValueType() == UNDEF_LIBRARY_PATHS
|
||||
|| getValueType() == UNDEF_LIBRARY_FILES
|
||||
|| getValueType() == UNDEF_MACRO_FILES
|
||||
)) {
|
||||
// Just replace what the option reference is holding onto
|
||||
if(value == null)
|
||||
|
@ -1773,6 +1833,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
case LIBRARY_PATHS:
|
||||
case LIBRARY_FILES:
|
||||
case MACRO_FILES:
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
case UNDEF_MACRO_FILES:
|
||||
// Note: These string-list options do not load either the "value" or
|
||||
// "defaultValue" attributes. Instead, the ListOptionValue children
|
||||
// are loaded in the value field.
|
||||
|
@ -2064,4 +2130,34 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getOppositeType(int type){
|
||||
switch(type){
|
||||
case INCLUDE_PATH:
|
||||
return UNDEF_INCLUDE_PATH;
|
||||
case PREPROCESSOR_SYMBOLS:
|
||||
return UNDEF_PREPROCESSOR_SYMBOLS;
|
||||
case INCLUDE_FILES:
|
||||
return UNDEF_INCLUDE_FILES;
|
||||
case LIBRARY_PATHS:
|
||||
return UNDEF_LIBRARY_PATHS;
|
||||
case LIBRARY_FILES:
|
||||
return UNDEF_LIBRARY_FILES;
|
||||
case MACRO_FILES:
|
||||
return UNDEF_MACRO_FILES;
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
return INCLUDE_PATH;
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
return PREPROCESSOR_SYMBOLS;
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
return INCLUDE_FILES;
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
return LIBRARY_PATHS;
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
return LIBRARY_FILES;
|
||||
case UNDEF_MACRO_FILES:
|
||||
return MACRO_FILES;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,7 +137,12 @@ public class OptionReference implements IOption {
|
|||
case LIBRARY_PATHS:
|
||||
case LIBRARY_FILES:
|
||||
case MACRO_FILES:
|
||||
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
case UNDEF_MACRO_FILES:
|
||||
List valueList = new ArrayList();
|
||||
NodeList nodes = element.getElementsByTagName(LIST_VALUE);
|
||||
for (int i = 0; i < nodes.getLength(); ++i) {
|
||||
|
@ -205,6 +210,12 @@ public class OptionReference implements IOption {
|
|||
case LIBRARY_PATHS:
|
||||
case LIBRARY_FILES:
|
||||
case MACRO_FILES:
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
case UNDEF_MACRO_FILES:
|
||||
List valueList = new ArrayList();
|
||||
IManagedConfigElement[] valueElements = element.getChildren(LIST_VALUE);
|
||||
for (int i = 0; i < valueElements.length; ++i) {
|
||||
|
@ -258,6 +269,12 @@ public class OptionReference implements IOption {
|
|||
case LIBRARY_PATHS:
|
||||
case LIBRARY_FILES:
|
||||
case MACRO_FILES:
|
||||
case UNDEF_INCLUDE_PATH:
|
||||
case UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case UNDEF_INCLUDE_FILES:
|
||||
case UNDEF_LIBRARY_PATHS:
|
||||
case UNDEF_LIBRARY_FILES:
|
||||
case UNDEF_MACRO_FILES:
|
||||
ArrayList stringList = (ArrayList)value;
|
||||
ListIterator iter = stringList.listIterator();
|
||||
while (iter.hasNext()) {
|
||||
|
@ -651,7 +668,14 @@ public class OptionReference implements IOption {
|
|||
|| getValueType() == INCLUDE_FILES
|
||||
|| getValueType() == LIBRARY_PATHS
|
||||
|| getValueType() == LIBRARY_FILES
|
||||
|| getValueType() == MACRO_FILES) {
|
||||
|| getValueType() == MACRO_FILES
|
||||
|| getValueType() == UNDEF_INCLUDE_PATH
|
||||
|| getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
|
||||
|| getValueType() == UNDEF_INCLUDE_FILES
|
||||
|| getValueType() == UNDEF_LIBRARY_PATHS
|
||||
|| getValueType() == UNDEF_LIBRARY_FILES
|
||||
|| getValueType() == UNDEF_MACRO_FILES
|
||||
) {
|
||||
// Just replace what the option reference is holding onto
|
||||
this.value = new ArrayList(Arrays.asList(value));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||
|
||||
public class SettingsChangeEvent {
|
||||
private IResourceInfo fRcInfo;
|
||||
private IHoldsOptions fHolder;
|
||||
private IOption fOption;
|
||||
private Object fOldValue;
|
||||
|
||||
private int fChangeType;
|
||||
private int fSettingType;
|
||||
public static final int CHANGED = 1;
|
||||
public static final int ADDED = 1 << 1;
|
||||
public static final int REMOVED = 1 << 2;
|
||||
|
||||
public static final int OPTION = 1;
|
||||
|
||||
SettingsChangeEvent(int changeType, IResourceInfo rcInfo, IHoldsOptions holder, IOption option, Object oldValue){
|
||||
fSettingType = OPTION;
|
||||
fChangeType = changeType;
|
||||
fRcInfo = rcInfo;
|
||||
fHolder = holder;
|
||||
fOption = option;
|
||||
fOldValue = oldValue;
|
||||
}
|
||||
|
||||
public IResourceInfo getRcInfo() {
|
||||
return fRcInfo;
|
||||
}
|
||||
|
||||
public IHoldsOptions getHolder() {
|
||||
return fHolder;
|
||||
}
|
||||
|
||||
public IOption getOption() {
|
||||
return fOption;
|
||||
}
|
||||
|
||||
public Object getOldValue() {
|
||||
return fOldValue;
|
||||
}
|
||||
|
||||
public int getChangeType() {
|
||||
return fChangeType;
|
||||
}
|
||||
|
||||
public int getSettingType() {
|
||||
return fSettingType;
|
||||
}
|
||||
}
|
|
@ -53,7 +53,9 @@ import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
|||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.BuildLanguageData;
|
||||
import org.eclipse.cdt.managedbuilder.internal.dataprovider.EntryStorage;
|
||||
import org.eclipse.cdt.managedbuilder.internal.enablement.OptionEnablementExpression;
|
||||
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
|
||||
import org.eclipse.cdt.managedbuilder.internal.macros.BuildfileMacroSubstitutor;
|
||||
|
@ -79,6 +81,8 @@ import org.eclipse.core.runtime.content.IContentType;
|
|||
import org.eclipse.core.runtime.content.IContentTypeSettings;
|
||||
import org.eclipse.core.runtime.preferences.IScopeContext;
|
||||
|
||||
import com.sun.rsasign.l;
|
||||
|
||||
/**
|
||||
* Represents a tool that can be invoked during a build.
|
||||
* Note that this class implements IOptionCategory to represent the top
|
||||
|
@ -1903,9 +1907,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
|
|||
optType == IOption.INCLUDE_FILES ||
|
||||
optType == IOption.LIBRARY_PATHS ||
|
||||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES) {
|
||||
optType == IOption.MACRO_FILES
|
||||
) {
|
||||
List inputNames = (List)option.getValue();
|
||||
filterValues(optType, inputNames);
|
||||
for (int j=0; j<inputNames.size(); j++) {
|
||||
|
||||
inputs.add(Path.fromOSString((String)inputNames.get(j)));
|
||||
}
|
||||
}
|
||||
|
@ -2581,7 +2588,10 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
|
|||
case IOption.LIBRARY_PATHS :
|
||||
case IOption.LIBRARY_FILES :
|
||||
case IOption.MACRO_FILES :
|
||||
{
|
||||
case IOption.UNDEF_INCLUDE_FILES :
|
||||
case IOption.UNDEF_LIBRARY_PATHS :
|
||||
case IOption.UNDEF_LIBRARY_FILES :
|
||||
case IOption.UNDEF_MACRO_FILES : {
|
||||
String listCmd = option.getCommand();
|
||||
IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
||||
new FileContextData(inputFileLocation, outputFileLocation, option, this));
|
||||
|
@ -2599,7 +2609,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
|
|||
}
|
||||
break;
|
||||
|
||||
case IOption.INCLUDE_PATH :{
|
||||
case IOption.INCLUDE_PATH :
|
||||
case IOption.UNDEF_INCLUDE_PATH :{
|
||||
String incCmd = option.getCommand();
|
||||
IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
||||
new FileContextData(inputFileLocation, outputFileLocation, option, this));
|
||||
|
@ -2617,7 +2628,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
|
|||
}
|
||||
break;
|
||||
|
||||
case IOption.PREPROCESSOR_SYMBOLS :{
|
||||
case IOption.PREPROCESSOR_SYMBOLS :
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS :{
|
||||
String defCmd = option.getCommand();
|
||||
IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
||||
new FileContextData(inputFileLocation, outputFileLocation, option, this));
|
||||
|
@ -4024,4 +4036,47 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
|
|||
//scannerConfigDiscoveryProfileId
|
||||
return false;
|
||||
}
|
||||
|
||||
public IOption[] getOptionsOfType(int type){
|
||||
IOption options[] = getOptions();
|
||||
List list = new ArrayList();
|
||||
for(int i = 0; i < options.length; i++){
|
||||
try {
|
||||
if(options[i].getValueType() == type){
|
||||
list.add(options[i]);
|
||||
}
|
||||
} catch (BuildException e) {
|
||||
ManagedBuilderCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
return (Option[])list.toArray(new Option[list.size()]);
|
||||
}
|
||||
|
||||
public void filterValues(int type, List values){
|
||||
if(values.size() == 0)
|
||||
return;
|
||||
|
||||
int opType = Option.getOppositeType(type);
|
||||
if(opType != 0){
|
||||
IOption opOptions[] = getOptionsOfType(opType);
|
||||
Set filterSet = new HashSet();
|
||||
for(int i = 0; i < opOptions.length; i++){
|
||||
List opList = (List)opOptions[i].getValue();
|
||||
filterSet.addAll(opList);
|
||||
}
|
||||
|
||||
if(filterSet.size() != 0){
|
||||
Object oVal;
|
||||
for(int i = 0; i < values.size(); i++){
|
||||
oVal = values.get(i);
|
||||
if(type == IOption.PREPROCESSOR_SYMBOLS){
|
||||
String[] nameVal = EntryStorage.macroNameValueFromValue((String)oVal);
|
||||
oVal = nameVal[0];
|
||||
}
|
||||
if(filterSet.contains(oVal))
|
||||
values.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ public class BuildLanguageData extends CLanguageData {
|
|||
private ITool fTool;
|
||||
private IInputType fInputType;
|
||||
private KindBasedStore fKindToOptionArrayStore = new KindBasedStore();
|
||||
private KindBasedStore fKindToUndefOptionArrayStore = new KindBasedStore();
|
||||
private static final IOption[] EMPTY_OPTION_ARRAY = new IOption[0];
|
||||
private boolean fOptionStoreInited;
|
||||
// private Map fKindToEntryArrayMap = new HashMap();
|
||||
|
@ -95,20 +96,20 @@ public class BuildLanguageData extends CLanguageData {
|
|||
return starage;
|
||||
}
|
||||
|
||||
private void optionsChanged(int kind, IOption option, Object oldValue){
|
||||
private void notifyOptionsChangeForKind(int kind){
|
||||
fOptionStoreInited = false;
|
||||
EntryStorage storage = getEntryStorage(kind);
|
||||
if(storage != null)
|
||||
storage.optionsChanged(option, oldValue);
|
||||
storage.optionsChanged();
|
||||
}
|
||||
|
||||
public void optionChanged(IOption option, Object oldValue){
|
||||
try {
|
||||
int kind = ManagedBuildManager.optionTypeToEntryKind(option.getValueType());
|
||||
if(kind != 0)
|
||||
optionsChanged(kind, option, oldValue);
|
||||
} catch (BuildException e) {
|
||||
}
|
||||
public void optionsChanged(int type){
|
||||
int kind = ManagedBuildManager.optionTypeToEntryKind(type);
|
||||
if(kind == 0)
|
||||
kind = ManagedBuildManager.optionUndefTypeToEntryKind(type);
|
||||
|
||||
if(kind != 0)
|
||||
notifyOptionsChangeForKind(kind);
|
||||
}
|
||||
|
||||
private ProfileInfoProvider getDiscoveredInfoProvider(){
|
||||
|
@ -306,12 +307,23 @@ public class BuildLanguageData extends CLanguageData {
|
|||
}
|
||||
|
||||
private KindBasedStore getKindToOptionArrayStore(){
|
||||
if(!fOptionStoreInited){
|
||||
calculateKindToOptionArrayStore();
|
||||
fOptionStoreInited = true;
|
||||
}
|
||||
initOptionStores();
|
||||
return fKindToOptionArrayStore;
|
||||
}
|
||||
|
||||
private void initOptionStores(){
|
||||
if(!fOptionStoreInited){
|
||||
calculateKindToOptionArrayStore();
|
||||
calculateKindToUndefOptionArrayStore();
|
||||
fOptionStoreInited = true;
|
||||
}
|
||||
}
|
||||
|
||||
private KindBasedStore getKindToUndefOptionArrayStore(){
|
||||
initOptionStores();
|
||||
return fKindToUndefOptionArrayStore;
|
||||
}
|
||||
|
||||
private void calculateKindToOptionArrayStore(){
|
||||
fKindToOptionArrayStore.clear();
|
||||
IOption options[] = fTool.getOptions();
|
||||
|
@ -340,6 +352,41 @@ public class BuildLanguageData extends CLanguageData {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void calculateKindToUndefOptionArrayStore(){
|
||||
fKindToUndefOptionArrayStore.clear();
|
||||
IOption options[] = fTool.getOptions();
|
||||
for(int i = 0; i < options.length; i++){
|
||||
IOption option = options[i];
|
||||
try {
|
||||
int type = option.getValueType();
|
||||
int entryKind = ManagedBuildManager.optionUndefTypeToEntryKind(type);
|
||||
if(entryKind != 0){
|
||||
getOptionList(fKindToUndefOptionArrayStore, entryKind).add(option);
|
||||
}
|
||||
} catch (BuildException e) {
|
||||
}
|
||||
}
|
||||
|
||||
IKindBasedInfo infos[] = fKindToUndefOptionArrayStore.getContents();
|
||||
IKindBasedInfo info;
|
||||
for(int i = 0; i < infos.length; i++){
|
||||
info = infos[i];
|
||||
List list = (List)info.getInfo();
|
||||
if(list != null){
|
||||
IOption[] opts = (IOption[])list.toArray(new IOption[list.size()]);
|
||||
info.setInfo(opts);
|
||||
} else {
|
||||
info.setInfo(EMPTY_OPTION_ARRAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IOption[] getUndefOptionsForKind(int entryKind){
|
||||
KindBasedStore store = getKindToUndefOptionArrayStore();
|
||||
return (IOption[])store.get(entryKind);
|
||||
}
|
||||
|
||||
IOption[] getOptionsForKind(int entryKind){
|
||||
KindBasedStore store = getKindToOptionArrayStore();
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
|||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationDataProvider;
|
||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
|
||||
|
@ -45,6 +45,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.InputType;
|
|||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.NotificationManager;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.SettingsChangeEvent;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
@ -420,14 +421,20 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
|||
return cfgDes.getSessionProperty(CFG_PERSISTED_PROPERTY) != null;
|
||||
}
|
||||
|
||||
public void optionChanged(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, Object oldValue) {
|
||||
BuildLanguageData datas[] = (BuildLanguageData[])rcInfo.getCLanguageDatas();
|
||||
for(int i = 0; i < datas.length; i++){
|
||||
datas[i].optionChanged(option, oldValue);
|
||||
public void settingsChanged(SettingsChangeEvent event) {
|
||||
BuildLanguageData datas[] = (BuildLanguageData[])event.getRcInfo().getCLanguageDatas();
|
||||
IOption option = event.getOption();
|
||||
|
||||
try {
|
||||
int type = option.getValueType();
|
||||
for(int i = 0; i < datas.length; i++){
|
||||
datas[i].optionsChanged(type);
|
||||
}
|
||||
} catch (BuildException e) {
|
||||
ManagedBuilderCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void removeConfiguration(ICConfigurationDescription des,
|
||||
CConfigurationData data,
|
||||
IProgressMonitor monitor) {
|
||||
|
|
|
@ -12,7 +12,9 @@ package org.eclipse.cdt.managedbuilder.internal.dataprovider;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.CIncludeFileEntry;
|
||||
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
|
||||
|
@ -54,7 +56,7 @@ public class EntryStorage {
|
|||
return fKind;
|
||||
}
|
||||
|
||||
void optionsChanged(IOption option, Object oldValue){
|
||||
void optionsChanged(){
|
||||
fUserValuesInited = false;
|
||||
}
|
||||
|
||||
|
@ -89,6 +91,14 @@ public class EntryStorage {
|
|||
tool.removeOption(option);
|
||||
}
|
||||
}
|
||||
|
||||
options = fLangData.getUndefOptionsForKind(fKind);
|
||||
for(int i = 0; i < options.length; i++){
|
||||
IOption option = options[i];
|
||||
if(option.getParent() == tool){
|
||||
tool.removeOption(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void resetCache(){
|
||||
|
@ -126,22 +136,42 @@ public class EntryStorage {
|
|||
|
||||
SettingLevel level = fSettings.getLevels()[0];
|
||||
ICLanguageSettingEntry usrEntries[] = level.getEntries();
|
||||
IOption options[] = fLangData.getOptionsForKind(fKind);
|
||||
if(options.length > 0){
|
||||
IOption option = options[0];
|
||||
String optValue[] = new String[usrEntries.length];
|
||||
for(int i = 0; i < usrEntries.length; i++){
|
||||
ICLanguageSettingEntry entry = usrEntries[i];
|
||||
optValue[i] = entryValueToOption(entry);
|
||||
if(usrEntries.length != 0){
|
||||
IOption options[] = fLangData.getOptionsForKind(fKind);
|
||||
if(options.length > 0){
|
||||
IOption option = options[0];
|
||||
String optValue[] = new String[usrEntries.length];
|
||||
for(int i = 0; i < usrEntries.length; i++){
|
||||
ICLanguageSettingEntry entry = usrEntries[i];
|
||||
optValue[i] = entryValueToOption(entry);
|
||||
}
|
||||
|
||||
ITool tool = fLangData.getTool();
|
||||
IResourceInfo rcInfo = tool.getParentResourceInfo();
|
||||
IOption newOption = ManagedBuildManager.setOption(rcInfo, tool, option, optValue);
|
||||
options = fLangData.getOptionsForKind(fKind);
|
||||
for(int i = 0; i < options.length; i++){
|
||||
if(options[i] != newOption)
|
||||
ManagedBuildManager.setOption(rcInfo, tool, option, new String[0]);
|
||||
}
|
||||
}
|
||||
|
||||
ITool tool = fLangData.getTool();
|
||||
IResourceInfo rcInfo = tool.getParentResourceInfo();
|
||||
IOption newOption = ManagedBuildManager.setOption(rcInfo, tool, option, optValue);
|
||||
options = fLangData.getOptionsForKind(fKind);
|
||||
for(int i = 0; i < options.length; i++){
|
||||
if(options[i] != newOption)
|
||||
ManagedBuildManager.setOption(rcInfo, tool, option, new String[0]);
|
||||
}
|
||||
|
||||
if(level.containsOverrideInfo()){
|
||||
IOption options[] = fLangData.getUndefOptionsForKind(fKind);
|
||||
if(options.length != 0){
|
||||
Set set = level.getOverrideSet();
|
||||
IOption option = options[0];
|
||||
String[] optValue = (String[])set.toArray(new String[set.size()]);
|
||||
|
||||
ITool tool = fLangData.getTool();
|
||||
IResourceInfo rcInfo = tool.getParentResourceInfo();
|
||||
IOption newOption = ManagedBuildManager.setOption(rcInfo, tool, option, optValue);
|
||||
options = fLangData.getUndefOptionsForKind(fKind);
|
||||
for(int i = 0; i < options.length; i++){
|
||||
if(options[i] != newOption)
|
||||
ManagedBuildManager.setOption(rcInfo, tool, option, new String[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -169,6 +199,7 @@ public class EntryStorage {
|
|||
|
||||
dEntries = getUserDiscoveredEntries();
|
||||
addEntries(levels[0], dEntries);
|
||||
levels[0].fOverrideSet = getUserUndefinedStringSet();
|
||||
|
||||
fSettings.adjustOverrideState();
|
||||
//// fDiscoveredEntries.clear();
|
||||
|
@ -228,28 +259,37 @@ public class EntryStorage {
|
|||
SettingsSet settings = new SettingsSet(3);
|
||||
SettingLevel levels[] = settings.getLevels();
|
||||
|
||||
boolean override = isDiscoveredEntriesOverridable();
|
||||
int readOnlyFlag = override ? 0 : ICSettingEntry.READONLY;
|
||||
levels[0].setFlagsToClear(ICSettingEntry.READONLY | ICSettingEntry.BUILTIN);
|
||||
levels[0].setFlagsToSet(0);
|
||||
levels[0].setReadOnly(false);
|
||||
levels[0].setOverrideSupported(override);
|
||||
|
||||
levels[1].setFlagsToClear(ICSettingEntry.BUILTIN);
|
||||
levels[1].setFlagsToSet(ICSettingEntry.READONLY | ICSettingEntry.RESOLVED);
|
||||
levels[1].setFlagsToSet(readOnlyFlag | ICSettingEntry.RESOLVED);
|
||||
levels[1].setReadOnly(true);
|
||||
levels[1].setOverrideSupported(false);
|
||||
|
||||
levels[2].setFlagsToClear(0);
|
||||
levels[2].setFlagsToSet(ICSettingEntry.READONLY | ICSettingEntry.BUILTIN | ICSettingEntry.RESOLVED);
|
||||
levels[2].setFlagsToSet(readOnlyFlag | ICSettingEntry.BUILTIN | ICSettingEntry.RESOLVED);
|
||||
levels[2].setReadOnly(true);
|
||||
levels[2].setOverrideSupported(false);
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
private boolean isDiscoveredEntriesReadOnly(){
|
||||
if(fKind == ICLanguageSettingEntry.MACRO){
|
||||
return fLangData.getOptionsForKind(fKind).length != 0;
|
||||
}
|
||||
return true;
|
||||
private boolean isDiscoveredEntriesOverridable(){
|
||||
// if(!needUndef())
|
||||
// return false;
|
||||
|
||||
return fLangData.getUndefOptionsForKind(fKind).length != 0;
|
||||
}
|
||||
|
||||
// private boolean needUndef(){
|
||||
// return fKind != ICLanguageSettingEntry.MACRO;
|
||||
// }
|
||||
|
||||
// private void initUserValues(){
|
||||
// IOption options[] = fLangData.getOptionsForKind(fKind);
|
||||
// fUserEntries.clear();
|
||||
|
@ -279,6 +319,22 @@ public class EntryStorage {
|
|||
// }
|
||||
// }
|
||||
|
||||
private HashSet getUserUndefinedStringSet(){
|
||||
HashSet set = null;
|
||||
IOption options[] = fLangData.getUndefOptionsForKind(fKind);
|
||||
if(options.length > 0){
|
||||
for(int i = 0; i < options.length; i++){
|
||||
IOption option = options[i];
|
||||
List list = (List)option.getValue();
|
||||
if(list.size() != 0){
|
||||
if(set == null)
|
||||
set = new HashSet();
|
||||
set.addAll(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
private DiscoveredEntry[] getUserDiscoveredEntries(){
|
||||
IOption options[] = fLangData.getOptionsForKind(fKind);
|
||||
if(options.length > 0){
|
||||
|
@ -403,7 +459,7 @@ public class EntryStorage {
|
|||
|
||||
}
|
||||
|
||||
private String[] macroNameValueFromValue(String value){
|
||||
public static String[] macroNameValueFromValue(String value){
|
||||
String nv[] = new String[2];
|
||||
int index = value.indexOf('=');
|
||||
if(index > 0){
|
||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.managedbuilder.internal.dataprovider;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -30,7 +31,9 @@ public class SettingsSet {
|
|||
private int fFlagsToSet;
|
||||
private int fFlagsToClear;
|
||||
private boolean fIsReadOnly;
|
||||
private boolean fIsOverrideSupported;
|
||||
private EntryListMap fEntries;
|
||||
HashSet fOverrideSet;
|
||||
|
||||
private SettingLevel(){
|
||||
fEntries = new EntryListMap();
|
||||
|
@ -43,10 +46,22 @@ public class SettingsSet {
|
|||
public void setReadOnly(boolean readOnly){
|
||||
fIsReadOnly = readOnly;
|
||||
}
|
||||
|
||||
public boolean isOverrideSupported(){
|
||||
return fIsOverrideSupported;
|
||||
}
|
||||
|
||||
public void setOverrideSupported(boolean supported){
|
||||
fIsOverrideSupported = supported;
|
||||
}
|
||||
|
||||
public void setFlagsToSet(int flags){
|
||||
fFlagsToSet = flags;
|
||||
}
|
||||
|
||||
public boolean containsOverrideInfo(){
|
||||
return fOverrideSet != null;
|
||||
}
|
||||
|
||||
public void setFlagsToClear(int flags){
|
||||
fFlagsToClear = flags;
|
||||
|
@ -60,13 +75,37 @@ public class SettingsSet {
|
|||
return fFlagsToClear;
|
||||
}
|
||||
|
||||
public Set getOverrideSet(){
|
||||
if(fOverrideSet != null)
|
||||
return (HashSet)fOverrideSet.clone();
|
||||
return new HashSet();
|
||||
}
|
||||
|
||||
public void addEntry(ICLanguageSettingEntry entry){
|
||||
entry = CDataUtil.createEntry(entry, fFlagsToSet, fFlagsToClear);
|
||||
fEntries.addEntryInfo(new EntryInfo(entry));
|
||||
}
|
||||
|
||||
public void addOverrideName(String name){
|
||||
if(fOverrideSet == null)
|
||||
fOverrideSet = new HashSet();
|
||||
|
||||
fOverrideSet.add(name);
|
||||
}
|
||||
|
||||
public void removeOverrideName(String name){
|
||||
if(fOverrideSet == null)
|
||||
return;
|
||||
|
||||
fOverrideSet.remove(name);
|
||||
|
||||
if(fOverrideSet.size() == 0)
|
||||
fOverrideSet = null;
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
fEntries.clear();
|
||||
fOverrideSet = null;
|
||||
}
|
||||
|
||||
EntryInfo[] getInfos(){
|
||||
|
@ -83,8 +122,6 @@ public class SettingsSet {
|
|||
|
||||
return (ICLanguageSettingEntry[])list.toArray(new ICLanguageSettingEntry[list.size()]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SettingsSet(int num){
|
||||
|
@ -99,7 +136,11 @@ public class SettingsSet {
|
|||
}
|
||||
|
||||
public void adjustOverrideState(){
|
||||
Set set = new HashSet();
|
||||
int dNum = getDefaultLevelNum();
|
||||
SettingLevel dLevel = fLevels[dNum];
|
||||
|
||||
|
||||
Set set = dLevel.isOverrideSupported() ? dLevel.getOverrideSet() : new HashSet();
|
||||
for(int i = 0; i < fLevels.length; i++){
|
||||
adjustOverrideState(fLevels[i], set);
|
||||
}
|
||||
|
@ -110,7 +151,7 @@ public class SettingsSet {
|
|||
EntryInfo info;
|
||||
for(int i = 0; i < infos.length; i++){
|
||||
info = infos[i];
|
||||
if(overridenSet.add(info.getNameKey())){
|
||||
if(overridenSet.add(info.getEntry().getName())){
|
||||
info.makeOverridden(false);
|
||||
} else {
|
||||
info.makeOverridden(true);
|
||||
|
@ -162,7 +203,8 @@ public class SettingsSet {
|
|||
}
|
||||
|
||||
public void applyEntries(ICLanguageSettingEntry[] entries){
|
||||
Map map = getEntryLevelMap(WRITABLE | READ_ONLY);
|
||||
HashMap map = getEntryLevelMap(WRITABLE | READ_ONLY);
|
||||
Map mapCopy = (HashMap)map.clone();
|
||||
|
||||
for(int i = 0; i < fLevels.length; i++){
|
||||
if(!fLevels[i].isReadOnly()){
|
||||
|
@ -180,18 +222,35 @@ public class SettingsSet {
|
|||
for(int i = 0; i < entries.length; i++){
|
||||
entry = entries[i];
|
||||
key = new EntryNameKey(entry);
|
||||
levelInteger = (Integer)map.get(key);
|
||||
Object[] o = (Object[])map.get(key);
|
||||
|
||||
if(o != null){
|
||||
mapCopy.remove(key);
|
||||
levelInteger = (Integer)o[0];
|
||||
} else {
|
||||
levelInteger = null;
|
||||
}
|
||||
|
||||
levelNum = levelInteger != null ? levelInteger.intValue() : defaultLevel;
|
||||
level = fLevels[levelNum];
|
||||
if(!level.isReadOnly())
|
||||
level.addEntry(entry);
|
||||
}
|
||||
|
||||
level = fLevels[defaultLevel];
|
||||
if(level.isOverrideSupported() && !mapCopy.isEmpty()){
|
||||
String str;
|
||||
for(Iterator iter = mapCopy.keySet().iterator(); iter.hasNext();){
|
||||
str = ((EntryNameKey)iter.next()).getEntry().getName();
|
||||
if(str != null)
|
||||
level.addOverrideName(str);
|
||||
}
|
||||
}
|
||||
adjustOverrideState();
|
||||
}
|
||||
|
||||
public Map getEntryLevelMap(int types){
|
||||
Map map = new HashMap();
|
||||
public HashMap getEntryLevelMap(int types){
|
||||
HashMap map = new HashMap();
|
||||
for(int i = 0; i < fLevels.length; i++){
|
||||
if(isCompatible(fLevels[i], types))
|
||||
addLevelInfoToMap(fLevels[i], i, map);
|
||||
|
@ -209,7 +268,7 @@ public class SettingsSet {
|
|||
info = infos[i];
|
||||
key = info.getNameKey();
|
||||
if(!map.containsKey(key))
|
||||
map.put(key, new Integer(l));
|
||||
map.put(key, new Object[]{new Integer(l), info.getEntry()});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,7 +116,13 @@ public class CheckOptionExpression implements IBooleanExpression {
|
|||
case IOption.INCLUDE_FILES:
|
||||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:{
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:{
|
||||
List list = (List)option.getValue();
|
||||
String listValue = provider.convertStringListToString((String[])list.toArray(new String[list.size()]),delimiter);
|
||||
|
||||
|
@ -175,7 +181,13 @@ public class CheckOptionExpression implements IBooleanExpression {
|
|||
case IOption.INCLUDE_FILES:
|
||||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:{
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:{
|
||||
List list = (List)option.getValue();
|
||||
String listValue[] = (String[])list.toArray(new String[list.size()]);
|
||||
|
||||
|
|
|
@ -313,6 +313,12 @@ public class OptionEnablementExpression extends AndExpression{
|
|||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
//TODO: add String list value support
|
||||
adjusted = false;
|
||||
break;
|
||||
|
|
|
@ -923,6 +923,30 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
|
|||
fType = IBuildMacro.VALUE_PATH_FILE_LIST;
|
||||
fStringListValue = option.getBasicStringListValue();
|
||||
break;
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
fType = IBuildMacro.VALUE_PATH_DIR_LIST;
|
||||
fStringListValue = option.getBasicStringListValue();
|
||||
break;
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
fType = IBuildMacro.VALUE_TEXT_LIST;
|
||||
fStringListValue = option.getBasicStringListValue();
|
||||
break;
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
fType = IBuildMacro.VALUE_PATH_FILE_LIST;
|
||||
fStringListValue = option.getBasicStringListValue();
|
||||
break;
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
fType = IBuildMacro.VALUE_PATH_DIR_LIST;
|
||||
fStringListValue = option.getBasicStringListValue();
|
||||
break;
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
fType = IBuildMacro.VALUE_PATH_FILE_LIST;
|
||||
fStringListValue = option.getBasicStringListValue();
|
||||
break;
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
fType = IBuildMacro.VALUE_PATH_FILE_LIST;
|
||||
fStringListValue = option.getBasicStringListValue();
|
||||
break;
|
||||
}
|
||||
if(fStringValue != null)
|
||||
fStringValue = CdtVariableResolver.resolveToString(fStringValue,new IncludeDefaultsSubstitutor(fParentOptionContextData));
|
||||
|
|
|
@ -51,7 +51,7 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
|
|||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ResourceInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
|
||||
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
|
||||
import org.eclipse.cdt.managedbuilder.internal.macros.FileContextData;
|
||||
import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
|
||||
|
@ -2975,6 +2975,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
|
|||
optType == IOption.LIBRARY_PATHS ||
|
||||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES) {
|
||||
//TODO: do we need to do anything with undefs here?
|
||||
// Note that the path(s) must be translated from project relative
|
||||
// to top build directory relative
|
||||
String[] paths = new String[allRes.size()];
|
||||
|
@ -3135,6 +3136,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
|
|||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES) {
|
||||
outputList = (List)option.getValue();
|
||||
((Tool)tool).filterValues(optType, outputList);
|
||||
// Add outputPrefix to each if necessary
|
||||
if (outputPrefix.length() > 0) {
|
||||
for (int j=0; j<outputList.size(); j++) {
|
||||
|
|
|
@ -201,6 +201,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
|||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES) {
|
||||
inputs = (List)option.getValue();
|
||||
tool.filterValues(optType, inputs);
|
||||
}
|
||||
for (int j=0; j<inputs.size(); j++) {
|
||||
String inputName = (String)inputs.get(j);
|
||||
|
@ -385,6 +386,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
|||
optType == IOption.LIBRARY_PATHS ||
|
||||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES) {
|
||||
//TODO: do we need to do anything with undefs here?
|
||||
// Mote that when using the enumerated inputs, the path(s) must be translated from project relative
|
||||
// to top build directory relative
|
||||
String[] paths = new String[itEnumeratedInputs.size()];
|
||||
|
@ -539,6 +541,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
|||
optType == IOption.LIBRARY_FILES ||
|
||||
optType == IOption.MACRO_FILES) {
|
||||
outputs = (List)option.getValue();
|
||||
tool.filterValues(optType, outputs);
|
||||
// Add outputPrefix to each if necessary
|
||||
if (outputPrefix.length() > 0) {
|
||||
for (int j=0; j<outputs.size(); j++) {
|
||||
|
|
|
@ -160,7 +160,12 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
|||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:
|
||||
{
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES: {
|
||||
fieldEditor = new FileListControlFieldEditor(optId, opt.getName(), opt.getToolTip(), fieldEditorParent, opt.getBrowseType());
|
||||
} break;
|
||||
|
||||
|
@ -268,6 +273,12 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
|||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
String[] listVal = (String[])((List)clonedOption.getValue()).toArray(new String[0]);
|
||||
setOption = ManagedBuildManager.setOption(realCfg, realHolder, realOption, listVal);
|
||||
|
||||
|
@ -412,6 +423,12 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
|||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
if(fe instanceof FileListControlFieldEditor){
|
||||
String val[] =((FileListControlFieldEditor)fe).getStringListValue();
|
||||
ManagedBuildManager.setOption(fInfo, changedHolder, changedOption, val);
|
||||
|
|
|
@ -330,6 +330,12 @@ public class BuildToolSettingUI extends AbstractToolSettingUI {
|
|||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
if (opt.getCommand() != null
|
||||
&& optionValue.startsWith(opt
|
||||
.getCommand())) {
|
||||
|
|
|
@ -289,6 +289,12 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
|
|||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
if(value instanceof String){
|
||||
String val[] = parseString((String)value);
|
||||
newOption = rcInfo.setOption(holder,option,val);
|
||||
|
|
|
@ -486,6 +486,12 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
case IOption.LIBRARY_PATHS:
|
||||
case IOption.LIBRARY_FILES:
|
||||
case IOption.MACRO_FILES:
|
||||
case IOption.UNDEF_INCLUDE_PATH:
|
||||
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
|
||||
case IOption.UNDEF_INCLUDE_FILES:
|
||||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
String[] data = (String[])((List)option.getValue()).toArray(new String[0]);
|
||||
setOption = ManagedBuildManager.setOption(fInfo, holder, option, data);
|
||||
break;
|
||||
|
|
|
@ -62,6 +62,11 @@ public class EntryStore {
|
|||
|
||||
return (ICLanguageSettingEntry[])result.toArray(new ICLanguageSettingEntry[result.size()]);
|
||||
}
|
||||
|
||||
public boolean containsEntries(int kind){
|
||||
List list = getEntriesList(kind);
|
||||
return list != null && list.size() != 0;
|
||||
}
|
||||
|
||||
public ICLanguageSettingEntry[] getEntries(int kind){
|
||||
List list = getEntriesList(kind);
|
||||
|
|
|
@ -290,11 +290,13 @@ public class CLanguageSetting extends CDataProxy implements
|
|||
EntryStore store = new EntryStore();
|
||||
// KindBasedStore nameSetStore = new KindBasedStore();
|
||||
int eKind;
|
||||
for(Iterator iter = list.iterator(); iter.hasNext();){
|
||||
ICLanguageSettingEntry entry = (ICLanguageSettingEntry)iter.next();
|
||||
eKind = entry.getKind();
|
||||
if((kind & eKind) != 0 && (data.getSupportedEntryKinds() & eKind) != 0){
|
||||
store.addEntry(entry);
|
||||
if(list != null){
|
||||
for(Iterator iter = list.iterator(); iter.hasNext();){
|
||||
ICLanguageSettingEntry entry = (ICLanguageSettingEntry)iter.next();
|
||||
eKind = entry.getKind();
|
||||
if((kind & eKind) != 0 && (data.getSupportedEntryKinds() & eKind) != 0){
|
||||
store.addEntry(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -307,7 +309,7 @@ public class CLanguageSetting extends CDataProxy implements
|
|||
|
||||
// int kinds[] = KindBasedStore.getSupportedKinds();
|
||||
for(int i = 0; i < kinds.length; i++){
|
||||
ICLanguageSettingEntry sortedEntries[] = store.getEntries(kinds[i]);
|
||||
ICLanguageSettingEntry sortedEntries[] = store.containsEntries(kinds[i]) ? store.getEntries(kinds[i]) : null;
|
||||
if((kind & kinds[i]) != 0)
|
||||
data.setEntries(kinds[i], sortedEntries);
|
||||
}
|
||||
|
|
|
@ -171,8 +171,8 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
boolean canDelete = canEdit;
|
||||
if (canExport) {
|
||||
ICLanguageSettingEntry ent = (ICLanguageSettingEntry)(table.getItem(index).getData());
|
||||
if (ent.isReadOnly()) canEdit = false;
|
||||
if (ent.isBuiltIn() || ent.isReadOnly()) canDelete = false;
|
||||
if (ent.isBuiltIn() || ent.isReadOnly()) canEdit = false;
|
||||
if (/*ent.isBuiltIn() || */ent.isReadOnly()) canDelete = false;
|
||||
}
|
||||
boolean canMoveUp = canDelete && index > 0;
|
||||
boolean canMoveDown = canDelete && (index < table.getItemCount() - 1);
|
||||
|
@ -346,7 +346,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
case 2: // delete
|
||||
if (n == -1) return;
|
||||
old = (ICLanguageSettingEntry)(table.getItem(n).getData());
|
||||
if (old.isReadOnly() || old.isBuiltIn()) return;
|
||||
if (old.isReadOnly() /*|| old.isBuiltIn()*/) return;
|
||||
incs.remove(old);
|
||||
lang.setSettingEntries(getKind(), incs);
|
||||
update();
|
||||
|
@ -409,7 +409,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
}
|
||||
}
|
||||
protected void performDefaults() {
|
||||
lang.setSettingEntries(getKind(), new ArrayList());
|
||||
lang.setSettingEntries(getKind(), (List)null);
|
||||
updateData(this.getResDesc());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue