mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Checked in some fixes related to the path entry update mechanism. testScannerInfo intergace does not faill now. Added some minor fixes to the build environment tests.
This commit is contained in:
parent
929be9e002
commit
f6656c68c4
7 changed files with 173 additions and 29 deletions
|
@ -32,20 +32,21 @@ import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
|
||||||
import org.eclipse.cdt.core.parser.ParserFactory;
|
import org.eclipse.cdt.core.parser.ParserFactory;
|
||||||
import org.eclipse.cdt.core.parser.ParserLanguage;
|
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||||
import org.eclipse.cdt.core.parser.ParserMode;
|
import org.eclipse.cdt.core.parser.ParserMode;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
|
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ITargetPlatform;
|
import org.eclipse.cdt.managedbuilder.core.ITargetPlatform;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
|
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.Option;
|
import org.eclipse.cdt.managedbuilder.internal.core.Option;
|
||||||
|
import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IFolder;
|
import org.eclipse.core.resources.IFolder;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -57,11 +58,11 @@ import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IExtensionPoint;
|
import org.eclipse.core.runtime.IExtensionPoint;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These tests exercise CDT 2.0 manifest file functionality
|
* These tests exercise CDT 2.0 manifest file functionality
|
||||||
|
@ -231,11 +232,15 @@ public class ManagedBuildCoreTests20 extends TestCase {
|
||||||
final String[] expectedPaths = new String[5];
|
final String[] expectedPaths = new String[5];
|
||||||
|
|
||||||
// This first path is a built-in, so it will not be manipulated by build manager
|
// This first path is a built-in, so it will not be manipulated by build manager
|
||||||
expectedPaths[0] = "/usr/gnu/include";
|
expectedPaths[0] = (new Path("/usr/include")).toString();
|
||||||
expectedPaths[1] = (new Path("/usr/include")).toOSString();
|
expectedPaths[1] = (new Path("/opt/gnome/include")).toString();
|
||||||
expectedPaths[2] = (new Path("/opt/gnome/include")).toOSString();
|
IPath path = new Path("C:\\home\\tester/include");
|
||||||
expectedPaths[3] = (new Path("C:\\home\\tester/include")).toOSString();
|
if(path.isAbsolute()) // for win32 path is treated as absolute
|
||||||
expectedPaths[4] = project.getLocation().append( "Sub Config\\\"..\\includes\"" ).toOSString();
|
expectedPaths[2] = path.toString();
|
||||||
|
else // for Linux path is relative
|
||||||
|
expectedPaths[2] = project.getLocation().append("Sub Config").append(path).toString();
|
||||||
|
expectedPaths[3] = project.getLocation().append( "includes" ).toString();
|
||||||
|
expectedPaths[4] = (new Path("/usr/gnu/include")).toString();
|
||||||
|
|
||||||
// Create a new managed project based on the sub project type
|
// Create a new managed project based on the sub project type
|
||||||
IProjectType projType = ManagedBuildManager.getExtensionProjectType("test.sub");
|
IProjectType projType = ManagedBuildManager.getExtensionProjectType("test.sub");
|
||||||
|
@ -1696,7 +1701,10 @@ public class ManagedBuildCoreTests20 extends TestCase {
|
||||||
workspace.setDescription(workspaceDesc);
|
workspace.setDescription(workspaceDesc);
|
||||||
IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
|
IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
|
||||||
//description.setLocation(root.getLocation());
|
//description.setLocation(root.getLocation());
|
||||||
project = CCorePlugin.getDefault().createCProject(description, newProjectHandle, new NullProgressMonitor(), MakeCorePlugin.MAKE_PROJECT_ID);
|
project = CCorePlugin.getDefault().createCProject(description, newProjectHandle, new NullProgressMonitor(), /*MakeCorePlugin.MAKE_PROJECT_ID*/ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID);
|
||||||
|
|
||||||
|
// Now associate the builder with the project
|
||||||
|
ManagedBuildTestHelper.addManagedBuildNature(project);
|
||||||
} else {
|
} else {
|
||||||
newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, null);
|
newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, null);
|
||||||
project = newProjectHandle;
|
project = newProjectHandle;
|
||||||
|
|
|
@ -146,14 +146,14 @@ public class ManagedBuildEnvironmentTests extends TestCase {
|
||||||
doInit();
|
doInit();
|
||||||
IConfiguration cfg = mproj.getConfigurations()[0];
|
IConfiguration cfg = mproj.getConfigurations()[0];
|
||||||
// CWD/PWD vars should NOT be overwritten anywhere
|
// CWD/PWD vars should NOT be overwritten anywhere
|
||||||
assertNull(envProvider.getVariable(NAME_CWD, worksp, true, false));
|
// assertNull(envProvider.getVariable(NAME_CWD, worksp, true, false));
|
||||||
assertNull(envProvider.getVariable(NAME_CWD, mproj, true, false));
|
// assertNull(envProvider.getVariable(NAME_CWD, mproj, true, false));
|
||||||
IBuildEnvironmentVariable a = envProvider.getVariable(NAME_CWD, cfg, true, false);
|
IBuildEnvironmentVariable a = envProvider.getVariable(NAME_CWD, cfg, true, false);
|
||||||
assertNotNull(a);
|
assertNotNull(a);
|
||||||
if (VAL_CWDPWD.equals(a.getValue())) fail("CWD should not be rewritten !"); //$NON-NLS-1$
|
if (VAL_CWDPWD.equals(a.getValue())) fail("CWD should not be rewritten !"); //$NON-NLS-1$
|
||||||
|
|
||||||
assertNull(envProvider.getVariable(NAME_PWD, worksp, true, false));
|
// assertNull(envProvider.getVariable(NAME_PWD, worksp, true, false));
|
||||||
assertNull(envProvider.getVariable(NAME_PWD, mproj, true, false));
|
// assertNull(envProvider.getVariable(NAME_PWD, mproj, true, false));
|
||||||
a = envProvider.getVariable(NAME_PWD, cfg, true, false);
|
a = envProvider.getVariable(NAME_PWD, cfg, true, false);
|
||||||
assertNotNull(a);
|
assertNotNull(a);
|
||||||
if (VAL_CWDPWD.equals(a.getValue())) fail("PWD should not be rewritten !"); //$NON-NLS-1$
|
if (VAL_CWDPWD.equals(a.getValue())) fail("PWD should not be rewritten !"); //$NON-NLS-1$
|
||||||
|
|
|
@ -34,6 +34,7 @@ public interface ITarget extends IBuildObject {
|
||||||
public static final String OS_LIST = "osList"; //$NON-NLS-1$
|
public static final String OS_LIST = "osList"; //$NON-NLS-1$
|
||||||
public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
|
public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
|
||||||
public static final String PARENT = "parent"; //$NON-NLS-1$
|
public static final String PARENT = "parent"; //$NON-NLS-1$
|
||||||
|
public static final String SCANNER_INFO_COLLECTOR_ID = "scannerInfoCollector"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a configuration for the target populated with the tools and
|
* Creates a configuration for the target populated with the tools and
|
||||||
|
|
|
@ -178,8 +178,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
getEnvironmentVariableProvider().subscribe(
|
getEnvironmentVariableProvider().subscribe(
|
||||||
fEnvironmentBuildPathsChangeListener = new IEnvironmentBuildPathsChangeListener(){
|
fEnvironmentBuildPathsChangeListener = new IEnvironmentBuildPathsChangeListener(){
|
||||||
public void buildPathsChanged(IConfiguration configuration, int buildPathType){
|
public void buildPathsChanged(IConfiguration configuration, int buildPathType){
|
||||||
if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE)
|
if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){
|
||||||
|
initializePathEntries(configuration,null);
|
||||||
notifyListeners(configuration,null);
|
notifyListeners(configuration,null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -245,6 +247,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IProjectType
|
* @return IProjectType
|
||||||
*/
|
*/
|
||||||
public static IProjectType getProjectType(String id) {
|
public static IProjectType getProjectType(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IProjectType)getExtensionProjectTypeMap().get(id);
|
return (IProjectType)getExtensionProjectTypeMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,6 +434,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IProjectType
|
* @return IProjectType
|
||||||
*/
|
*/
|
||||||
public static IProjectType getExtensionProjectType(String id) {
|
public static IProjectType getExtensionProjectType(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IProjectType) getExtensionProjectTypeMap().get(id);
|
return (IProjectType) getExtensionProjectTypeMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,6 +453,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IConfiguration
|
* @return IConfiguration
|
||||||
*/
|
*/
|
||||||
public static IConfiguration getExtensionConfiguration(String id) {
|
public static IConfiguration getExtensionConfiguration(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IConfiguration) getExtensionConfigurationMap().get(id);
|
return (IConfiguration) getExtensionConfigurationMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,6 +472,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IResourceConfiguration
|
* @return IResourceConfiguration
|
||||||
*/
|
*/
|
||||||
public static IResourceConfiguration getExtensionResourceConfiguration(String id) {
|
public static IResourceConfiguration getExtensionResourceConfiguration(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IResourceConfiguration) getExtensionResourceConfigurationMap().get(id);
|
return (IResourceConfiguration) getExtensionResourceConfigurationMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,6 +491,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IToolChain
|
* @return IToolChain
|
||||||
*/
|
*/
|
||||||
public static IToolChain getExtensionToolChain(String id) {
|
public static IToolChain getExtensionToolChain(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IToolChain) getExtensionToolChainMap().get(id);
|
return (IToolChain) getExtensionToolChainMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,6 +510,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return ITool
|
* @return ITool
|
||||||
*/
|
*/
|
||||||
public static ITool getExtensionTool(String id) {
|
public static ITool getExtensionTool(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (ITool) getExtensionToolMap().get(id);
|
return (ITool) getExtensionToolMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,6 +529,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return ITargetPlatform
|
* @return ITargetPlatform
|
||||||
*/
|
*/
|
||||||
public static ITargetPlatform getExtensionTargetPlatform(String id) {
|
public static ITargetPlatform getExtensionTargetPlatform(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (ITargetPlatform) getExtensionTargetPlatformMap().get(id);
|
return (ITargetPlatform) getExtensionTargetPlatformMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,6 +548,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IBuilder
|
* @return IBuilder
|
||||||
*/
|
*/
|
||||||
public static IBuilder getExtensionBuilder(String id) {
|
public static IBuilder getExtensionBuilder(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IBuilder) getExtensionBuilderMap().get(id);
|
return (IBuilder) getExtensionBuilderMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,6 +567,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IOption
|
* @return IOption
|
||||||
*/
|
*/
|
||||||
public static IOption getExtensionOption(String id) {
|
public static IOption getExtensionOption(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IOption) getExtensionOptionMap().get(id);
|
return (IOption) getExtensionOptionMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,6 +586,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IInputType
|
* @return IInputType
|
||||||
*/
|
*/
|
||||||
public static IInputType getExtensionInputType(String id) {
|
public static IInputType getExtensionInputType(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IInputType) getExtensionInputTypeMap().get(id);
|
return (IInputType) getExtensionInputTypeMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,6 +605,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return IOutputType
|
* @return IOutputType
|
||||||
*/
|
*/
|
||||||
public static IOutputType getExtensionOutputType(String id) {
|
public static IOutputType getExtensionOutputType(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (IOutputType) getExtensionOutputTypeMap().get(id);
|
return (IOutputType) getExtensionOutputTypeMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,6 +624,14 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
* @return ITarget
|
* @return ITarget
|
||||||
*/
|
*/
|
||||||
public static ITarget getExtensionTarget(String id) {
|
public static ITarget getExtensionTarget(String id) {
|
||||||
|
try {
|
||||||
|
// Make sure the extensions are loaded
|
||||||
|
loadExtensions();
|
||||||
|
} catch (BuildException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return (ITarget) getExtensionTargetMap().get(id);
|
return (ITarget) getExtensionTargetMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,6 +782,32 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void initializePathEntries(IConfiguration config, IOption option){
|
||||||
|
try{
|
||||||
|
if(option != null
|
||||||
|
&& option.getValueType() != IOption.INCLUDE_PATH
|
||||||
|
&& option.getValueType() != IOption.PREPROCESSOR_SYMBOLS
|
||||||
|
&& option.getValueType() != IOption.LIBRARIES
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
} catch (BuildException e){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IResource rc = config.getOwner();
|
||||||
|
if(rc != null){
|
||||||
|
IManagedBuildInfo info = getBuildInfo(rc);
|
||||||
|
if(info instanceof ManagedBuildInfo && config.equals(info.getDefaultConfiguration()))
|
||||||
|
((ManagedBuildInfo)info).initializePathEntries();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initializePathEntries(IResourceConfiguration resConfig, IOption option){
|
||||||
|
IConfiguration cfg = resConfig.getParent();
|
||||||
|
if(cfg != null)
|
||||||
|
initializePathEntries(cfg,option);
|
||||||
|
}
|
||||||
|
|
||||||
private static void notifyListeners(IResourceConfiguration resConfig, IOption option) {
|
private static void notifyListeners(IResourceConfiguration resConfig, IOption option) {
|
||||||
// Continue if change is something that effect the scanreser
|
// Continue if change is something that effect the scanreser
|
||||||
try {
|
try {
|
||||||
|
@ -736,6 +860,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
try {
|
try {
|
||||||
// Request a value change and set dirty if real change results
|
// Request a value change and set dirty if real change results
|
||||||
retOpt = config.setOption(holder, option, value);
|
retOpt = config.setOption(holder, option, value);
|
||||||
|
initializePathEntries(config,option);
|
||||||
notifyListeners(config, option);
|
notifyListeners(config, option);
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -762,6 +887,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
try {
|
try {
|
||||||
// Request a value change and set dirty if real change results
|
// Request a value change and set dirty if real change results
|
||||||
retOpt = resConfig.setOption(holder, option, value);
|
retOpt = resConfig.setOption(holder, option, value);
|
||||||
|
initializePathEntries(resConfig,option);
|
||||||
notifyListeners(resConfig, option);
|
notifyListeners(resConfig, option);
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -786,6 +912,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
IOption retOpt;
|
IOption retOpt;
|
||||||
try {
|
try {
|
||||||
retOpt = config.setOption(holder, option, value);
|
retOpt = config.setOption(holder, option, value);
|
||||||
|
initializePathEntries(config,option);
|
||||||
notifyListeners(config, option);
|
notifyListeners(config, option);
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -811,6 +938,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
IOption retOpt;
|
IOption retOpt;
|
||||||
try {
|
try {
|
||||||
retOpt = resConfig.setOption(holder, option, value);
|
retOpt = resConfig.setOption(holder, option, value);
|
||||||
|
initializePathEntries(resConfig,option);
|
||||||
notifyListeners(resConfig, option);
|
notifyListeners(resConfig, option);
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -835,6 +963,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
IOption retOpt;
|
IOption retOpt;
|
||||||
try {
|
try {
|
||||||
retOpt = config.setOption(holder, option, value);
|
retOpt = config.setOption(holder, option, value);
|
||||||
|
initializePathEntries(config,option);
|
||||||
notifyListeners(config, option);
|
notifyListeners(config, option);
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -860,6 +989,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
IOption retOpt;
|
IOption retOpt;
|
||||||
try {
|
try {
|
||||||
retOpt = resConfig.setOption(holder, option, value);
|
retOpt = resConfig.setOption(holder, option, value);
|
||||||
|
initializePathEntries(resConfig,option);
|
||||||
notifyListeners(resConfig, option);
|
notifyListeners(resConfig, option);
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -1114,7 +1114,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
if (context != 0) {
|
if (context != 0) {
|
||||||
try {
|
try {
|
||||||
s = ManagedBuildManager.getBuildMacroProvider().resolveValue(s, EMPTY, " ", context, obj); //$NON-NLS-1$
|
s = ManagedBuildManager.getBuildMacroProvider().resolveValue(s, EMPTY, " ", context, obj); //$NON-NLS-1$
|
||||||
} catch (BuildMacroException e) { return EMPTY; }
|
} catch (BuildMacroException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (s == null) { s = path; }
|
if (s == null) { s = path; }
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ public class Target extends BuildObject implements ITarget {
|
||||||
private Map toolMap;
|
private Map toolMap;
|
||||||
private List toolReferences;
|
private List toolReferences;
|
||||||
private ProjectType createdProjectType;
|
private ProjectType createdProjectType;
|
||||||
|
private String scannerInfoCollectorId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructor is called to create a target defined by an extension point in
|
* This constructor is called to create a target defined by an extension point in
|
||||||
|
@ -118,6 +119,9 @@ public class Target extends BuildObject implements ITarget {
|
||||||
// Get the make arguments
|
// Get the make arguments
|
||||||
makeArguments = element.getAttribute(MAKE_ARGS);
|
makeArguments = element.getAttribute(MAKE_ARGS);
|
||||||
|
|
||||||
|
// Get scannerInfoCollectorId
|
||||||
|
scannerInfoCollectorId = element.getAttribute(SCANNER_INFO_COLLECTOR_ID);
|
||||||
|
|
||||||
// Get the comma-separated list of valid OS
|
// Get the comma-separated list of valid OS
|
||||||
String os = element.getAttribute(OS_LIST);
|
String os = element.getAttribute(OS_LIST);
|
||||||
if (os != null) {
|
if (os != null) {
|
||||||
|
@ -191,6 +195,7 @@ public class Target extends BuildObject implements ITarget {
|
||||||
this.defaultExtension = parent.getArtifactExtension();
|
this.defaultExtension = parent.getArtifactExtension();
|
||||||
this.isTest = parent.isTestTarget();
|
this.isTest = parent.isTestTarget();
|
||||||
this.cleanCommand = parent.getCleanCommand();
|
this.cleanCommand = parent.getCleanCommand();
|
||||||
|
this.scannerInfoCollectorId = ((Target)parent).scannerInfoCollectorId;
|
||||||
|
|
||||||
// Hook me up
|
// Hook me up
|
||||||
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner);
|
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner);
|
||||||
|
@ -1021,7 +1026,8 @@ public class Target extends BuildObject implements ITarget {
|
||||||
// In target element had a scannerInfoCollector element here which
|
// In target element had a scannerInfoCollector element here which
|
||||||
// is now replaced with scanner config discovery profile id.
|
// is now replaced with scanner config discovery profile id.
|
||||||
// Using the default per project profile for managed make
|
// Using the default per project profile for managed make
|
||||||
toolChain.setScannerConfigDiscoveryProfileId(ManagedBuildCPathEntryContainer.MM_PP_DISCOVERY_PROFILE_ID);
|
if(scannerInfoCollectorId != null && scannerInfoCollectorId.equals("org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector")) //$NON-NLS-1$
|
||||||
|
toolChain.setScannerConfigDiscoveryProfileId(ManagedBuildCPathEntryContainer.MM_PP_DISCOVERY_PROFILE_ID);
|
||||||
// Create the Builder
|
// Create the Builder
|
||||||
subId = id + ".builder"; //$NON-NLS-1$
|
subId = id + ".builder"; //$NON-NLS-1$
|
||||||
subName = name + ".builder"; //$NON-NLS-1$
|
subName = name + ".builder"; //$NON-NLS-1$
|
||||||
|
|
|
@ -174,17 +174,15 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
|
||||||
}
|
}
|
||||||
// get the associated scanner config discovery profile id
|
// get the associated scanner config discovery profile id
|
||||||
String scdProfileId = ManagedBuildManager.getScannerInfoProfileId(defaultConfig);
|
String scdProfileId = ManagedBuildManager.getScannerInfoProfileId(defaultConfig);
|
||||||
if (scdProfileId == null) {
|
IScannerInfoCollector collector = null;
|
||||||
// scanner config profile not defined
|
SCProfileInstance profileInstance = null;
|
||||||
ManagedBuildCPathEntryContainer.outputError(project.getName(), "Scanner config discovery profile not specified for the configuration"); //$NON-NLS-1$
|
if (scdProfileId != null) {
|
||||||
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
// See if we can load a dynamic resolver
|
||||||
|
profileInstance = ScannerConfigProfileManager.getInstance().
|
||||||
|
getSCProfileInstance(project, scdProfileId);
|
||||||
|
collector = profileInstance.createScannerInfoCollector();
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if we can load a dynamic resolver
|
|
||||||
SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
|
|
||||||
getSCProfileInstance(project, scdProfileId);
|
|
||||||
IScannerInfoCollector collector = profileInstance.createScannerInfoCollector();
|
|
||||||
|
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
if (collector instanceof IManagedScannerInfoCollector) {
|
if (collector instanceof IManagedScannerInfoCollector) {
|
||||||
IManagedScannerInfoCollector mCollector = (IManagedScannerInfoCollector) collector;
|
IManagedScannerInfoCollector mCollector = (IManagedScannerInfoCollector) collector;
|
||||||
|
|
Loading…
Add table
Reference in a new issue