mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Bug 305146 Thread-safety of ManagedBuildManager BuildInfo.
- setLoadedBuildInfo on proj desc load & apply - volatile ManagedBuildInfo fields which might be accessed in an unsafe way - HeadlessBuilder gets configuration names from core model so it's not caught in these races. - JavaDoc + Generics + warnings
This commit is contained in:
parent
e65973c9cc
commit
31f47aedf1
6 changed files with 148 additions and 124 deletions
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.managedbuilder.core;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
|
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
|
@ -45,7 +46,9 @@ public interface IManagedBuildInfo {
|
||||||
* Add a new target to the build information for the receiver
|
* Add a new target to the build information for the receiver
|
||||||
*
|
*
|
||||||
* @param target
|
* @param target
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public void addTarget(ITarget target);
|
public void addTarget(ITarget target);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +57,9 @@ public interface IManagedBuildInfo {
|
||||||
*
|
*
|
||||||
* @param srcExt
|
* @param srcExt
|
||||||
* @return
|
* @return
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public boolean buildsFileType(String srcExt);
|
public boolean buildsFileType(String srcExt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -123,13 +128,14 @@ public interface IManagedBuildInfo {
|
||||||
/**
|
/**
|
||||||
* Returns the name of the artifact to build for the receiver.
|
* Returns the name of the artifact to build for the receiver.
|
||||||
*
|
*
|
||||||
* @return
|
* @return Name of the build artifact
|
||||||
*/
|
*/
|
||||||
public String getBuildArtifactName();
|
public String getBuildArtifactName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Answers a <code>String</code> containing the make command invocation
|
* Answers a <code>String</code> containing the make command invocation
|
||||||
* for the default configuration.
|
* for the default configuration.
|
||||||
|
* @return build command
|
||||||
*/
|
*/
|
||||||
public String getBuildCommand();
|
public String getBuildCommand();
|
||||||
|
|
||||||
|
@ -172,7 +178,7 @@ public interface IManagedBuildInfo {
|
||||||
* Answers the name of the default configuration, for example <code>Debug</code>
|
* Answers the name of the default configuration, for example <code>Debug</code>
|
||||||
* or <code>Release</code>.
|
* or <code>Release</code>.
|
||||||
*
|
*
|
||||||
* @return
|
* @return String name of default configuration
|
||||||
*/
|
*/
|
||||||
public String getConfigurationName();
|
public String getConfigurationName();
|
||||||
|
|
||||||
|
@ -180,14 +186,14 @@ public interface IManagedBuildInfo {
|
||||||
* Answers a <code>String</code> array containing the names of all the configurations
|
* Answers a <code>String</code> array containing the names of all the configurations
|
||||||
* defined for the project.
|
* defined for the project.
|
||||||
*
|
*
|
||||||
* @return
|
* @return String[] of configuration names
|
||||||
*/
|
*/
|
||||||
public String[] getConfigurationNames();
|
public String[] getConfigurationNames();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the default configuration associated with the receiver
|
* Get the default configuration associated with the receiver
|
||||||
*
|
*
|
||||||
* @return
|
* @return IConfiguration default
|
||||||
*/
|
*/
|
||||||
public IConfiguration getDefaultConfiguration();
|
public IConfiguration getDefaultConfiguration();
|
||||||
|
|
||||||
|
@ -288,7 +294,7 @@ public interface IManagedBuildInfo {
|
||||||
* Answers the extension that will be built by the current configuration
|
* Answers the extension that will be built by the current configuration
|
||||||
* for the extension passed in the argument or <code>null</code>.
|
* for the extension passed in the argument or <code>null</code>.
|
||||||
*
|
*
|
||||||
* @param resourceName
|
* @param resourceExtension
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getOutputExtension(String resourceExtension);
|
public String getOutputExtension(String resourceExtension);
|
||||||
|
@ -309,7 +315,7 @@ public interface IManagedBuildInfo {
|
||||||
* artifact. For example, a library foo, should have the prefix 'lib' and
|
* artifact. For example, a library foo, should have the prefix 'lib' and
|
||||||
* the extension '.a', so the final goal would be 'libfoo.a'
|
* the extension '.a', so the final goal would be 'libfoo.a'
|
||||||
*
|
*
|
||||||
* @param extension
|
* @param outputExtension
|
||||||
* @return the prefix or an empty string
|
* @return the prefix or an empty string
|
||||||
*/
|
*/
|
||||||
public String getOutputPrefix(String outputExtension);
|
public String getOutputPrefix(String outputExtension);
|
||||||
|
@ -326,15 +332,18 @@ public interface IManagedBuildInfo {
|
||||||
* Get the target specified in the argument.
|
* Get the target specified in the argument.
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return ITarget
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public ITarget getTarget(String id);
|
public ITarget getTarget(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all of the targets associated with the receiver.
|
* Get all of the targets associated with the receiver.
|
||||||
*
|
* @return List<ITarget>
|
||||||
* @return
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public List<ITarget> getTargets();
|
public List<ITarget> getTargets();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -450,9 +459,8 @@ public interface IManagedBuildInfo {
|
||||||
public void setDefaultConfiguration(IConfiguration configuration);
|
public void setDefaultConfiguration(IConfiguration configuration);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @param configName
|
||||||
* @param configuration
|
* @return boolean indicating if setDefaultConfiguration was successful
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean setDefaultConfiguration(String configName);
|
public boolean setDefaultConfiguration(String configName);
|
||||||
|
|
||||||
|
@ -490,7 +498,7 @@ public interface IManagedBuildInfo {
|
||||||
* only be done if a project resource or setting has been modified in a
|
* only be done if a project resource or setting has been modified in a
|
||||||
* way that would invalidate the previous build.
|
* way that would invalidate the previous build.
|
||||||
*
|
*
|
||||||
* @param <code>true</code> will force a rebuild the next time the project builds
|
* @param rebuild <code>true</code> will force a rebuild the next time the project builds
|
||||||
*/
|
*/
|
||||||
public void setRebuildState(boolean rebuild);
|
public void setRebuildState(boolean rebuild);
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ public class HeadlessBuildMessages extends NLS {
|
||||||
public static String HeadlessBuilder_no_arguments;
|
public static String HeadlessBuilder_no_arguments;
|
||||||
public static String HeadlessBuilder_NoConfigMatched;
|
public static String HeadlessBuilder_NoConfigMatched;
|
||||||
public static String HeadlessBuilder_NoProjectMatched;
|
public static String HeadlessBuilder_NoProjectMatched;
|
||||||
|
public static String HeadlessBuilder_Not_CDT_Proj;
|
||||||
public static String HeadlessBuilder_project;
|
public static String HeadlessBuilder_project;
|
||||||
public static String HeadlessBuilder_Quote;
|
public static String HeadlessBuilder_Quote;
|
||||||
public static String HeadlessBuilder_RegExSyntaxError;
|
public static String HeadlessBuilder_RegExSyntaxError;
|
||||||
|
|
|
@ -24,9 +24,11 @@ import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.regex.PatternSyntaxException;
|
import java.util.regex.PatternSyntaxException;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.resources.ACBuilder;
|
import org.eclipse.cdt.core.resources.ACBuilder;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
import org.eclipse.core.filesystem.EFS;
|
import org.eclipse.core.filesystem.EFS;
|
||||||
import org.eclipse.core.filesystem.IFileStore;
|
import org.eclipse.core.filesystem.IFileStore;
|
||||||
|
@ -56,6 +58,7 @@ import org.eclipse.equinox.app.IApplicationContext;
|
||||||
* IApplication ID: org.eclipse.cdt.managedbuilder.core.headlessbuild
|
* IApplication ID: org.eclipse.cdt.managedbuilder.core.headlessbuild
|
||||||
* Provides:
|
* Provides:
|
||||||
* - Import projects : -import {[uri:/]/path/to/project}
|
* - Import projects : -import {[uri:/]/path/to/project}
|
||||||
|
* - Import all projects in the tree : -importAll {[uri:/]/path/to/projectTreeURI}
|
||||||
* - Build projects / the workspace : -build {project_name_reg_ex/config_name_reg_ex | all}
|
* - Build projects / the workspace : -build {project_name_reg_ex/config_name_reg_ex | all}
|
||||||
* - Clean build projects / the workspace : -cleanBuild {project_name_reg_ex/config_name_reg_ex | all}
|
* - Clean build projects / the workspace : -cleanBuild {project_name_reg_ex/config_name_reg_ex | all}
|
||||||
*
|
*
|
||||||
|
@ -96,7 +99,7 @@ public class HeadlessBuilder implements IApplication {
|
||||||
/*
|
/*
|
||||||
* Find all project build configurations that match the regular expression ("project/config")
|
* Find all project build configurations that match the regular expression ("project/config")
|
||||||
*/
|
*/
|
||||||
private Map<IProject, HashSet<IConfiguration>> matchConfigurations(String regularExpression, IProject[] projectList, Map<IProject, HashSet<IConfiguration>> cfgMap) {
|
private Map<IProject, Set<ICConfigurationDescription>> matchConfigurations(String regularExpression, IProject[] projectList, Map<IProject, Set<ICConfigurationDescription>> cfgMap) {
|
||||||
try {
|
try {
|
||||||
int separatorIndex = regularExpression.indexOf('/');
|
int separatorIndex = regularExpression.indexOf('/');
|
||||||
|
|
||||||
|
@ -123,21 +126,22 @@ public class HeadlessBuilder implements IApplication {
|
||||||
if(projectMatcher.matches()) {
|
if(projectMatcher.matches()) {
|
||||||
projectMatched = true;
|
projectMatched = true;
|
||||||
// Find the configurations that match the regular expression
|
// Find the configurations that match the regular expression
|
||||||
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
|
ICProjectDescription desc = CoreModel.getDefault().getProjectDescription(project, false);
|
||||||
if (info == null)
|
if (desc == null) {
|
||||||
|
System.err.println(HeadlessBuildMessages.HeadlessBuilder_project + project.getName() + HeadlessBuildMessages.HeadlessBuilder_Not_CDT_Proj);
|
||||||
continue;
|
continue;
|
||||||
IConfiguration[] cfgs = info.getManagedProject().getConfigurations();
|
}
|
||||||
|
ICConfigurationDescription[] cfgs = desc.getConfigurations();
|
||||||
|
|
||||||
for(IConfiguration cfg : cfgs) {
|
for(ICConfigurationDescription cfg : cfgs) {
|
||||||
Matcher cfgMatcher = configPattern.matcher(cfg.getName());
|
Matcher cfgMatcher = configPattern.matcher(cfg.getName());
|
||||||
|
|
||||||
if(cfgMatcher.matches()) {
|
if(cfgMatcher.matches()) {
|
||||||
configMatched = true;
|
configMatched = true;
|
||||||
// Build this configuration for this project
|
// Build this configuration for this project
|
||||||
HashSet<IConfiguration> set = cfgMap.get(project);
|
Set<ICConfigurationDescription> set = cfgMap.get(project);
|
||||||
if(set == null){
|
if(set == null)
|
||||||
set = new HashSet<IConfiguration>();
|
set = new HashSet<ICConfigurationDescription>();
|
||||||
}
|
|
||||||
set.add(cfg);
|
set.add(cfg);
|
||||||
cfgMap.put(project, set);
|
cfgMap.put(project, set);
|
||||||
}
|
}
|
||||||
|
@ -158,12 +162,16 @@ public class HeadlessBuilder implements IApplication {
|
||||||
/*
|
/*
|
||||||
* Build the given configurations using the specified build type (FULL, CLEAN, INCREMENTAL)
|
* Build the given configurations using the specified build type (FULL, CLEAN, INCREMENTAL)
|
||||||
*/
|
*/
|
||||||
private void buildConfigurations(Map<IProject, HashSet<IConfiguration>> projConfigs, final IProgressMonitor monitor, final int buildType) throws CoreException {
|
private void buildConfigurations(Map<IProject, Set<ICConfigurationDescription>> projConfigs, final IProgressMonitor monitor, final int buildType) throws CoreException {
|
||||||
for (Map.Entry<IProject, HashSet<IConfiguration>> entry : projConfigs.entrySet()) {
|
for (Map.Entry<IProject, Set<ICConfigurationDescription>> entry : projConfigs.entrySet()) {
|
||||||
final IProject proj = entry.getKey();
|
final IProject proj = entry.getKey();
|
||||||
HashSet<IConfiguration> cfgs = entry.getValue();
|
Set<ICConfigurationDescription> cfgDescs = entry.getValue();
|
||||||
|
|
||||||
final Map<String, String> map = BuilderFactory.createBuildArgs(cfgs.toArray(new IConfiguration[cfgs.size()]));
|
IConfiguration[] configs = new IConfiguration[cfgDescs.size()];
|
||||||
|
int i = 0;
|
||||||
|
for (ICConfigurationDescription cfgDesc : cfgDescs)
|
||||||
|
configs[i++] = ManagedBuildManager.getConfigurationForDescription(cfgDesc);
|
||||||
|
final Map<String, String> map = BuilderFactory.createBuildArgs(configs);
|
||||||
|
|
||||||
IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||||
public void run(IProgressMonitor monitor) throws CoreException {
|
public void run(IProgressMonitor monitor) throws CoreException {
|
||||||
|
@ -319,7 +327,7 @@ public class HeadlessBuilder implements IApplication {
|
||||||
|
|
||||||
IProject[] allProjects = root.getProjects();
|
IProject[] allProjects = root.getProjects();
|
||||||
// Map from Project -> Configurations to build. We also Build all projects which are clean'd
|
// Map from Project -> Configurations to build. We also Build all projects which are clean'd
|
||||||
Map<IProject, HashSet<IConfiguration>> configsToBuild = new HashMap<IProject, HashSet<IConfiguration>>();
|
Map<IProject, Set<ICConfigurationDescription>> configsToBuild = new HashMap<IProject, Set<ICConfigurationDescription>>();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform the Clean / Build
|
* Perform the Clean / Build
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2007 IBM Software Corporation and others.
|
* Copyright (c) 2002, 2010 IBM Software Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -64,8 +64,8 @@ import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Concrete IManagedBuildInfo storing runtime ManagedProject metadata with utility settings for accessing
|
||||||
* @since 1.2
|
* some attributes in the default configuration
|
||||||
*/
|
*/
|
||||||
public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
// The path container used for all managed projects
|
// The path container used for all managed projects
|
||||||
|
@ -74,24 +74,23 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
//private static final QualifiedName defaultTargetProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), DEFAULT_TARGET);
|
//private static final QualifiedName defaultTargetProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), DEFAULT_TARGET);
|
||||||
public static final String MAJOR_SEPERATOR = ";"; //$NON-NLS-1$
|
public static final String MAJOR_SEPERATOR = ";"; //$NON-NLS-1$
|
||||||
public static final String MINOR_SEPERATOR = "::"; //$NON-NLS-1$
|
public static final String MINOR_SEPERATOR = "::"; //$NON-NLS-1$
|
||||||
private static final String EMPTY_STRING = new String();
|
|
||||||
|
|
||||||
private IManagedProject managedProject;
|
private volatile IManagedProject managedProject;
|
||||||
private ICProject cProject;
|
private volatile ICProject cProject;
|
||||||
// private IConfiguration defaultConfig;
|
private volatile boolean isDirty;
|
||||||
// private String defaultConfigId;
|
private volatile boolean isValid = false;
|
||||||
private boolean isDirty;
|
private volatile IResource owner;
|
||||||
private boolean isValid = false;
|
private volatile boolean rebuildNeeded;
|
||||||
private IResource owner;
|
private volatile String version;
|
||||||
private boolean rebuildNeeded;
|
private volatile IConfiguration selectedConfig;
|
||||||
private String version;
|
|
||||||
private IConfiguration selectedConfig;
|
|
||||||
|
|
||||||
private List targetList;
|
@Deprecated
|
||||||
private Map targetMap;
|
private List<ITarget> targetList;
|
||||||
|
@Deprecated
|
||||||
|
private Map<String, ITarget> targetMap;
|
||||||
|
|
||||||
private boolean isReadOnly = false;
|
private volatile boolean isReadOnly = false;
|
||||||
private boolean bIsContainerInited = false;
|
private volatile boolean bIsContainerInited = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,16 +105,6 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
// Does not need a save but should be rebuilt
|
// Does not need a save but should be rebuilt
|
||||||
isDirty = false;
|
isDirty = false;
|
||||||
rebuildNeeded = true;
|
rebuildNeeded = true;
|
||||||
|
|
||||||
// Get the default configs
|
|
||||||
// IProject project = owner.getProject();
|
|
||||||
// defaultConfigId = null;
|
|
||||||
// try {
|
|
||||||
// defaultConfigId = project.getPersistentProperty(defaultConfigProperty);
|
|
||||||
// } catch (CoreException e) {
|
|
||||||
// // Hitting this error just means the default config is not set
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -124,6 +113,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
*
|
*
|
||||||
* @param owner
|
* @param owner
|
||||||
* @param element
|
* @param element
|
||||||
|
* @param loadConfigs
|
||||||
* @param managedBuildRevision
|
* @param managedBuildRevision
|
||||||
*/
|
*/
|
||||||
public ManagedBuildInfo(IResource owner, ICStorageElement element, boolean loadConfigs, String managedBuildRevision) {
|
public ManagedBuildInfo(IResource owner, ICStorageElement element, boolean loadConfigs, String managedBuildRevision) {
|
||||||
|
@ -219,14 +209,14 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getConfigurationNames()
|
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getConfigurationNames()
|
||||||
*/
|
*/
|
||||||
public String[] getConfigurationNames() {
|
public String[] getConfigurationNames() {
|
||||||
ArrayList configNames = new ArrayList();
|
ArrayList<String> configNames = new ArrayList<String>();
|
||||||
IConfiguration[] configs = managedProject.getConfigurations();
|
IConfiguration[] configs = managedProject.getConfigurations();
|
||||||
for (int i = 0; i < configs.length; i++) {
|
for (int i = 0; i < configs.length; i++) {
|
||||||
IConfiguration configuration = configs[i];
|
IConfiguration configuration = configs[i];
|
||||||
configNames.add(configuration.getName());
|
configNames.add(configuration.getName());
|
||||||
}
|
}
|
||||||
configNames.trimToSize();
|
configNames.trimToSize();
|
||||||
return (String[])configNames.toArray(new String[configNames.size()]);
|
return configNames.toArray(new String[configNames.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICProject getCProject() {
|
public ICProject getCProject() {
|
||||||
|
@ -288,9 +278,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getDefinedSymbols()
|
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getDefinedSymbols()
|
||||||
*/
|
*/
|
||||||
public Map getDefinedSymbols() {
|
public Map<String, String> getDefinedSymbols() {
|
||||||
// Return the defined symbols for the default configuration
|
// Return the defined symbols for the default configuration
|
||||||
HashMap symbols = getMacroPathEntries();
|
HashMap<String, String> symbols = getMacroPathEntries();
|
||||||
return symbols;
|
return symbols;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,9 +372,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList getIncludePathEntries() {
|
private ArrayList<String> getIncludePathEntries() {
|
||||||
// Extract the resolved paths from the project (if any)
|
// Extract the resolved paths from the project (if any)
|
||||||
ArrayList paths = new ArrayList();
|
ArrayList<String> paths = new ArrayList<String>();
|
||||||
if (cProject != null) {
|
if (cProject != null) {
|
||||||
try {
|
try {
|
||||||
IPathEntry[] entries = cProject.getResolvedPathEntries();
|
IPathEntry[] entries = cProject.getResolvedPathEntries();
|
||||||
|
@ -412,8 +402,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
*/
|
*/
|
||||||
public String[] getIncludePaths() {
|
public String[] getIncludePaths() {
|
||||||
// Return the include paths for the default configuration
|
// Return the include paths for the default configuration
|
||||||
ArrayList paths = getIncludePathEntries();
|
ArrayList<String> paths = getIncludePathEntries();
|
||||||
return (String[])paths.toArray(new String[paths.size()]);
|
return paths.toArray(new String[paths.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -423,8 +413,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
return getDefaultConfiguration().getLibs(extension);
|
return getDefaultConfiguration().getLibs(extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
private HashMap getMacroPathEntries() {
|
private HashMap<String, String> getMacroPathEntries() {
|
||||||
HashMap macros = new HashMap();
|
HashMap<String, String> macros = new HashMap<String, String>();
|
||||||
if (cProject != null) {
|
if (cProject != null) {
|
||||||
try {
|
try {
|
||||||
IPathEntry[] entries = cProject.getResolvedPathEntries();
|
IPathEntry[] entries = cProject.getResolvedPathEntries();
|
||||||
|
@ -558,7 +548,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return IResource owner
|
||||||
*/
|
*/
|
||||||
public IResource getOwner() {
|
public IResource getOwner() {
|
||||||
return owner;
|
return owner;
|
||||||
|
@ -736,7 +726,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
*
|
*
|
||||||
* @param doc
|
* @param doc
|
||||||
* @param element
|
* @param element
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public void serializeLegacy(Document doc, Element element) {
|
public void serializeLegacy(Document doc, Element element) {
|
||||||
// Write out the managed build project
|
// Write out the managed build project
|
||||||
|
|
||||||
|
@ -746,7 +738,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
((ManagedProject)managedProject).serialize(XmlStorageUtil.createCStorageTree(projElement), true);
|
((ManagedProject)managedProject).serialize(XmlStorageUtil.createCStorageTree(projElement), true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Iterator iter = getTargets().listIterator();
|
Iterator<ITarget> iter = getTargets().listIterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
// Get the target
|
// Get the target
|
||||||
Target targ = (Target)iter.next();
|
Target targ = (Target)iter.next();
|
||||||
|
@ -836,11 +828,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
*/
|
*/
|
||||||
public void setDirty(boolean isDirty) {
|
public void setDirty(boolean isDirty) {
|
||||||
// Reset the dirty status here
|
// Reset the dirty status here
|
||||||
this.isDirty = isDirty;
|
|
||||||
// and in the managed project
|
// and in the managed project
|
||||||
if (managedProject != null) {
|
if (managedProject != null) {
|
||||||
managedProject.setDirty(isDirty);
|
managedProject.setDirty(isDirty);
|
||||||
}
|
}
|
||||||
|
this.isDirty = isDirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -864,41 +856,38 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
|
||||||
*/
|
*/
|
||||||
public void setRebuildState(boolean rebuild) {
|
public void setRebuildState(boolean rebuild) {
|
||||||
// Reset the status here
|
|
||||||
rebuildNeeded = rebuild;
|
|
||||||
// TODO: Is the appropriate? Should the rebuild state be stored in the project file?
|
// TODO: Is the appropriate? Should the rebuild state be stored in the project file?
|
||||||
// and in the managed project
|
// and in the managed project
|
||||||
if (getDefaultConfiguration() != null) {
|
if (getDefaultConfiguration() != null) {
|
||||||
getDefaultConfiguration().setRebuildState(rebuild);
|
getDefaultConfiguration().setRebuildState(rebuild);
|
||||||
}
|
}
|
||||||
|
// Reset the status here
|
||||||
|
rebuildNeeded = rebuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param version
|
* @param version
|
||||||
*/
|
*/
|
||||||
public void setVersion(String version) {
|
public void setVersion(String version) {
|
||||||
if (version != null && !version.equals(this.version)) {
|
updateRevision(version);
|
||||||
|
if (version != null && !version.equals(this.version))
|
||||||
this.version = version;
|
this.version = version;
|
||||||
//setDirty(true); - It is primarily up to the ManagedProject to maintain the dirty state
|
//setDirty(true); - It is primarily up to the ManagedProject to maintain the dirty state
|
||||||
}
|
|
||||||
updateRevision(version);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param boolean
|
* @param bInited
|
||||||
*/
|
*/
|
||||||
public void setContainerInited(boolean bInited) {
|
public void setContainerInited(boolean bInited) {
|
||||||
bIsContainerInited = bInited;
|
bIsContainerInited = bInited;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
// Just print out the name of the project
|
// Just print out the name of the project
|
||||||
return "Managed build information for " + owner.getName(); //$NON-NLS-1$
|
return "Managed build information for " + owner.getName(); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the owner of the receiver to be the <code>IResource</code> specified
|
* Sets the owner of the receiver to be the <code>IResource</code> specified
|
||||||
* in the argument.
|
* in the argument.
|
||||||
|
@ -909,20 +898,21 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
// Check to see if the owner is the same as the argument
|
// Check to see if the owner is the same as the argument
|
||||||
if (resource != null) {
|
if (resource != null) {
|
||||||
if (!owner.equals(resource)) {
|
if (!owner.equals(resource)) {
|
||||||
owner = resource;
|
// Update owner on the managed project
|
||||||
// Do the same for the managed project
|
|
||||||
if(managedProject != null)
|
if(managedProject != null)
|
||||||
managedProject.updateOwner(resource);
|
managedProject.updateOwner(resource);
|
||||||
// And finally update the cModelElement
|
// And finally update the cModelElement
|
||||||
cProject = CoreModel.getDefault().create(owner.getProject());
|
cProject = CoreModel.getDefault().create(resource.getProject());
|
||||||
|
|
||||||
// Save everything
|
// Save everything
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
setRebuildState(true);
|
setRebuildState(true);
|
||||||
|
// Finally update this managedbuild info's owner
|
||||||
|
owner = resource;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getSelectedConfiguration()
|
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getSelectedConfiguration()
|
||||||
*/
|
*/
|
||||||
|
@ -945,6 +935,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#addTarget(org.eclipse.cdt.core.build.managed.ITarget)
|
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#addTarget(org.eclipse.cdt.core.build.managed.ITarget)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public void addTarget(ITarget target) {
|
public void addTarget(ITarget target) {
|
||||||
getTargetMap().put(target.getId(), target);
|
getTargetMap().put(target.getId(), target);
|
||||||
getTargets().add(target);
|
getTargets().add(target);
|
||||||
|
@ -954,6 +945,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#removeTarget(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#removeTarget(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public void removeTarget(String id) {
|
public void removeTarget(String id) {
|
||||||
getTargets().remove(getTarget(id));
|
getTargets().remove(getTarget(id));
|
||||||
getTargetMap().remove(id);
|
getTargetMap().remove(id);
|
||||||
|
@ -961,11 +953,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Deprecated
|
||||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getTarget(org.eclipse.cdt.core.build.managed.IConfiguration)
|
|
||||||
*/
|
|
||||||
public ITarget getTarget(String id) {
|
public ITarget getTarget(String id) {
|
||||||
return (ITarget) getTargetMap().get(id);
|
return getTargetMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -973,19 +963,22 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
*
|
*
|
||||||
* @return Returns the map of IDs to ITargets.
|
* @return Returns the map of IDs to ITargets.
|
||||||
*/
|
*/
|
||||||
private Map getTargetMap() {
|
@Deprecated
|
||||||
|
private Map<String, ITarget> getTargetMap() {
|
||||||
if (targetMap == null) {
|
if (targetMap == null) {
|
||||||
targetMap = new HashMap();
|
targetMap = new HashMap<String, ITarget>();
|
||||||
}
|
}
|
||||||
return targetMap;
|
return targetMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getTargets(org.eclipse.cdt.core.build.managed.IConfiguration)
|
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getTargets(org.eclipse.cdt.core.build.managed.IConfiguration)
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public List getTargets() {
|
@Deprecated
|
||||||
|
public List<ITarget> getTargets() {
|
||||||
if (targetList == null) {
|
if (targetList == null) {
|
||||||
targetList = new ArrayList();
|
targetList = new ArrayList<ITarget>();
|
||||||
}
|
}
|
||||||
return targetList;
|
return targetList;
|
||||||
}
|
}
|
||||||
|
@ -997,13 +990,13 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
private String getCWD() {
|
private String getCWD() {
|
||||||
String cwd = ""; //$NON-NLS-1$
|
String cwd = ""; //$NON-NLS-1$
|
||||||
IBuildEnvironmentVariable cwdvar = ManagedBuildManager.getEnvironmentVariableProvider().getVariable("CWD", getDefaultConfiguration(), false, true); //$NON-NLS-1$
|
IBuildEnvironmentVariable cwdvar = ManagedBuildManager.getEnvironmentVariableProvider().getVariable("CWD", getDefaultConfiguration(), false, true); //$NON-NLS-1$
|
||||||
if (cwdvar != null) { cwd = cwdvar.getValue().replace('\\','/'); } //$NON-NLS-1$ //$NON-NLS-2$
|
if (cwdvar != null) { cwd = cwdvar.getValue().replace('\\','/'); }
|
||||||
return cwd;
|
return cwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private List processPath(List list, String path, int context, Object obj) {
|
private List<String> processPath(List<String> list, String path, int context, Object obj) {
|
||||||
final String EMPTY = ""; //$NON-NLS-1$
|
final String EMPTY = ""; //$NON-NLS-1$
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
if (context != 0) {
|
if (context != 0) {
|
||||||
|
@ -1067,10 +1060,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain all possible Managed build values
|
* Obtain all possible Managed build values
|
||||||
* @return
|
* @return IPathEntry[]
|
||||||
*/
|
*/
|
||||||
public IPathEntry[] getManagedBuildValues() {
|
public IPathEntry[] getManagedBuildValues() {
|
||||||
List entries = new ArrayList();
|
List<IPathEntry> entries = new ArrayList<IPathEntry>();
|
||||||
int i=0;
|
int i=0;
|
||||||
IPathEntry[] a = getManagedBuildValues(IPathEntry.CDT_INCLUDE);
|
IPathEntry[] a = getManagedBuildValues(IPathEntry.CDT_INCLUDE);
|
||||||
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
||||||
|
@ -1078,15 +1071,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
||||||
a = getManagedBuildValues(IPathEntry.CDT_MACRO);
|
a = getManagedBuildValues(IPathEntry.CDT_MACRO);
|
||||||
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
||||||
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
return entries.toArray(new IPathEntry[entries.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain all possible Managed build built-ins
|
* Obtain all possible Managed build built-ins
|
||||||
* @return
|
* @return IPathEntry[]
|
||||||
*/
|
*/
|
||||||
public IPathEntry[] getManagedBuildBuiltIns() {
|
public IPathEntry[] getManagedBuildBuiltIns() {
|
||||||
List entries = new ArrayList();
|
List<IPathEntry> entries = new ArrayList<IPathEntry>();
|
||||||
int i=0;
|
int i=0;
|
||||||
IPathEntry[] a = getManagedBuildBuiltIns(IPathEntry.CDT_INCLUDE);
|
IPathEntry[] a = getManagedBuildBuiltIns(IPathEntry.CDT_INCLUDE);
|
||||||
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
||||||
|
@ -1094,33 +1087,33 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
||||||
a = getManagedBuildBuiltIns(IPathEntry.CDT_MACRO);
|
a = getManagedBuildBuiltIns(IPathEntry.CDT_MACRO);
|
||||||
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
|
||||||
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
return entries.toArray(new IPathEntry[entries.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param entryType
|
* @param entryType
|
||||||
* @return
|
* @return IPathEntry[]
|
||||||
*/
|
*/
|
||||||
public IPathEntry[] getManagedBuildValues(int entryType) {
|
public IPathEntry[] getManagedBuildValues(int entryType) {
|
||||||
// obtain option values
|
// obtain option values
|
||||||
List entries = getOptionValues(entryType, false);
|
List<IPathEntry> entries = getOptionValues(entryType, false);
|
||||||
|
|
||||||
// for includes, get env variables values; useless for other entry types
|
// for includes, get env variables values; useless for other entry types
|
||||||
if (entryType == IPathEntry.CDT_INCLUDE) {
|
if (entryType == IPathEntry.CDT_INCLUDE) {
|
||||||
IEnvironmentVariableProvider env = ManagedBuildManager.getEnvironmentVariableProvider();
|
IEnvironmentVariableProvider env = ManagedBuildManager.getEnvironmentVariableProvider();
|
||||||
entries = addIncludes(entries, env.getBuildPaths(getDefaultConfiguration(), IEnvVarBuildPath.BUILDPATH_INCLUDE), Path.EMPTY, 0, null);
|
entries = addIncludes(entries, env.getBuildPaths(getDefaultConfiguration(), IEnvVarBuildPath.BUILDPATH_INCLUDE), Path.EMPTY, 0, null);
|
||||||
}
|
}
|
||||||
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
return entries.toArray(new IPathEntry[entries.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param entryType
|
* @param entryType
|
||||||
* @return
|
* @return IPathEntry[]
|
||||||
*/
|
*/
|
||||||
public IPathEntry[] getManagedBuildBuiltIns(int entryType) {
|
public IPathEntry[] getManagedBuildBuiltIns(int entryType) {
|
||||||
List entries = getOptionValues(entryType, true);
|
List<IPathEntry> entries = getOptionValues(entryType, true);
|
||||||
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
return entries.toArray(new IPathEntry[entries.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1129,8 +1122,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @param builtIns - return either values or built-in's
|
* @param builtIns - return either values or built-in's
|
||||||
* @return list of strings which contains all found values
|
* @return list of strings which contains all found values
|
||||||
*/
|
*/
|
||||||
private List getOptionValues(int entryType, boolean builtIns) {
|
private List<IPathEntry> getOptionValues(int entryType, boolean builtIns) {
|
||||||
List entries = new ArrayList();
|
List<IPathEntry> entries = new ArrayList<IPathEntry>();
|
||||||
IConfiguration cfg = getDefaultConfiguration();
|
IConfiguration cfg = getDefaultConfiguration();
|
||||||
|
|
||||||
// process config toolchain's options
|
// process config toolchain's options
|
||||||
|
@ -1171,7 +1164,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @param builtIns - whether get actual values or builtins
|
* @param builtIns - whether get actual values or builtins
|
||||||
* @param obj - object to be processed (ResCfg | Cfg)
|
* @param obj - object to be processed (ResCfg | Cfg)
|
||||||
*/
|
*/
|
||||||
private List readToolsOptions(int entryType, List entries, boolean builtIns, IBuildObject obj) {
|
private List<IPathEntry> readToolsOptions(int entryType, List<IPathEntry> entries, boolean builtIns, IBuildObject obj) {
|
||||||
ITool[] t = null;
|
ITool[] t = null;
|
||||||
IPath resPath = Path.EMPTY;
|
IPath resPath = Path.EMPTY;
|
||||||
|
|
||||||
|
@ -1232,28 +1225,30 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @param entries
|
* @param entries
|
||||||
* @param values
|
* @param values
|
||||||
* @param resPath
|
* @param resPath
|
||||||
* @param ocd
|
* @param context
|
||||||
|
* @param obj
|
||||||
|
* @return List<IPathEntry>
|
||||||
*/
|
*/
|
||||||
protected List addIncludes(List entries, String[] values, IPath resPath, int context ,Object obj) {
|
protected List<IPathEntry> addIncludes(List<IPathEntry> entries, String[] values, IPath resPath, int context ,Object obj) {
|
||||||
return addPaths(entries, values, resPath, context, obj, IPathEntry.CDT_INCLUDE);
|
return addPaths(entries, values, resPath, context, obj, IPathEntry.CDT_INCLUDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List addPaths(List entries, String[] values, IPath resPath, int context ,Object obj, int type){
|
protected List<IPathEntry> addPaths(List<IPathEntry> entries, String[] values, IPath resPath, int context ,Object obj, int type){
|
||||||
if (values != null && values.length > 0) {
|
if (values != null && values.length > 0) {
|
||||||
List list = new ArrayList();
|
List<String> list = new ArrayList<String>();
|
||||||
for (int k=0; k<values.length; k++) {
|
for (int k=0; k<values.length; k++) {
|
||||||
processPath(list, values[k], context, obj);
|
processPath(list, values[k], context, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator iter = list.iterator();
|
Iterator<String> iter = list.iterator();
|
||||||
while(iter.hasNext()){
|
while(iter.hasNext()){
|
||||||
IPathEntry entry = null;
|
IPathEntry entry = null;
|
||||||
switch(type){
|
switch(type){
|
||||||
case IPathEntry.CDT_INCLUDE:
|
case IPathEntry.CDT_INCLUDE:
|
||||||
entry = CoreModel.newIncludeEntry(resPath, Path.EMPTY, new Path((String)iter.next()), true);
|
entry = CoreModel.newIncludeEntry(resPath, Path.EMPTY, new Path(iter.next()), true);
|
||||||
break;
|
break;
|
||||||
case IPathEntry.CDT_LIBRARY:
|
case IPathEntry.CDT_LIBRARY:
|
||||||
entry = CoreModel.newLibraryEntry(resPath, Path.EMPTY, new Path((String)iter.next()), null, null, null, true);
|
entry = CoreModel.newLibraryEntry(resPath, Path.EMPTY, new Path(iter.next()), null, null, null, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (entry != null && !entries.contains(entry)) { entries.add(entry); }
|
if (entry != null && !entries.contains(entry)) { entries.add(entry); }
|
||||||
|
@ -1267,9 +1262,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @param entries
|
* @param entries
|
||||||
* @param values
|
* @param values
|
||||||
* @param resPath
|
* @param resPath
|
||||||
* @param ocd
|
* @param context
|
||||||
|
* @param obj
|
||||||
|
* @return List<IPathEntry>
|
||||||
*/
|
*/
|
||||||
protected List addLibraries(List entries, String[] values, IPath resPath, int context, Object obj) {
|
protected List<IPathEntry> addLibraries(List<IPathEntry> entries, String[] values, IPath resPath, int context, Object obj) {
|
||||||
return addPaths(entries, values, resPath, context, obj, IPathEntry.CDT_LIBRARY);
|
return addPaths(entries, values, resPath, context, obj, IPathEntry.CDT_LIBRARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1278,8 +1275,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @param entries
|
* @param entries
|
||||||
* @param values
|
* @param values
|
||||||
* @param resPath
|
* @param resPath
|
||||||
|
* @param context
|
||||||
|
* @param obj
|
||||||
|
* @return List<IPathEntry>
|
||||||
*/
|
*/
|
||||||
protected List addSymbols(List entries, String[] values, IPath resPath, int context, Object obj) {
|
protected List<IPathEntry> addSymbols(List<IPathEntry> entries, String[] values, IPath resPath, int context, Object obj) {
|
||||||
if (values == null) return entries;
|
if (values == null) return entries;
|
||||||
for (int i=0; i<values.length; i++) {
|
for (int i=0; i<values.length; i++) {
|
||||||
try {
|
try {
|
||||||
|
@ -1295,7 +1295,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List createMacroEntry(List entries, String val, IPath resPath){
|
private List<IPathEntry> createMacroEntry(List<IPathEntry> entries, String val, IPath resPath){
|
||||||
if (val != null && val.length() != 0){
|
if (val != null && val.length() != 0){
|
||||||
|
|
||||||
String[] tokens = val.split("="); //$NON-NLS-1$
|
String[] tokens = val.split("="); //$NON-NLS-1$
|
||||||
|
@ -1303,9 +1303,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
String value = (tokens.length > 1) ? tokens[1].trim() : new String();
|
String value = (tokens.length > 1) ? tokens[1].trim() : new String();
|
||||||
// Make sure the current entries do not contain a duplicate
|
// Make sure the current entries do not contain a duplicate
|
||||||
boolean add = true;
|
boolean add = true;
|
||||||
Iterator entryIter = entries.listIterator();
|
Iterator<IPathEntry> entryIter = entries.listIterator();
|
||||||
while (entryIter.hasNext()) {
|
while (entryIter.hasNext()) {
|
||||||
IPathEntry entry = (IPathEntry) entryIter.next();
|
IPathEntry entry = entryIter.next();
|
||||||
if (entry.getEntryKind() == IPathEntry.CDT_MACRO) {
|
if (entry.getEntryKind() == IPathEntry.CDT_MACRO) {
|
||||||
if (((IMacroEntry)entry).getMacroName().equals(key) &&
|
if (((IMacroEntry)entry).getMacroName().equals(key) &&
|
||||||
((IMacroEntry)entry).getMacroValue().equals(value)) {
|
((IMacroEntry)entry).getMacroValue().equals(value)) {
|
||||||
|
|
|
@ -174,6 +174,7 @@ HeadlessBuilder_is_not_valid_in_workspace=\ is not valid in the workspace\!
|
||||||
HeadlessBuilder_no_arguments=No arguments specified.
|
HeadlessBuilder_no_arguments=No arguments specified.
|
||||||
HeadlessBuilder_NoConfigMatched=WARNING: No Config matched "
|
HeadlessBuilder_NoConfigMatched=WARNING: No Config matched "
|
||||||
HeadlessBuilder_NoProjectMatched=WARNING: No Project matched "
|
HeadlessBuilder_NoProjectMatched=WARNING: No Project matched "
|
||||||
|
HeadlessBuilder_Not_CDT_Proj=\ doesn't appear to be a CDT project. Skipping...
|
||||||
HeadlessBuilder_project=Project:
|
HeadlessBuilder_project=Project:
|
||||||
HeadlessBuilder_Quote="
|
HeadlessBuilder_Quote="
|
||||||
HeadlessBuilder_RegExSyntaxError=Project/Configuration Regular Expression Syntax error:
|
HeadlessBuilder_RegExSyntaxError=Project/Configuration Regular Expression Syntax error:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2010 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -170,7 +170,10 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
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
|
||||||
|
// ManagedBuildManager#getBuildInfo(...) see Bug 305146 for more
|
||||||
|
ManagedBuildManager.setLoaddedBuildInfo(des.getProjectDescription().getProject(), info);
|
||||||
|
|
||||||
setPersistedFlag(des);
|
setPersistedFlag(des);
|
||||||
cacheNaturesIdsUsedOnCache(des);
|
cacheNaturesIdsUsedOnCache(des);
|
||||||
|
|
||||||
|
@ -543,6 +546,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
info.setValid(true);
|
info.setValid(true);
|
||||||
setPersistedFlag(des);
|
setPersistedFlag(des);
|
||||||
cacheNaturesIdsUsedOnCache(des);
|
cacheNaturesIdsUsedOnCache(des);
|
||||||
|
// Update the ManagedBuildInfo in the ManagedBuildManager map. Doing this creates a barrier for subsequent
|
||||||
|
// ManagedBuildManager#getBuildInfo(...) see Bug 305146 for more
|
||||||
|
ManagedBuildManager.setLoaddedBuildInfo(des.getProjectDescription().getProject(), info);
|
||||||
return cfg.getConfigurationData();
|
return cfg.getConfigurationData();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue