mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
renamed a bunch of local vars
This commit is contained in:
parent
f636c175eb
commit
666d9577c6
2 changed files with 148 additions and 149 deletions
|
@ -109,17 +109,17 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
static BuildConfigurationData writeConfiguration(ICConfigurationDescription des,
|
static BuildConfigurationData writeConfiguration(ICConfigurationDescription cfgDescription,
|
||||||
BuildConfigurationData base) throws CoreException {
|
BuildConfigurationData base) throws CoreException {
|
||||||
BuildConfigurationData appliedCfg = base;
|
BuildConfigurationData appliedCfg = base;
|
||||||
ICStorageElement rootElement = des.getStorage(BUILD_SYSTEM_DATA_MODULE_NAME, true);
|
ICStorageElement rootElement = cfgDescription.getStorage(BUILD_SYSTEM_DATA_MODULE_NAME, true);
|
||||||
rootElement.clear();
|
rootElement.clear();
|
||||||
rootElement.setAttribute(VERSION_ATTRIBUTE, ManagedBuildManager.getVersion().toString());
|
rootElement.setAttribute(VERSION_ATTRIBUTE, ManagedBuildManager.getVersion().toString());
|
||||||
ICStorageElement cfgElemen = rootElement.createChild(IConfiguration.CONFIGURATION_ELEMENT_NAME);
|
ICStorageElement cfgElemen = rootElement.createChild(IConfiguration.CONFIGURATION_ELEMENT_NAME);
|
||||||
Configuration cfg = (Configuration)appliedCfg.getConfiguration();
|
Configuration cfg = (Configuration)appliedCfg.getConfiguration();
|
||||||
Builder b = (Builder)cfg.getEditableBuilder();
|
Builder b = (Builder)cfg.getEditableBuilder();
|
||||||
// Need to ensure that build macro supplier can get the description for this configuration during the write...
|
// Need to ensure that build macro supplier can get the description for this configuration during the write...
|
||||||
cfg.setConfigurationDescription(des);
|
cfg.setConfigurationDescription(cfgDescription);
|
||||||
if(b != null && b.isManagedBuildOn() && b.getBuildPathAttribute(false) == null){
|
if(b != null && b.isManagedBuildOn() && b.getBuildPathAttribute(false) == null){
|
||||||
String bPath = b.getDefaultBuildPath();
|
String bPath = b.getDefaultBuildPath();
|
||||||
b.setBuildPathAttribute(bPath);
|
b.setBuildPathAttribute(bPath);
|
||||||
|
@ -132,9 +132,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CConfigurationData applyPreferences(
|
protected CConfigurationData applyPreferences(
|
||||||
ICConfigurationDescription des, CConfigurationData base) throws CoreException{
|
ICConfigurationDescription cfgDescription, CConfigurationData base) throws CoreException{
|
||||||
|
|
||||||
BuildConfigurationData appliedCfg = writeConfiguration(des, (BuildConfigurationData)base);
|
BuildConfigurationData appliedCfg = writeConfiguration(cfgDescription, (BuildConfigurationData)base);
|
||||||
|
|
||||||
IConfiguration cfg = ((BuildConfigurationData)base).getConfiguration();
|
IConfiguration cfg = ((BuildConfigurationData)base).getConfiguration();
|
||||||
try {
|
try {
|
||||||
|
@ -148,14 +148,14 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CConfigurationData applyConfiguration(
|
public CConfigurationData applyConfiguration(
|
||||||
ICConfigurationDescription des,
|
ICConfigurationDescription cfgDescription,
|
||||||
ICConfigurationDescription baseDescription,
|
ICConfigurationDescription baseCfgDescription,
|
||||||
CConfigurationData base,
|
CConfigurationData base,
|
||||||
IModificationContext context,
|
IModificationContext context,
|
||||||
IProgressMonitor monitor)
|
IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if(des.isPreferenceConfiguration())
|
if(cfgDescription.isPreferenceConfiguration())
|
||||||
return applyPreferences(des, base);
|
return applyPreferences(cfgDescription, base);
|
||||||
|
|
||||||
BuildConfigurationData baseCfgData = (BuildConfigurationData)base;
|
BuildConfigurationData baseCfgData = (BuildConfigurationData)base;
|
||||||
IConfiguration baseCfg = baseCfgData.getConfiguration();
|
IConfiguration baseCfg = baseCfgData.getConfiguration();
|
||||||
|
@ -164,26 +164,26 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
appliedCfg = baseCfgData;
|
appliedCfg = baseCfgData;
|
||||||
context.setConfigurationSettingsFlags(IModificationContext.CFG_DATA_STORAGE_UNMODIFIED | IModificationContext.CFG_DATA_SETTINGS_UNMODIFIED);
|
context.setConfigurationSettingsFlags(IModificationContext.CFG_DATA_STORAGE_UNMODIFIED | IModificationContext.CFG_DATA_SETTINGS_UNMODIFIED);
|
||||||
} else {
|
} else {
|
||||||
appliedCfg = writeConfiguration(des, baseCfgData);
|
appliedCfg = writeConfiguration(cfgDescription, baseCfgData);
|
||||||
|
|
||||||
IManagedBuildInfo info = getBuildInfo(des);
|
IManagedBuildInfo info = getBuildInfo(cfgDescription);
|
||||||
ManagedProject mProj = (ManagedProject)info.getManagedProject();
|
ManagedProject mProj = (ManagedProject)info.getManagedProject();
|
||||||
mProj.applyConfiguration((Configuration)appliedCfg.getConfiguration());
|
mProj.applyConfiguration((Configuration)appliedCfg.getConfiguration());
|
||||||
writeManagedProjectInfo(des.getProjectDescription(), mProj);
|
writeManagedProjectInfo(cfgDescription.getProjectDescription(), mProj);
|
||||||
try {
|
try {
|
||||||
CfgScannerConfigInfoFactory2.save(appliedCfg, des.getProjectDescription(), baseDescription.getProjectDescription(), !isPersistedCfg(des));
|
CfgScannerConfigInfoFactory2.save(appliedCfg, cfgDescription.getProjectDescription(), baseCfgDescription.getProjectDescription(), !isPersistedCfg(cfgDescription));
|
||||||
} catch (CoreException e){
|
} catch (CoreException e){
|
||||||
ManagedBuilderCorePlugin.log(e);
|
ManagedBuilderCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
info.setValid(true);
|
info.setValid(true);
|
||||||
// Update the ManagedBuildInfo in the ManagedBuildManager map. Doing this creates a barrier for subsequent
|
// Update the ManagedBuildInfo in the ManagedBuildManager map. Doing this creates a barrier for subsequent
|
||||||
// ManagedBuildManager#getBuildInfo(...) see Bug 305146 for more
|
// ManagedBuildManager#getBuildInfo(...) see Bug 305146 for more
|
||||||
ManagedBuildManager.setLoaddedBuildInfo(des.getProjectDescription().getProject(), info);
|
ManagedBuildManager.setLoaddedBuildInfo(cfgDescription.getProjectDescription().getProject(), info);
|
||||||
|
|
||||||
setPersistedFlag(des);
|
setPersistedFlag(cfgDescription);
|
||||||
cacheNaturesIdsUsedOnCache(des);
|
cacheNaturesIdsUsedOnCache(cfgDescription);
|
||||||
|
|
||||||
if(des.isActive()){
|
if(cfgDescription.isActive()){
|
||||||
IConfiguration cfg = appliedCfg.getConfiguration();
|
IConfiguration cfg = appliedCfg.getConfiguration();
|
||||||
IBuilder builder = cfg.getEditableBuilder();
|
IBuilder builder = cfg.getEditableBuilder();
|
||||||
IProject project = context.getProject();
|
IProject project = context.getProject();
|
||||||
|
@ -202,8 +202,8 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
return appliedCfg;
|
return appliedCfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPersistedFlag(ICConfigurationDescription cfg){
|
private void setPersistedFlag(ICConfigurationDescription cfgDescription){
|
||||||
cfg.setSessionProperty(CFG_PERSISTED_PROPERTY, Boolean.TRUE);
|
cfgDescription.setSessionProperty(CFG_PERSISTED_PROPERTY, Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void writeManagedProjectInfo(ICProjectDescription des,
|
private static void writeManagedProjectInfo(ICProjectDescription des,
|
||||||
|
@ -217,12 +217,12 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
|
|
||||||
|
|
||||||
protected CConfigurationData createPreferences(
|
protected CConfigurationData createPreferences(
|
||||||
ICConfigurationDescription des, CConfigurationData base)
|
ICConfigurationDescription cfgDescription, CConfigurationData base)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
|
Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
|
||||||
Configuration newCfg = new Configuration((ManagedProject)cfg.getManagedProject(), cfg, des.getId(), true, true, true);
|
Configuration newCfg = new Configuration((ManagedProject)cfg.getManagedProject(), cfg, cfgDescription.getId(), true, true, true);
|
||||||
newCfg.setConfigurationDescription(des);
|
newCfg.setConfigurationDescription(cfgDescription);
|
||||||
newCfg.setName(des.getName());
|
newCfg.setName(cfgDescription.getName());
|
||||||
// if(!newCfg.getId().equals(cfg.getId())){
|
// if(!newCfg.getId().equals(cfg.getId())){
|
||||||
// newCfg.exportArtifactInfo();
|
// newCfg.exportArtifactInfo();
|
||||||
// }
|
// }
|
||||||
|
@ -233,16 +233,16 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CConfigurationData createConfiguration(
|
public CConfigurationData createConfiguration(
|
||||||
ICConfigurationDescription des,
|
ICConfigurationDescription cfgDescription,
|
||||||
ICConfigurationDescription baseDescription,
|
ICConfigurationDescription baseCfgDescription,
|
||||||
CConfigurationData base, boolean clone,
|
CConfigurationData base, boolean clone,
|
||||||
IProgressMonitor monitor)
|
IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if(des.isPreferenceConfiguration())
|
if(cfgDescription.isPreferenceConfiguration())
|
||||||
return createPreferences(des, base);
|
return createPreferences(cfgDescription, base);
|
||||||
|
|
||||||
Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
|
Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
|
||||||
Configuration newCfg = copyCfg(cfg, des);
|
Configuration newCfg = copyCfg(cfg, cfgDescription);
|
||||||
|
|
||||||
if(!newCfg.getId().equals(cfg.getId()) && newCfg.canExportedArtifactInfo()){
|
if(!newCfg.getId().equals(cfg.getId()) && newCfg.canExportedArtifactInfo()){
|
||||||
// Bug 335001: Remove existing exported settings as they point at this configuration
|
// Bug 335001: Remove existing exported settings as they point at this configuration
|
||||||
|
@ -252,20 +252,20 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
newCfg.exportArtifactInfo();
|
newCfg.exportArtifactInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
setPersistedFlag(des);
|
setPersistedFlag(cfgDescription);
|
||||||
|
|
||||||
return newCfg.getConfigurationData();
|
return newCfg.getConfigurationData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Configuration copyCfg(Configuration cfg, ICConfigurationDescription des){
|
public static Configuration copyCfg(Configuration cfg, ICConfigurationDescription cfgDescription){
|
||||||
IManagedBuildInfo info = getBuildInfo(des);
|
IManagedBuildInfo info = getBuildInfo(cfgDescription);
|
||||||
ManagedProject mProj = (ManagedProject)info.getManagedProject();
|
ManagedProject mProj = (ManagedProject)info.getManagedProject();
|
||||||
|
|
||||||
Configuration newCfg = new Configuration(mProj, cfg, des.getId(), true, true, false);
|
Configuration newCfg = new Configuration(mProj, cfg, cfgDescription.getId(), true, true, false);
|
||||||
newCfg.setConfigurationDescription(des);
|
newCfg.setConfigurationDescription(cfgDescription);
|
||||||
newCfg.setName(des.getName());
|
newCfg.setName(cfgDescription.getName());
|
||||||
|
|
||||||
des.setConfigurationData(ManagedBuildManager.CFG_DATA_PROVIDER_ID, newCfg.getConfigurationData());
|
cfgDescription.setConfigurationData(ManagedBuildManager.CFG_DATA_PROVIDER_ID, newCfg.getConfigurationData());
|
||||||
|
|
||||||
ManagedBuildManager.performValueHandlerEvent(newCfg, IManagedOptionValueHandler.EVENT_OPEN);
|
ManagedBuildManager.performValueHandlerEvent(newCfg, IManagedOptionValueHandler.EVENT_OPEN);
|
||||||
|
|
||||||
|
@ -276,8 +276,8 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
return newCfg;
|
return newCfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IManagedBuildInfo getBuildInfo(ICConfigurationDescription des){
|
private static IManagedBuildInfo getBuildInfo(ICConfigurationDescription cfgDescription){
|
||||||
ICProjectDescription projDes = des.getProjectDescription();
|
ICProjectDescription projDes = cfgDescription.getProjectDescription();
|
||||||
IProject project = projDes.getProject();
|
IProject project = projDes.getProject();
|
||||||
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project, false);
|
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project, false);
|
||||||
if(info == null)
|
if(info == null)
|
||||||
|
@ -285,7 +285,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
|
|
||||||
setLoaddedBuildInfo(projDes, info);
|
setLoaddedBuildInfo(projDes, info);
|
||||||
|
|
||||||
getManagedProject(des, info);
|
getManagedProject(cfgDescription, info);
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
@ -298,10 +298,10 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
return (ManagedBuildInfo)des.getSessionProperty(BUILD_INFO_PROPERTY);
|
return (ManagedBuildInfo)des.getSessionProperty(BUILD_INFO_PROPERTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IManagedProject getManagedProject(ICConfigurationDescription des, IManagedBuildInfo info){
|
private static IManagedProject getManagedProject(ICConfigurationDescription cfgDescription, IManagedBuildInfo info){
|
||||||
IManagedProject mProj = info.getManagedProject();
|
IManagedProject mProj = info.getManagedProject();
|
||||||
if(mProj == null){
|
if(mProj == null){
|
||||||
mProj = createManagedProject(info, des.getProjectDescription());
|
mProj = createManagedProject(info, cfgDescription.getProjectDescription());
|
||||||
}
|
}
|
||||||
return mProj;
|
return mProj;
|
||||||
}
|
}
|
||||||
|
@ -333,35 +333,35 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] getNaturesIdsUsedOnCache(IConfiguration cfg){
|
public static String[] getNaturesIdsUsedOnCache(IConfiguration cfg){
|
||||||
ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg);
|
ICConfigurationDescription cfgDescription = ManagedBuildManager.getDescriptionForConfiguration(cfg);
|
||||||
if(cfgDes != null)
|
if(cfgDescription != null)
|
||||||
return getNaturesIdsUsedOnCache(cfgDes);
|
return getNaturesIdsUsedOnCache(cfgDescription);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] getNaturesIdsUsedOnCache(ICConfigurationDescription cfg){
|
public static String[] getNaturesIdsUsedOnCache(ICConfigurationDescription cfgDescription){
|
||||||
String[] strs = (String[])cfg.getSessionProperty(NATURES_USED_ON_CACHE_PROPERTY);
|
String[] strs = (String[])cfgDescription.getSessionProperty(NATURES_USED_ON_CACHE_PROPERTY);
|
||||||
return strs != null && strs.length != 0 ? (String[])strs.clone() : strs;
|
return strs != null && strs.length != 0 ? (String[])strs.clone() : strs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void cacheNaturesIdsUsedOnCache(ICConfigurationDescription des){
|
public static void cacheNaturesIdsUsedOnCache(ICConfigurationDescription cfgDescription){
|
||||||
IProject project = des.getProjectDescription().getProject();
|
IProject project = cfgDescription.getProjectDescription().getProject();
|
||||||
try {
|
try {
|
||||||
IProjectDescription eDes = project.getDescription();
|
IProjectDescription eDes = project.getDescription();
|
||||||
String[] natures = eDes.getNatureIds();
|
String[] natures = eDes.getNatureIds();
|
||||||
setNaturesIdsUsedOnCache(des, natures);
|
setNaturesIdsUsedOnCache(cfgDescription, natures);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
ManagedBuilderCorePlugin.log(e);
|
ManagedBuilderCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setNaturesIdsUsedOnCache(ICConfigurationDescription cfg, String ids[]){
|
private static void setNaturesIdsUsedOnCache(ICConfigurationDescription cfgDescription, String ids[]){
|
||||||
ids = ids != null && ids.length != 0 ? (String[])ids.clone() : ids;
|
ids = ids != null && ids.length != 0 ? (String[])ids.clone() : ids;
|
||||||
cfg.setSessionProperty(NATURES_USED_ON_CACHE_PROPERTY, ids);
|
cfgDescription.setSessionProperty(NATURES_USED_ON_CACHE_PROPERTY, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Configuration load(ICConfigurationDescription des, ManagedProject mProj, boolean isPreference) throws CoreException{
|
private Configuration load(ICConfigurationDescription cfgDescription, ManagedProject mProj, boolean isPreference) throws CoreException{
|
||||||
ICStorageElement rootElement = des.getStorage(BUILD_SYSTEM_DATA_MODULE_NAME, true);
|
ICStorageElement rootElement = cfgDescription.getStorage(BUILD_SYSTEM_DATA_MODULE_NAME, true);
|
||||||
ICStorageElement children[] = rootElement.getChildren();
|
ICStorageElement children[] = rootElement.getChildren();
|
||||||
String version = rootElement.getAttribute(VERSION_ATTRIBUTE);
|
String version = rootElement.getAttribute(VERSION_ATTRIBUTE);
|
||||||
Configuration cfg = null;
|
Configuration cfg = null;
|
||||||
|
@ -376,14 +376,14 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CConfigurationData loadPreferences(ICConfigurationDescription des)
|
protected CConfigurationData loadPreferences(ICConfigurationDescription cfgDescription)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
|
|
||||||
Configuration cfg = load(des, null, true);
|
Configuration cfg = load(cfgDescription, null, true);
|
||||||
|
|
||||||
cfg = updatePreferenceOnLoad(cfg, des);
|
cfg = updatePreferenceOnLoad(cfg, cfgDescription);
|
||||||
|
|
||||||
cfg.setConfigurationDescription(des);
|
cfg.setConfigurationDescription(cfgDescription);
|
||||||
|
|
||||||
return cfg.getConfigurationData();
|
return cfg.getConfigurationData();
|
||||||
}
|
}
|
||||||
|
@ -396,9 +396,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Configuration updatePreferenceOnLoad(Configuration cfg, ICConfigurationDescription des){
|
private static Configuration updatePreferenceOnLoad(Configuration cfg, ICConfigurationDescription cfgDescription){
|
||||||
if(cfg == null)
|
if(cfg == null)
|
||||||
cfg = createEmptyPrefConfiguration(des.getId(), des.getName());
|
cfg = createEmptyPrefConfiguration(cfgDescription.getId(), cfgDescription.getName());
|
||||||
|
|
||||||
cfg = adjustPreferenceConfig(cfg);
|
cfg = adjustPreferenceConfig(cfg);
|
||||||
|
|
||||||
|
@ -604,8 +604,8 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean isPersistedCfg(ICConfigurationDescription cfgDes){
|
private boolean isPersistedCfg(ICConfigurationDescription cfgDescription){
|
||||||
return cfgDes.getSessionProperty(CFG_PERSISTED_PROPERTY) != null;
|
return cfgDescription.getSessionProperty(CFG_PERSISTED_PROPERTY) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -624,22 +624,22 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeConfiguration(ICConfigurationDescription des,
|
public void removeConfiguration(ICConfigurationDescription cfgDescription,
|
||||||
CConfigurationData data,
|
CConfigurationData data,
|
||||||
IProgressMonitor monitor) {
|
IProgressMonitor monitor) {
|
||||||
IConfiguration cfg = ((BuildConfigurationData)data).getConfiguration();
|
IConfiguration cfg = ((BuildConfigurationData)data).getConfiguration();
|
||||||
ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_CLOSE);
|
ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_CLOSE);
|
||||||
IManagedBuildInfo info = getBuildInfo(des);
|
IManagedBuildInfo info = getBuildInfo(cfgDescription);
|
||||||
IManagedProject mProj = info.getManagedProject();
|
IManagedProject mProj = info.getManagedProject();
|
||||||
mProj.removeConfiguration(cfg.getId());
|
mProj.removeConfiguration(cfg.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dataCached(ICConfigurationDescription cfgDes,
|
public void dataCached(ICConfigurationDescription cfgDescription,
|
||||||
CConfigurationData data,
|
CConfigurationData data,
|
||||||
IProgressMonitor monitor) {
|
IProgressMonitor monitor) {
|
||||||
BuildConfigurationData cfgData = (BuildConfigurationData)data;
|
BuildConfigurationData cfgData = (BuildConfigurationData)data;
|
||||||
((Configuration)cfgData.getConfiguration()).setConfigurationDescription(cfgDes);
|
((Configuration)cfgData.getConfiguration()).setConfigurationDescription(cfgDescription);
|
||||||
cfgData.clearCachedData();
|
cfgData.clearCachedData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,9 +126,9 @@ public class PathEntryTranslator {
|
||||||
ICConfigurationDescription fCfg;
|
ICConfigurationDescription fCfg;
|
||||||
ICdtVariableManager fMngr = CCorePlugin.getDefault().getCdtVariableManager();
|
ICdtVariableManager fMngr = CCorePlugin.getDefault().getCdtVariableManager();
|
||||||
|
|
||||||
public VarSubstitutor(ICConfigurationDescription cfg) {
|
public VarSubstitutor(ICConfigurationDescription cfgDescription) {
|
||||||
super(new DefaultVariableContextInfo(ICoreVariableContextInfo.CONTEXT_CONFIGURATION, cfg), "", " "); //$NON-NLS-1$ //$NON-NLS-2$
|
super(new DefaultVariableContextInfo(ICoreVariableContextInfo.CONTEXT_CONFIGURATION, cfgDescription), "", " "); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
fCfg = cfg;
|
fCfg = cfgDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -144,9 +144,9 @@ public class PathEntryTranslator {
|
||||||
private IPath[] fRefProjPaths;
|
private IPath[] fRefProjPaths;
|
||||||
private ICExternalSetting[] fExtSettings;
|
private ICExternalSetting[] fExtSettings;
|
||||||
|
|
||||||
public ReferenceSettingsInfo(ICConfigurationDescription des) {
|
public ReferenceSettingsInfo(ICConfigurationDescription cfgDescription) {
|
||||||
fExtSettings = des.getExternalSettings();
|
fExtSettings = cfgDescription.getExternalSettings();
|
||||||
Map<String, String> map = des.getReferenceInfo();
|
Map<String, String> map = cfgDescription.getReferenceInfo();
|
||||||
fRefProjPaths = new IPath[map.size()];
|
fRefProjPaths = new IPath[map.size()];
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (String proj : map.keySet()) {
|
for (String proj : map.keySet()) {
|
||||||
|
@ -605,7 +605,7 @@ public class PathEntryTranslator {
|
||||||
private boolean fIsExported;
|
private boolean fIsExported;
|
||||||
private IProject fProject;
|
private IProject fProject;
|
||||||
|
|
||||||
PathEntryComposer(IPath path, IProject project/*, ICConfigurationDescription cfg*/) {
|
PathEntryComposer(IPath path, IProject project/*, ICConfigurationDescription cfgDescription*/) {
|
||||||
fPath = toProjectPath(path);
|
fPath = toProjectPath(path);
|
||||||
fProject = project;
|
fProject = project;
|
||||||
}
|
}
|
||||||
|
@ -617,7 +617,7 @@ public class PathEntryTranslator {
|
||||||
return path.makeAbsolute();
|
return path.makeAbsolute();
|
||||||
}
|
}
|
||||||
|
|
||||||
PathEntryComposer(ICExclusionPatternPathEntry entry, IProject project/*, ICConfigurationDescription cfg*/) {
|
PathEntryComposer(ICExclusionPatternPathEntry entry, IProject project/*, ICConfigurationDescription cfgDescription*/) {
|
||||||
fPath = new Path(entry.getValue());
|
fPath = new Path(entry.getValue());
|
||||||
fLangEntry = entry;
|
fLangEntry = entry;
|
||||||
fProject = project;
|
fProject = project;
|
||||||
|
@ -628,7 +628,7 @@ public class PathEntryTranslator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PathEntryComposer(IPath path, ICLanguageSettingEntry entry, boolean exported, IProject project/*, ICConfigurationDescription cfg*/) {
|
PathEntryComposer(IPath path, ICLanguageSettingEntry entry, boolean exported, IProject project/*, ICConfigurationDescription cfgDescription*/) {
|
||||||
fPath = path;
|
fPath = path;
|
||||||
fLangEntry = entry;
|
fLangEntry = entry;
|
||||||
fIsExported = exported;
|
fIsExported = exported;
|
||||||
|
@ -656,15 +656,15 @@ public class PathEntryTranslator {
|
||||||
return new IPath[0];
|
return new IPath[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private IPath[][] getEntryPath(ICSettingEntry entry, ICConfigurationDescription cfg) {
|
private IPath[][] getEntryPath(ICSettingEntry entry, ICConfigurationDescription cfgDescription) {
|
||||||
return valueToEntryPath(entry.getName(), (entry.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH) != 0, cfg);
|
return valueToEntryPath(entry.getName(), (entry.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH) != 0, cfgDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IPath[][] valueToEntryPath(String value, boolean isWsp, ICConfigurationDescription cfg) {
|
private IPath[][] valueToEntryPath(String value, boolean isWsp, ICConfigurationDescription cfgDescription) {
|
||||||
String[] pathVarValues = resolveKeepingPathEntryFars(value, cfg);
|
String[] pathVarValues = resolveKeepingPathEntryFars(value, cfgDescription);
|
||||||
IPath result[][] = new IPath[2][pathVarValues.length];
|
IPath result[][] = new IPath[2][pathVarValues.length];
|
||||||
for (int i = 0; i < pathVarValues.length; i++) {
|
for (int i = 0; i < pathVarValues.length; i++) {
|
||||||
String resolvedValue = resolveAll(value, cfg);
|
String resolvedValue = resolveAll(value, cfgDescription);
|
||||||
IPath resolvedPath = new Path(resolvedValue);
|
IPath resolvedPath = new Path(resolvedValue);
|
||||||
IPath pathVarPath = new Path(pathVarValues[i]);
|
IPath pathVarPath = new Path(pathVarValues[i]);
|
||||||
if (isWsp) {
|
if (isWsp) {
|
||||||
|
@ -704,20 +704,20 @@ public class PathEntryTranslator {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPathEntry[] toPathEntry(ICConfigurationDescription cfg, boolean keepPathInfo) {
|
public IPathEntry[] toPathEntry(ICConfigurationDescription cfgDescription, boolean keepPathInfo) {
|
||||||
IPath path = keepPathInfo ? fPath : fProject.getFullPath();
|
IPath path = keepPathInfo ? fPath : fProject.getFullPath();
|
||||||
IPathEntry[] result = new IPathEntry[0];
|
IPathEntry[] result = new IPathEntry[0];
|
||||||
if (fLangEntry != null) {
|
if (fLangEntry != null) {
|
||||||
switch (fLangEntry.getKind()) {
|
switch (fLangEntry.getKind()) {
|
||||||
case ICSettingEntry.INCLUDE_FILE:{
|
case ICSettingEntry.INCLUDE_FILE:{
|
||||||
IPath paths[][] = getEntryPath(fLangEntry, cfg);
|
IPath paths[][] = getEntryPath(fLangEntry, cfgDescription);
|
||||||
result = new IPathEntry[paths[0].length];
|
result = new IPathEntry[paths[0].length];
|
||||||
for (int i = 0; i < result.length; i++)
|
for (int i = 0; i < result.length; i++)
|
||||||
result[i] = CoreModel.newIncludeFileEntry(path, null, paths[0][i], paths[1][i], getExclusionPatterns(), fIsExported);
|
result[i] = CoreModel.newIncludeFileEntry(path, null, paths[0][i], paths[1][i], getExclusionPatterns(), fIsExported);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case ICSettingEntry.INCLUDE_PATH:{
|
case ICSettingEntry.INCLUDE_PATH:{
|
||||||
IPath paths[][] = getEntryPath(fLangEntry, cfg);
|
IPath paths[][] = getEntryPath(fLangEntry, cfgDescription);
|
||||||
ICIncludePathEntry ipe = (ICIncludePathEntry)fLangEntry;
|
ICIncludePathEntry ipe = (ICIncludePathEntry)fLangEntry;
|
||||||
|
|
||||||
result = new IPathEntry[paths[0].length];
|
result = new IPathEntry[paths[0].length];
|
||||||
|
@ -730,7 +730,7 @@ public class PathEntryTranslator {
|
||||||
result[0] = CoreModel.newMacroEntry(path, fLangEntry.getName(), fLangEntry.getValue(), getExclusionPatterns(), fIsExported);
|
result[0] = CoreModel.newMacroEntry(path, fLangEntry.getName(), fLangEntry.getValue(), getExclusionPatterns(), fIsExported);
|
||||||
return result;
|
return result;
|
||||||
case ICSettingEntry.MACRO_FILE:{
|
case ICSettingEntry.MACRO_FILE:{
|
||||||
IPath paths[][] = getEntryPath(fLangEntry, cfg);
|
IPath paths[][] = getEntryPath(fLangEntry, cfgDescription);
|
||||||
result = new IPathEntry[paths[0].length];
|
result = new IPathEntry[paths[0].length];
|
||||||
for (int i = 0; i < result.length; i++)
|
for (int i = 0; i < result.length; i++)
|
||||||
result[i] = CoreModel.newMacroFileEntry(path, paths[0][i], null, paths[1][i], getExclusionPatterns(), fIsExported);
|
result[i] = CoreModel.newMacroFileEntry(path, paths[0][i], null, paths[1][i], getExclusionPatterns(), fIsExported);
|
||||||
|
@ -742,7 +742,7 @@ public class PathEntryTranslator {
|
||||||
// aren't currently resolved
|
// aren't currently resolved
|
||||||
return null;
|
return null;
|
||||||
// case ICSettingEntry.LIBRARY_FILE:{
|
// case ICSettingEntry.LIBRARY_FILE:{
|
||||||
// IPath paths[][] = getEntryPath(fLangEntry, cfg);
|
// IPath paths[][] = getEntryPath(fLangEntry, cfgDescription);
|
||||||
// result = new IPathEntry[paths[0].length];
|
// result = new IPathEntry[paths[0].length];
|
||||||
// for (int i = 0; i < result.length; i++)
|
// for (int i = 0; i < result.length; i++)
|
||||||
// result[i] = CoreModel.newLibraryEntry(path, paths[0][i], paths[1][i], null, null, null, fIsExported);
|
// result[i] = CoreModel.newLibraryEntry(path, paths[0][i], paths[1][i], null, null, null, fIsExported);
|
||||||
|
@ -768,19 +768,19 @@ public class PathEntryTranslator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String resolveAll(String value, ICConfigurationDescription cfg) {
|
private static String resolveAll(String value, ICConfigurationDescription cfgDescription) {
|
||||||
try {
|
try {
|
||||||
return CCorePlugin.getDefault().getCdtVariableManager().resolveValue(value, "", " ", cfg); //$NON-NLS-1$ //$NON-NLS-2$
|
return CCorePlugin.getDefault().getCdtVariableManager().resolveValue(value, "", " ", cfgDescription); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
} catch (CdtVariableException e) {
|
} catch (CdtVariableException e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String[] resolveKeepingPathEntryFars(String value, ICConfigurationDescription cfg) {
|
private static String[] resolveKeepingPathEntryFars(String value, ICConfigurationDescription cfgDescription) {
|
||||||
String[] result = new String[] { value }; // default value;
|
String[] result = new String[] { value }; // default value;
|
||||||
try {
|
try {
|
||||||
VarSubstitutor substitutor = new VarSubstitutor(cfg);
|
VarSubstitutor substitutor = new VarSubstitutor(cfgDescription);
|
||||||
|
|
||||||
result = CdtVariableResolver.resolveToStringList(value, substitutor);
|
result = CdtVariableResolver.resolveToStringList(value, substitutor);
|
||||||
if (result == null || result.length == 0)
|
if (result == null || result.length == 0)
|
||||||
|
@ -798,7 +798,7 @@ public class PathEntryTranslator {
|
||||||
private LinkedHashMap<IPath, PathEntryComposer> fRefProjMap;
|
private LinkedHashMap<IPath, PathEntryComposer> fRefProjMap;
|
||||||
private IProject fProject;
|
private IProject fProject;
|
||||||
|
|
||||||
private PathEntryCollector(IProject project/*, ICConfigurationDescription cfg*/) {
|
private PathEntryCollector(IProject project/*, ICConfigurationDescription cfgDescription*/) {
|
||||||
fStorage = PathSettingsContainer.createRootContainer();
|
fStorage = PathSettingsContainer.createRootContainer();
|
||||||
fStorage.setValue(this);
|
fStorage.setValue(this);
|
||||||
fStore = new KindBasedStore<LinkedHashMap<ICSettingEntry, PathEntryComposer>>(false);
|
fStore = new KindBasedStore<LinkedHashMap<ICSettingEntry, PathEntryComposer>>(false);
|
||||||
|
@ -806,7 +806,7 @@ public class PathEntryTranslator {
|
||||||
fProject = project;
|
fProject = project;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PathEntryCollector(PathSettingsContainer container, KindBasedStore<LinkedHashMap<ICSettingEntry, PathEntryComposer>> store, IProject project/*, ICConfigurationDescription cfg*/) {
|
private PathEntryCollector(PathSettingsContainer container, KindBasedStore<LinkedHashMap<ICSettingEntry, PathEntryComposer>> store, IProject project/*, ICConfigurationDescription cfgDescription*/) {
|
||||||
fStorage = container;
|
fStorage = container;
|
||||||
fStore = store;
|
fStore = store;
|
||||||
fNameKeyMapStore = new KindBasedStore<LinkedHashMap<EntryNameKey, PathEntryComposer>>(false);
|
fNameKeyMapStore = new KindBasedStore<LinkedHashMap<EntryNameKey, PathEntryComposer>>(false);
|
||||||
|
@ -993,7 +993,7 @@ public class PathEntryTranslator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IPathEntry> getEntries(int peKind, List<IPathEntry> list, int flags, ICConfigurationDescription cfg) {
|
public List<IPathEntry> getEntries(int peKind, List<IPathEntry> list, int flags, ICConfigurationDescription cfgDescription) {
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList<IPathEntry>();
|
list = new ArrayList<IPathEntry>();
|
||||||
}
|
}
|
||||||
|
@ -1021,7 +1021,7 @@ public class PathEntryTranslator {
|
||||||
store.put(peKind, map);
|
store.put(peKind, map);
|
||||||
}
|
}
|
||||||
if (!map.containsKey(name)) {
|
if (!map.containsKey(name)) {
|
||||||
pe = cs.toPathEntry(cfg, false);
|
pe = cs.toPathEntry(cfgDescription, false);
|
||||||
if (pe != null) {
|
if (pe != null) {
|
||||||
if (pe.length > 1) {
|
if (pe.length > 1) {
|
||||||
System.out.println();
|
System.out.println();
|
||||||
|
@ -1030,7 +1030,7 @@ public class PathEntryTranslator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pe = cs.toPathEntry(cfg, true);
|
pe = cs.toPathEntry(cfgDescription, true);
|
||||||
}
|
}
|
||||||
if (pe != null)
|
if (pe != null)
|
||||||
list.addAll(Arrays.asList(pe));
|
list.addAll(Arrays.asList(pe));
|
||||||
|
@ -1057,19 +1057,19 @@ public class PathEntryTranslator {
|
||||||
return entry != null && (entry.isBuiltIn() || entry.isReadOnly());
|
return entry != null && (entry.isBuiltIn() || entry.isReadOnly());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IPathEntry> getEntries(List<IPathEntry> list, int flags, ICConfigurationDescription cfg) {
|
public List<IPathEntry> getEntries(List<IPathEntry> list, int flags, ICConfigurationDescription cfgDescription) {
|
||||||
if (list == null)
|
if (list == null)
|
||||||
list = new ArrayList<IPathEntry>();
|
list = new ArrayList<IPathEntry>();
|
||||||
int peKinds[] = PathEntryKyndStore.getSupportedKinds();
|
int peKinds[] = PathEntryKyndStore.getSupportedKinds();
|
||||||
for (int peKind : peKinds) {
|
for (int peKind : peKinds) {
|
||||||
getEntries(peKind, list, flags, cfg);
|
getEntries(peKind, list, flags, cfgDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPathEntry[] getEntries(int flags, ICConfigurationDescription cfg) {
|
public IPathEntry[] getEntries(int flags, ICConfigurationDescription cfgDescription) {
|
||||||
List<IPathEntry> list = getEntries(null, flags,cfg);
|
List<IPathEntry> list = getEntries(null, flags,cfgDescription);
|
||||||
IPathEntry[] entries = list.toArray(new IPathEntry[list.size()]);
|
IPathEntry[] entries = list.toArray(new IPathEntry[list.size()]);
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
@ -1123,16 +1123,16 @@ public class PathEntryTranslator {
|
||||||
return new IPath[0];
|
return new IPath[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public PathEntryTranslator(IProject project, CConfigurationData data) {
|
public PathEntryTranslator(IProject project, CConfigurationData cfgData) {
|
||||||
fProject = project;
|
fProject = project;
|
||||||
fCfgData = data;
|
fCfgData = cfgData;
|
||||||
fRcDataHolder = createRcDataHolder(data);
|
fRcDataHolder = createRcDataHolder(cfgData);
|
||||||
fTranslatedFilters = PathSettingsContainer.createRootContainer();
|
fTranslatedFilters = PathSettingsContainer.createRootContainer();
|
||||||
fTranslatedFilters.setValue(new ResourceInfo[]{new ResourceInfo(fRoot, true)});
|
fTranslatedFilters.setValue(new ResourceInfo[]{new ResourceInfo(fRoot, true)});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static PathSettingsContainer createRcDataHolder(CConfigurationData data) {
|
private static PathSettingsContainer createRcDataHolder(CConfigurationData cfgData) {
|
||||||
return CDataUtil.createRcDataHolder(data);
|
return CDataUtil.createRcDataHolder(cfgData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReferenceSettingsInfo applyPathEntries(PathEntryResolveInfo info, int op) {
|
public ReferenceSettingsInfo applyPathEntries(PathEntryResolveInfo info, int op) {
|
||||||
|
@ -1437,10 +1437,10 @@ public class PathEntryTranslator {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyEntries(CResourceData data, RcDesInfo info, int op) {
|
private void applyEntries(CResourceData rcData, RcDesInfo info, int op) {
|
||||||
CLanguageData lDatas[] = data.getType() == ICSettingBase.SETTING_FILE ?
|
CLanguageData lDatas[] = rcData.getType() == ICSettingBase.SETTING_FILE ?
|
||||||
new CLanguageData[] { ((CFileData)data).getLanguageData() } :
|
new CLanguageData[] { ((CFileData)rcData).getLanguageData() } :
|
||||||
((CFolderData) data).getLanguageDatas();
|
((CFolderData) rcData).getLanguageDatas();
|
||||||
|
|
||||||
for (CLanguageData lData : lDatas) {
|
for (CLanguageData lData : lDatas) {
|
||||||
if (lData == null)
|
if (lData == null)
|
||||||
|
@ -1967,13 +1967,13 @@ public class PathEntryTranslator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CConfigurationData getCfgData(ICConfigurationDescription cfgDes) {
|
private static CConfigurationData getCfgData(ICConfigurationDescription cfgDescription) {
|
||||||
return cfgDes instanceof CConfigurationDescriptionCache ?
|
return cfgDescription instanceof CConfigurationDescriptionCache ?
|
||||||
(CConfigurationData)cfgDes : ((IInternalCCfgInfo)cfgDes).getConfigurationData(false);
|
(CConfigurationData)cfgDescription : ((IInternalCCfgInfo)cfgDescription).getConfigurationData(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addOutputEntries(PathEntryCollector cr, CConfigurationData data) {
|
private static void addOutputEntries(PathEntryCollector cr, CConfigurationData cfgData) {
|
||||||
CBuildData bData = data.getBuildData();
|
CBuildData bData = cfgData.getBuildData();
|
||||||
if (bData != null) {
|
if (bData != null) {
|
||||||
ICOutputEntry oEntries[] = bData.getOutputDirectories();
|
ICOutputEntry oEntries[] = bData.getOutputDirectories();
|
||||||
if (oEntries != null && oEntries.length != 0) {
|
if (oEntries != null && oEntries.length != 0) {
|
||||||
|
@ -1982,30 +1982,30 @@ public class PathEntryTranslator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PathEntryCollector collectEntries(IProject project, final ICConfigurationDescription des) {
|
public static PathEntryCollector collectEntries(IProject project, final ICConfigurationDescription cfgDescription) {
|
||||||
CConfigurationData data = getCfgData(des);
|
CConfigurationData cfgData = getCfgData(cfgDescription);
|
||||||
|
|
||||||
ReferenceSettingsInfo refInfo = new ReferenceSettingsInfo(des);
|
ReferenceSettingsInfo refInfo = new ReferenceSettingsInfo(cfgDescription);
|
||||||
ICConfigurationDescription[] allCfgs = des.isPreferenceConfiguration() ?
|
ICConfigurationDescription[] allCfgDescriptions = cfgDescription.isPreferenceConfiguration() ?
|
||||||
new ICConfigurationDescription[] { des } :
|
new ICConfigurationDescription[] { cfgDescription } :
|
||||||
des.getProjectDescription().getConfigurations();
|
cfgDescription.getProjectDescription().getConfigurations();
|
||||||
|
|
||||||
CConfigurationData[] allDatas = new CConfigurationData[allCfgs.length];
|
CConfigurationData[] allDatas = new CConfigurationData[allCfgDescriptions.length];
|
||||||
for (int i = 0; i < allCfgs.length; i++) {
|
for (int i = 0; i < allCfgDescriptions.length; i++) {
|
||||||
allDatas[i] = getCfgData(allCfgs[i]);
|
allDatas[i] = getCfgData(allCfgDescriptions[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
final PathEntryCollector cr = new PathEntryCollector(project/*, des*/);
|
final PathEntryCollector collector = new PathEntryCollector(project/*, cfgDescription*/);
|
||||||
PathSettingsContainer rcDatas = createRcDataHolder(data);
|
PathSettingsContainer rcDatas = createRcDataHolder(cfgData);
|
||||||
ICSourceEntry sEntries[] = data.getSourceEntries();
|
ICSourceEntry sEntries[] = cfgData.getSourceEntries();
|
||||||
if (sEntries != null && sEntries.length != 0) {
|
if (sEntries != null && sEntries.length != 0) {
|
||||||
cr.setSourceOutputEntries(ICSettingEntry.SOURCE_PATH, sEntries);
|
collector.setSourceOutputEntries(ICSettingEntry.SOURCE_PATH, sEntries);
|
||||||
}
|
}
|
||||||
for (CConfigurationData allData : allDatas) {
|
for (CConfigurationData allData : allDatas) {
|
||||||
addOutputEntries(cr, allData);
|
addOutputEntries(collector, allData);
|
||||||
}
|
}
|
||||||
final HashSet<ICSettingEntry> exportedSettings = new HashSet<ICSettingEntry>();
|
final HashSet<ICSettingEntry> exportedSettings = new HashSet<ICSettingEntry>();
|
||||||
cr.setRefProjects(refInfo.getReferencedProjectsPaths());
|
collector.setRefProjects(refInfo.getReferencedProjectsPaths());
|
||||||
ICExternalSetting[] settings = refInfo.getExternalSettings();
|
ICExternalSetting[] settings = refInfo.getExternalSettings();
|
||||||
for (ICExternalSetting setting : settings) {
|
for (ICExternalSetting setting : settings) {
|
||||||
exportedSettings.addAll(Arrays.asList(setting.getEntries()));
|
exportedSettings.addAll(Arrays.asList(setting.getEntries()));
|
||||||
|
@ -2015,15 +2015,15 @@ public class PathEntryTranslator {
|
||||||
rcDatas.accept(new IPathSettingsContainerVisitor() {
|
rcDatas.accept(new IPathSettingsContainerVisitor() {
|
||||||
@Override
|
@Override
|
||||||
public boolean visit(PathSettingsContainer container) {
|
public boolean visit(PathSettingsContainer container) {
|
||||||
CResourceData data = (CResourceData)container.getValue();
|
CResourceData rcData = (CResourceData)container.getValue();
|
||||||
if (data != null) {
|
if (rcData != null) {
|
||||||
// AG FIXME - temporary log to remove before CDT Juno release
|
// AG FIXME - temporary log to remove before CDT Juno release
|
||||||
temporaryLog(des, kinds, data);
|
temporaryLog(cfgDescription, kinds, rcData);
|
||||||
|
|
||||||
PathEntryCollector child = cr.createChild(container.getPath());
|
PathEntryCollector child = collector.createChild(container.getPath());
|
||||||
for (int kind : kinds) {
|
for (int kind : kinds) {
|
||||||
List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>();
|
List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>();
|
||||||
if (collectResourceDataEntries(des, kind, data, list)) {
|
if (collectResourceDataEntries(cfgDescription, kind, rcData, list)) {
|
||||||
ICLanguageSettingEntry[] entries = list.toArray(new ICLanguageSettingEntry[list.size()]);
|
ICLanguageSettingEntry[] entries = list.toArray(new ICLanguageSettingEntry[list.size()]);
|
||||||
child.setEntries(kind, entries, exportedSettings);
|
child.setEntries(kind, entries, exportedSettings);
|
||||||
}
|
}
|
||||||
|
@ -2034,7 +2034,7 @@ public class PathEntryTranslator {
|
||||||
|
|
||||||
// AG FIXME - temporary log to remove before CDT Juno release
|
// AG FIXME - temporary log to remove before CDT Juno release
|
||||||
@Deprecated
|
@Deprecated
|
||||||
private void temporaryLog(final ICConfigurationDescription des, final int[] kinds, CResourceData data) {
|
private void temporaryLog(final ICConfigurationDescription cfgDescription, final int[] kinds, CResourceData rcData) {
|
||||||
String kindsStr="";
|
String kindsStr="";
|
||||||
for (int kind : kinds) {
|
for (int kind : kinds) {
|
||||||
String kstr = LanguageSettingEntriesSerializer.kindToString(kind);
|
String kstr = LanguageSettingEntriesSerializer.kindToString(kind);
|
||||||
|
@ -2044,25 +2044,25 @@ public class PathEntryTranslator {
|
||||||
kindsStr += "|" + kstr;
|
kindsStr += "|" + kstr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final IProject prj = des.getProjectDescription().getProject();
|
final IProject prj = cfgDescription.getProjectDescription().getProject();
|
||||||
String log_msg = "path="+prj+"/"+data.getPath()+", kind=["+kindsStr+"]"+" (PathEntryTranslator.collectEntries())";
|
String log_msg = "path="+prj+"/"+rcData.getPath()+", kind=["+kindsStr+"]"+" (PathEntryTranslator.collectEntries())";
|
||||||
LanguageSettingsLogger.logInfo(log_msg);
|
LanguageSettingsLogger.logInfo(log_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
return cr;
|
return collector;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean collectResourceDataEntries(ICConfigurationDescription des, int kind, CResourceData data, List<ICLanguageSettingEntry> list) {
|
private static boolean collectResourceDataEntries(ICConfigurationDescription cfgDescription, int kind, CResourceData rcData, List<ICLanguageSettingEntry> list) {
|
||||||
CLanguageData[] lDatas = null;
|
CLanguageData[] lDatas = null;
|
||||||
if (data instanceof CFolderData) {
|
if (rcData instanceof CFolderData) {
|
||||||
lDatas = ((CFolderData)data).getLanguageDatas();
|
lDatas = ((CFolderData)rcData).getLanguageDatas();
|
||||||
} else if (data instanceof CFileData) {
|
} else if (rcData instanceof CFileData) {
|
||||||
CLanguageData lData = ((CFileData)data).getLanguageData();
|
CLanguageData lData = ((CFileData)rcData).getLanguageData();
|
||||||
if (lData != null)
|
if (lData != null)
|
||||||
lDatas = new CLanguageData[] {lData};
|
lDatas = new CLanguageData[] {lData};
|
||||||
} else {
|
} else {
|
||||||
Exception e = new Exception(UtilMessages.getString("PathEntryTranslator.1") + data.getClass().getName()); //$NON-NLS-1$
|
Exception e = new Exception(UtilMessages.getString("PathEntryTranslator.1") + rcData.getClass().getName()); //$NON-NLS-1$
|
||||||
IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, e.getMessage(), e);
|
IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, e.getMessage(), e);
|
||||||
CCorePlugin.log(status);
|
CCorePlugin.log(status);
|
||||||
}
|
}
|
||||||
|
@ -2070,12 +2070,11 @@ public class PathEntryTranslator {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IProject project = cfgDescription.getProjectDescription().getProject();
|
||||||
IProject project = des.getProjectDescription().getProject();
|
|
||||||
if (ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project)) {
|
if (ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project)) {
|
||||||
IResource rc = getResource(project, data.getPath());
|
IResource rc = findResourceInWorkspace(project, rcData.getPath());
|
||||||
for (CLanguageData lData : lDatas) {
|
for (CLanguageData lData : lDatas) {
|
||||||
list.addAll(LanguageSettingsProvidersSerializer.getSettingEntriesByKind(des, rc, lData.getLanguageId(), kind));
|
list.addAll(LanguageSettingsProvidersSerializer.getSettingEntriesByKind(cfgDescription, rc, lData.getLanguageId(), kind));
|
||||||
}
|
}
|
||||||
return list.size()>0;
|
return list.size()>0;
|
||||||
|
|
||||||
|
@ -2101,14 +2100,14 @@ public class PathEntryTranslator {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IPathEntry[] getPathEntries(IProject project, ICConfigurationDescription cfg, int flags) {
|
public static IPathEntry[] getPathEntries(IProject project, ICConfigurationDescription cfgDescription, int flags) {
|
||||||
PathEntryCollector cr = collectEntries(project, cfg);
|
PathEntryCollector cr = collectEntries(project, cfgDescription);
|
||||||
return cr.getEntries(flags, cfg);
|
return cr.getEntries(flags, cfgDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IResource getResource(IProject project, IPath workspacePath) {
|
private static IResource findResourceInWorkspace(IProject project, IPath workspacePath) {
|
||||||
IResource rc;
|
IResource rc;
|
||||||
if (project!=null) {
|
if (project != null) {
|
||||||
rc = project.findMember(workspacePath);
|
rc = project.findMember(workspacePath);
|
||||||
} else {
|
} else {
|
||||||
rc = ResourcesPlugin.getWorkspace().getRoot().findMember(workspacePath);
|
rc = ResourcesPlugin.getWorkspace().getRoot().findMember(workspacePath);
|
||||||
|
|
Loading…
Add table
Reference in a new issue