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