mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
CDT variables support for source and output entries
This commit is contained in:
parent
da91fe7a86
commit
f6ab39e0ce
23 changed files with 149 additions and 80 deletions
|
@ -464,6 +464,11 @@ class MockConfig implements ICConfigurationDescription {
|
|||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public ICSourceEntry[] getResolvedSourceEntries() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.Arrays;
|
|||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public abstract class ACExclusionFilterEntry extends ACLanguageSettingPathEntry implements ICExclusionPatternPathEntry {
|
||||
public abstract class ACExclusionFilterEntry extends ACPathEntry implements ICExclusionPatternPathEntry {
|
||||
private IPath[] exclusionPatterns;
|
||||
private final static char[][] UNINIT_PATTERNS = new char[][] { "Non-initialized yet".toCharArray() }; //$NON-NLS-1$
|
||||
char[][]fullCharExclusionPatterns = UNINIT_PATTERNS;
|
||||
|
|
|
@ -15,17 +15,17 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
|||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
public abstract class ACLanguageSettingPathEntry extends ACLanguageSettingEntry
|
||||
implements ICLanguageSettingPathEntry {
|
||||
IPath fFullPath;
|
||||
IPath fLocation;
|
||||
public abstract class ACPathEntry extends ACSettingEntry
|
||||
implements ICPathEntry {
|
||||
// IPath fFullPath;
|
||||
// IPath fLocation;
|
||||
// private IPath fPath;
|
||||
|
||||
public ACLanguageSettingPathEntry(IResource rc, int flags) {
|
||||
public ACPathEntry(IResource rc, int flags) {
|
||||
super(rc.getFullPath().toString(), flags | RESOLVED | VALUE_WORKSPACE_PATH);
|
||||
fFullPath = rc.getFullPath();
|
||||
// fFullPath = rc.getFullPath();
|
||||
// fPath = rc.getFullPath();
|
||||
fLocation = rc.getLocation();
|
||||
// fLocation = rc.getLocation();
|
||||
}
|
||||
|
||||
/* public ACLanguageSettingPathEntry(IPath fullPath, IPath location, int flags) {
|
||||
|
@ -34,12 +34,12 @@ public abstract class ACLanguageSettingPathEntry extends ACLanguageSettingEntry
|
|||
fFullPath = fullPath;
|
||||
}
|
||||
*/
|
||||
public ACLanguageSettingPathEntry(String value, int flags) {
|
||||
public ACPathEntry(String value, int flags) {
|
||||
super(value, flags);
|
||||
}
|
||||
|
||||
public ACLanguageSettingPathEntry(IPath path, int flags) {
|
||||
super(path.toString(), flags | RESOLVED);
|
||||
public ACPathEntry(IPath path, int flags) {
|
||||
super(path.toString(), flags /*| RESOLVED*/);
|
||||
// fPath = path;
|
||||
// if(isValueWorkspacePath())
|
||||
// fFullPath = path;
|
||||
|
@ -48,15 +48,13 @@ public abstract class ACLanguageSettingPathEntry extends ACLanguageSettingEntry
|
|||
}
|
||||
|
||||
public IPath getFullPath() {
|
||||
if(fFullPath == null && isResolved()){
|
||||
if(isValueWorkspacePath()){
|
||||
fFullPath = new Path(getValue());
|
||||
} else {
|
||||
fLocation = new Path(getValue());
|
||||
fFullPath = fullPathForLocation(fLocation);
|
||||
}
|
||||
if(isValueWorkspacePath())
|
||||
return new Path(getValue());
|
||||
if(isResolved()) {
|
||||
IPath path = new Path(getValue());
|
||||
return fullPathForLocation(path);
|
||||
}
|
||||
return fFullPath;
|
||||
return null;
|
||||
}
|
||||
|
||||
protected IPath fullPathForLocation(IPath location){
|
||||
|
@ -72,17 +70,15 @@ public abstract class ACLanguageSettingPathEntry extends ACLanguageSettingEntry
|
|||
protected abstract boolean isFile();
|
||||
|
||||
public IPath getLocation() {
|
||||
if(fLocation == null && isResolved()){
|
||||
if(isValueWorkspacePath()){
|
||||
fFullPath = new Path(getValue());
|
||||
IResource rc = ResourcesPlugin.getWorkspace().getRoot().findMember(fFullPath);
|
||||
if(rc != null)
|
||||
fLocation = rc.getLocation();
|
||||
} else {
|
||||
fLocation = new Path(getValue());
|
||||
}
|
||||
if(!isValueWorkspacePath())
|
||||
return new Path(getValue());
|
||||
if(isResolved()){
|
||||
IPath path = new Path(getValue());
|
||||
IResource rc = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
|
||||
if(rc != null)
|
||||
return rc.getLocation();
|
||||
}
|
||||
return fLocation;
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isValueWorkspacePath() {
|
|
@ -12,11 +12,11 @@ package org.eclipse.cdt.core.settings.model;
|
|||
|
||||
|
||||
|
||||
public abstract class ACLanguageSettingEntry implements ICLanguageSettingEntry {
|
||||
public abstract class ACSettingEntry implements ICSettingEntry {
|
||||
int fFlags;
|
||||
String fName;
|
||||
|
||||
public ACLanguageSettingEntry(String name, int flags){
|
||||
public ACSettingEntry(String name, int flags){
|
||||
fName = name;
|
||||
fFlags = flags;
|
||||
}
|
||||
|
@ -51,10 +51,10 @@ public abstract class ACLanguageSettingEntry implements ICLanguageSettingEntry {
|
|||
if(other == this)
|
||||
return true;
|
||||
|
||||
if(!(other instanceof ACLanguageSettingEntry))
|
||||
if(!(other instanceof ACSettingEntry))
|
||||
return false;
|
||||
|
||||
ACLanguageSettingEntry e = (ACLanguageSettingEntry)other;
|
||||
ACSettingEntry e = (ACSettingEntry)other;
|
||||
|
||||
if(getKind() != e.getKind())
|
||||
return false;
|
||||
|
@ -88,10 +88,10 @@ public abstract class ACLanguageSettingEntry implements ICLanguageSettingEntry {
|
|||
if(entry == this)
|
||||
return true;
|
||||
|
||||
if(!(entry instanceof ACLanguageSettingEntry))
|
||||
if(!(entry instanceof ACSettingEntry))
|
||||
return false;
|
||||
|
||||
ACLanguageSettingEntry e = (ACLanguageSettingEntry)entry;
|
||||
ACSettingEntry e = (ACSettingEntry)entry;
|
||||
|
||||
if(getKind() != e.getKind())
|
||||
return false;
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.core.settings.model;
|
|||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public final class CIncludeFileEntry extends ACLanguageSettingPathEntry implements
|
||||
public final class CIncludeFileEntry extends ACPathEntry implements
|
||||
ICIncludeFileEntry {
|
||||
|
||||
public CIncludeFileEntry(String value, int flags) {
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.core.settings.model;
|
|||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public final class CIncludePathEntry extends ACLanguageSettingPathEntry implements ICIncludePathEntry{
|
||||
public final class CIncludePathEntry extends ACPathEntry implements ICIncludePathEntry{
|
||||
|
||||
public CIncludePathEntry(String value, int flags) {
|
||||
super(value, flags);
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.core.settings.model;
|
|||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public final class CLibraryFileEntry extends ACLanguageSettingPathEntry implements
|
||||
public final class CLibraryFileEntry extends ACPathEntry implements
|
||||
ICLibraryFileEntry {
|
||||
|
||||
public CLibraryFileEntry(String value, int flags) {
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.core.settings.model;
|
|||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public final class CLibraryPathEntry extends ACLanguageSettingPathEntry implements
|
||||
public final class CLibraryPathEntry extends ACPathEntry implements
|
||||
ICLibraryPathEntry {
|
||||
|
||||
public CLibraryPathEntry(String value, int flags) {
|
||||
|
|
|
@ -12,7 +12,7 @@ package org.eclipse.cdt.core.settings.model;
|
|||
|
||||
|
||||
|
||||
public final class CMacroEntry extends ACLanguageSettingEntry implements ICMacroEntry{
|
||||
public final class CMacroEntry extends ACSettingEntry implements ICMacroEntry{
|
||||
private String fValue;
|
||||
|
||||
public CMacroEntry(String name, String value, int flags) {
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.core.settings.model;
|
|||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public final class CMacroFileEntry extends ACLanguageSettingPathEntry implements
|
||||
public final class CMacroFileEntry extends ACPathEntry implements
|
||||
ICMacroFileEntry {
|
||||
|
||||
public CMacroFileEntry(String value, int flags) {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
package org.eclipse.cdt.core.settings.model;
|
||||
|
||||
import org.eclipse.cdt.core.envvar.IEnvironmentContributor;
|
||||
import org.eclipse.cdt.core.model.IOutputEntry;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public interface ICBuildSetting extends ICSettingObject {
|
||||
|
@ -21,6 +20,8 @@ public interface ICBuildSetting extends ICSettingObject {
|
|||
|
||||
ICOutputEntry[] getOutputDirectories();
|
||||
|
||||
ICOutputEntry[] getResolvedOutputDirectories();
|
||||
|
||||
void setOutputDirectories(ICOutputEntry[] entries);
|
||||
|
||||
String[] getErrorParserIDs();
|
||||
|
@ -28,7 +29,4 @@ public interface ICBuildSetting extends ICSettingObject {
|
|||
void setErrorParserIDs(String[] ids);
|
||||
|
||||
IEnvironmentContributor getBuildEnvironmentContributor();
|
||||
// IEnvironment getBuildEnvironment();
|
||||
|
||||
// void setBuildEnvironment(IEnvironment environment);
|
||||
}
|
||||
|
|
|
@ -198,6 +198,8 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
|
|||
* @return
|
||||
*/
|
||||
ICSourceEntry[] getSourceEntries();
|
||||
|
||||
ICSourceEntry[] getResolvedSourceEntries();
|
||||
|
||||
/**
|
||||
* sets the source entries for this configuration
|
||||
|
|
|
@ -10,8 +10,5 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.settings.model;
|
||||
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
|
||||
public interface ICLanguageSettingPathEntry extends ICLanguageSettingEntry, ICPathEntry {
|
||||
}
|
||||
|
|
|
@ -39,7 +39,9 @@ import org.eclipse.cdt.core.settings.model.CMacroFileEntry;
|
|||
import org.eclipse.cdt.core.settings.model.COutputEntry;
|
||||
import org.eclipse.cdt.core.settings.model.CSourceEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICExclusionPatternPathEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICOutputEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICSettingBase;
|
||||
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICSourceEntry;
|
||||
|
@ -123,23 +125,53 @@ public class CDataUtil {
|
|||
}
|
||||
return (String[])list.toArray(new String[list.size()]);
|
||||
}
|
||||
|
||||
public static ICLanguageSettingEntry[] resolveEntries(ICLanguageSettingEntry entries[], ICConfigurationDescription cfgDes){
|
||||
|
||||
public static ICSettingEntry[] resolveEntries(ICSettingEntry entries[], ICConfigurationDescription cfgDes){
|
||||
if(entries.length == 0)
|
||||
return entries;
|
||||
|
||||
ICLanguageSettingEntry[] resolved = new ICLanguageSettingEntry[entries.length];
|
||||
ICSettingEntry[] resolved = new ICSettingEntry[entries.length];
|
||||
ICdtVariableManager mngr = CCorePlugin.getDefault().getCdtVariableManager();
|
||||
|
||||
for(int i = 0; i < entries.length; i++){
|
||||
ICLanguageSettingEntry entry = entries[i];
|
||||
ICSettingEntry entry = entries[i];
|
||||
resolved[i] = createResolvedEntry(entry, cfgDes, mngr);
|
||||
}
|
||||
|
||||
return resolved;
|
||||
}
|
||||
|
||||
private static ICLanguageSettingEntry createResolvedEntry(ICLanguageSettingEntry entry, ICConfigurationDescription cfg, ICdtVariableManager mngr){
|
||||
|
||||
public static ICLanguageSettingEntry[] resolveEntries(ICLanguageSettingEntry entries[], ICConfigurationDescription cfgDes){
|
||||
if(entries.length == 0)
|
||||
return entries;
|
||||
|
||||
ICSettingEntry[] resolved = resolveEntries((ICSettingEntry[])entries, cfgDes);
|
||||
ICLanguageSettingEntry[] resolvedLangEntries = new ICLanguageSettingEntry[resolved.length];
|
||||
System.arraycopy(resolved, 0, resolvedLangEntries, 0, resolved.length);
|
||||
return resolvedLangEntries;
|
||||
}
|
||||
|
||||
public static ICSourceEntry[] resolveEntries(ICSourceEntry entries[], ICConfigurationDescription cfgDes){
|
||||
if(entries.length == 0)
|
||||
return entries;
|
||||
|
||||
ICSettingEntry[] resolved = resolveEntries((ICSettingEntry[])entries, cfgDes);
|
||||
ICSourceEntry[] resolvedLangEntries = new ICSourceEntry[resolved.length];
|
||||
System.arraycopy(resolved, 0, resolvedLangEntries, 0, resolved.length);
|
||||
return resolvedLangEntries;
|
||||
}
|
||||
|
||||
public static ICOutputEntry[] resolveEntries(ICOutputEntry entries[], ICConfigurationDescription cfgDes){
|
||||
if(entries.length == 0)
|
||||
return entries;
|
||||
|
||||
ICSettingEntry[] resolved = resolveEntries((ICSettingEntry[])entries, cfgDes);
|
||||
ICOutputEntry[] resolvedLangEntries = new ICOutputEntry[resolved.length];
|
||||
System.arraycopy(resolved, 0, resolvedLangEntries, 0, resolved.length);
|
||||
return resolvedLangEntries;
|
||||
}
|
||||
|
||||
private static ICSettingEntry createResolvedEntry(ICSettingEntry entry, ICConfigurationDescription cfg, ICdtVariableManager mngr){
|
||||
if(entry.isResolved())
|
||||
return entry;
|
||||
|
||||
|
@ -150,28 +182,36 @@ public class CDataUtil {
|
|||
CCorePlugin.log(e);
|
||||
}
|
||||
|
||||
String value = null;
|
||||
IPath[] exclusionFilters = null;
|
||||
|
||||
switch (entry.getKind()) {
|
||||
case ICLanguageSettingEntry.INCLUDE_PATH:
|
||||
return new CIncludePathEntry(name, ICSettingEntry.RESOLVED | entry.getFlags());
|
||||
case ICLanguageSettingEntry.INCLUDE_FILE:
|
||||
return new CIncludeFileEntry(name, ICSettingEntry.RESOLVED | entry.getFlags());
|
||||
case ICLanguageSettingEntry.MACRO:
|
||||
String value = entry.getValue();
|
||||
case ICSettingEntry.MACRO:
|
||||
value = entry.getValue();
|
||||
try {
|
||||
value = mngr.resolveValue(value, "", " ", cfg); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} catch (CdtVariableException e) {
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
return new CMacroEntry(name, value, ICSettingEntry.RESOLVED | entry.getFlags());
|
||||
case ICLanguageSettingEntry.MACRO_FILE:
|
||||
return new CMacroFileEntry(name, ICSettingEntry.RESOLVED | entry.getFlags());
|
||||
case ICLanguageSettingEntry.LIBRARY_PATH:
|
||||
return new CLibraryPathEntry(name, ICSettingEntry.RESOLVED | entry.getFlags());
|
||||
case ICLanguageSettingEntry.LIBRARY_FILE:
|
||||
return new CLibraryFileEntry(name, ICSettingEntry.RESOLVED | entry.getFlags());
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
break;
|
||||
case ICSettingEntry.SOURCE_PATH:
|
||||
case ICSettingEntry.OUTPUT_PATH:
|
||||
exclusionFilters = ((ICExclusionPatternPathEntry)entry).getExclusionPatterns();
|
||||
for(int i = 0; i < exclusionFilters.length; i++){
|
||||
String exclString = exclusionFilters[i].toString();
|
||||
try {
|
||||
exclString = mngr.resolveValue(exclString, "", " ", cfg); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} catch (CdtVariableException e) {
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
exclusionFilters[i] = new Path(exclString);
|
||||
}
|
||||
break;
|
||||
// default:
|
||||
// throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
return createEntry(entry.getKind(), name, value, exclusionFilters, entry.getFlags() | ICSettingEntry.RESOLVED);
|
||||
}
|
||||
|
||||
public static ICLanguageSettingEntry createEntry(ICLanguageSettingEntry entry, int flagsToAdd, int flafsToClear){
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.settings.model.util;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.ACLanguageSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ACSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
|
||||
|
||||
public class EntryContentsKey {
|
||||
|
@ -30,7 +30,7 @@ public class EntryContentsKey {
|
|||
}
|
||||
|
||||
public int hashCode() {
|
||||
return ((ACLanguageSettingEntry)fEntry).codeForContentsKey();
|
||||
return ((ACSettingEntry)fEntry).codeForContentsKey();
|
||||
}
|
||||
|
||||
public ICSettingEntry getEntry(){
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.settings.model.util;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.ACLanguageSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ACSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
|
||||
|
||||
public class EntryNameKey {
|
||||
|
@ -30,7 +30,7 @@ public class EntryNameKey {
|
|||
}
|
||||
|
||||
public int hashCode() {
|
||||
return ((ACLanguageSettingEntry)fEntry).codeForNameKey();
|
||||
return ((ACSettingEntry)fEntry).codeForNameKey();
|
||||
}
|
||||
|
||||
public ICSettingEntry getEntry(){
|
||||
|
|
|
@ -74,7 +74,7 @@ public class CContainerInfo extends OpenableInfo {
|
|||
if(des != null){
|
||||
ICConfigurationDescription cfg = des.getIndexConfiguration();
|
||||
if(cfg != null){
|
||||
entries = cfg.getSourceEntries();
|
||||
entries = cfg.getResolvedSourceEntries();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -607,7 +607,7 @@ public class CProject extends Openable implements ICProject {
|
|||
if(des != null){
|
||||
ICConfigurationDescription cfg = des.getIndexConfiguration();
|
||||
if(cfg != null)
|
||||
entries = cfg.getSourceEntries();
|
||||
entries = cfg.getResolvedSourceEntries();
|
||||
}
|
||||
|
||||
if(entries != null){
|
||||
|
|
|
@ -92,7 +92,7 @@ class CProjectInfo extends OpenableInfo {
|
|||
if(des != null){
|
||||
ICConfigurationDescription cfg = des.getIndexConfiguration();
|
||||
if(cfg != null){
|
||||
entries = cfg.getSourceEntries();
|
||||
entries = cfg.getResolvedSourceEntries();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
package org.eclipse.cdt.internal.core.settings.model;
|
||||
|
||||
import org.eclipse.cdt.core.envvar.IEnvironmentContributor;
|
||||
import org.eclipse.cdt.core.model.IOutputEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICBuildSetting;
|
||||
import org.eclipse.cdt.core.settings.model.ICOutputEntry;
|
||||
import org.eclipse.cdt.core.settings.model.ICSettingBase;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CBuildData;
|
||||
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public class CBuildSetting extends CDataProxy implements ICBuildSetting {
|
||||
|
@ -66,4 +66,9 @@ public class CBuildSetting extends CDataProxy implements ICBuildSetting {
|
|||
CBuildData data = getBuildData(false);
|
||||
return data.getBuildEnvironmentContributor();
|
||||
}
|
||||
|
||||
public ICOutputEntry[] getResolvedOutputDirectories() {
|
||||
ICOutputEntry[] entries = getOutputDirectories();
|
||||
return CDataUtil.resolveEntries(entries, getConfiguration());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.core.settings.model.ICOutputEntry;
|
|||
import org.eclipse.cdt.core.settings.model.ICSettingContainer;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CBuildData;
|
||||
import org.eclipse.cdt.core.settings.model.extension.impl.CDefaultBuildData;
|
||||
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
||||
import org.eclipse.cdt.internal.core.envvar.EnvironmentVariableManager;
|
||||
import org.eclipse.cdt.utils.envvar.StorableEnvironment;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
@ -26,6 +27,7 @@ public class CBuildSettingCache extends CDefaultBuildData implements
|
|||
private CConfigurationDescriptionCache fCfgCache;
|
||||
private StorableEnvironment fEnvironment;
|
||||
private StorableEnvironment fResolvedEnvironment;
|
||||
private ICOutputEntry[] fResolvedOutputEntries;
|
||||
|
||||
CBuildSettingCache(CBuildData base, CConfigurationDescriptionCache cfgCache){
|
||||
super(base.getId(), base);
|
||||
|
@ -86,5 +88,13 @@ public class CBuildSettingCache extends CDefaultBuildData implements
|
|||
public IEnvironmentContributor getBuildEnvironmentContributor() {
|
||||
return fCfgCache.getConfigurationData().getBuildData().getBuildEnvironmentContributor();
|
||||
}
|
||||
|
||||
public ICOutputEntry[] getResolvedOutputDirectories() {
|
||||
if(fResolvedOutputEntries == null){
|
||||
ICOutputEntry[] entries = getOutputDirectories();
|
||||
return CDataUtil.resolveEntries(entries, getConfiguration());
|
||||
}
|
||||
return fResolvedOutputEntries;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -747,7 +747,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
|
|||
// if(path.segmentCount() == 0)
|
||||
// return false;
|
||||
IProject project = fIsPreference ? null : getProjectDescription().getProject();
|
||||
ICSourceEntry[] entries = getSourceEntries();
|
||||
ICSourceEntry[] entries = getResolvedSourceEntries();
|
||||
if(project != null)
|
||||
path = project.getFullPath().append(path);
|
||||
return CDataUtil.isExcluded(path, entries);
|
||||
|
@ -771,16 +771,18 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
|
|||
if(roDes != null){
|
||||
ICConfigurationDescription roCfg = roDes.getConfigurationById(getId());
|
||||
if(roCfg != null){
|
||||
newEntries = roCfg.getSourceEntries();
|
||||
newEntries = roCfg.getResolvedSourceEntries();
|
||||
if(CDataUtil.isExcluded(path, newEntries) != exclude)
|
||||
newEntries = null;
|
||||
else
|
||||
newEntries = roCfg.getSourceEntries();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(newEntries == null){
|
||||
newEntries = CDataUtil.setExcluded(path, exclude, getSourceEntries());
|
||||
newEntries = CDataUtil.setExcluded(path, exclude, getResolvedSourceEntries());
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -814,4 +816,9 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
|
|||
CCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
public ICSourceEntry[] getResolvedSourceEntries() {
|
||||
ICSourceEntry[] entries = getSourceEntries();
|
||||
return CDataUtil.resolveEntries(entries, this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
|
|||
private boolean fInitializing;
|
||||
private ICConfigurationDescription fBaseDescription;
|
||||
private CSettingEntryFactory fSettingsFactory;
|
||||
private ICSourceEntry[] fResolvedSourceEntries;
|
||||
|
||||
CConfigurationDescriptionCache(ICStorageElement storage, CProjectDescription parent) throws CoreException{
|
||||
super(null);
|
||||
|
@ -488,4 +489,12 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
|
|||
throw ExceptionFactory.createIsReadOnlyException();
|
||||
fSpecSettings.updateExternalSettingsProviders(ids);
|
||||
}
|
||||
|
||||
public ICSourceEntry[] getResolvedSourceEntries() {
|
||||
if(fResolvedSourceEntries == null){
|
||||
ICSourceEntry[] entries = getSourceEntries();
|
||||
fResolvedSourceEntries = CDataUtil.resolveEntries(entries, this);
|
||||
}
|
||||
return fResolvedSourceEntries;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue