org.eclipse.cdt.managedbuilder.core
Class ManagedBuildManager

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.cdt.internal.core.InternalCExtension
          extended by org.eclipse.cdt.core.AbstractCExtension
              extended by org.eclipse.cdt.managedbuilder.core.ManagedBuildManager
All Implemented Interfaces:
ICExtension, IScannerInfoProvider, org.eclipse.core.runtime.IAdaptable

public class ManagedBuildManager
extends AbstractCExtension
implements IScannerInfoProvider

This is the main entry point for getting at the build information for the managed build system.


Field Summary
static java.lang.String BUILD_ARTEFACT_TYPE_PROPERTY_EXE
           
static java.lang.String BUILD_ARTEFACT_TYPE_PROPERTY_ID
           
static java.lang.String BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB
           
static java.lang.String BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB
           
static java.lang.String BUILD_TYPE_PROPERTY_DEBUG
           
static java.lang.String BUILD_TYPE_PROPERTY_ID
           
static java.lang.String BUILD_TYPE_PROPERTY_RELEASE
           
static java.lang.String CFG_DATA_PROVIDER_ID
           
static int ERROR_CATEGORY
           
static int ERROR_FILTER
           
static java.lang.String EXTENSION_POINT_ID
           
static java.lang.String EXTENSION_POINT_ID_V2
           
static java.lang.String INTERFACE_IDENTITY
           
static java.lang.String INTERNAL_BUILDER_ID
           
static java.lang.String MANIFEST_ERROR_DUPLICATE
           
static java.lang.String MANIFEST_ERROR_ICON
           
static java.lang.String MANIFEST_ERROR_RESOLVING
           
static java.util.SortedMap projectTypeMap
           
static java.lang.String SETTINGS_FILE_NAME
           
 
Constructor Summary
ManagedBuildManager()
           
 
Method Summary
static void addExtensionBuilder(Builder builder)
          Adds a Builder that is is specified in the manifest to the build system.
static void addExtensionConfiguration(Configuration configuration)
          Adds a Configuration that is is specified in the manifest to the build system.
static void addExtensionInputType(InputType inputType)
          Adds an InputType that is is specified in the manifest to the build system.
static void addExtensionOption(Option option)
          Adds a Option that is is specified in the manifest to the build system.
static void addExtensionOptionCategory(OptionCategory optionCategory)
          Adds a OptionCategory that is is specified in the manifest to the build system.
static void addExtensionOutputType(OutputType outputType)
          Adds an OutputType that is is specified in the manifest to the build system.
static void addExtensionProjectType(ProjectType projectType)
          Adds a ProjectType that is is specified in the manifest to the build system.
static void addExtensionResourceConfiguration(ResourceConfiguration resourceConfiguration)
          Adds a Resource Configuration that is is specified in the manifest to the build system.
static void addExtensionTarget(Target target)
          Adds a Target that is is specified in the manifest to the build system.
static void addExtensionTargetPlatform(TargetPlatform targetPlatform)
          Adds a TargetPlatform that is is specified in the manifest to the build system.
static void addExtensionTool(Tool tool)
          Adds a tool that is is specified in the manifest to the build system.
static void addExtensionToolChain(ToolChain toolChain)
          Adds a ToolChain that is is specified in the manifest to the build system.
static void buildConfigurations(IConfiguration[] configs, IBuilder builder, org.eclipse.core.runtime.IProgressMonitor monitor)
           
static void buildConfigurations(IConfiguration[] configs, org.eclipse.core.runtime.IProgressMonitor monitor)
           
static java.lang.String calculateChildId(java.lang.String superId, java.lang.String suffix)
           
static org.eclipse.core.runtime.IPath calculateRelativePath(org.eclipse.core.runtime.IPath container, org.eclipse.core.runtime.IPath contents)
          Calculate a relative path given the full path to a folder and a file
static boolean canGetBuildInfo(org.eclipse.core.resources.IResource resource)
          Determines if the managed build information for the argument can be found.
static IBuildObject convert(IBuildObject buildObj, java.lang.String toId, boolean userhasConfirmed)
           
static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg, java.lang.String eclipseBuilderID)
           
static IBuilder[] createBuilders(org.eclipse.core.resources.IProject project, java.util.Map args)
           
static ManagedBuildInfo createBuildInfo(org.eclipse.core.resources.IResource resource)
           
static IBuilder createCustomBuilder(IConfiguration cfg, IBuilder base)
           
static IBuilder createCustomBuilder(IConfiguration cfg, java.lang.String builderId)
           
static IManagedProject createManagedProject(org.eclipse.core.resources.IResource resource, IProjectType parent)
          Creates a new project instance for the resource based on the parent project type.
static ITarget createTarget(org.eclipse.core.resources.IResource resource, ITarget parentTarget)
          Creates a new target for the resource based on the parentTarget.
static int entryKindToOptionType(int kind)
           
static int entryKindToUndefOptionType(int kind)
           
static IBuilder[] findIdenticalBuilders(IBuilder b)
           
static IToolChain[] findIdenticalToolChains(IToolChain tc)
           
static ITool[] findIdenticalTools(ITool tool)
           
static java.lang.String fullPathToLocation(java.lang.String path)
           
static IManagedBuilderMakefileGenerator getBuildfileGenerator(IConfiguration config)
           
static org.eclipse.core.runtime.IPath getBuildFullPath(IConfiguration cfg, IBuilder builder)
           
static IManagedBuildInfo getBuildInfo(org.eclipse.core.resources.IResource resource)
          Finds, but does not create, the managed build information for the argument.
static IManagedBuildInfo getBuildInfo(org.eclipse.core.resources.IResource resource, boolean forceLoad)
          Finds, but does not create, the managed build information for the argument.
static IManagedBuildInfo getBuildInfoLegacy(org.eclipse.core.resources.IProject project)
           
static org.eclipse.core.runtime.PluginVersionIdentifier getBuildInfoVersion()
          Answers the current version of the managed builder plugin.
static org.eclipse.core.runtime.IPath getBuildLocation(IConfiguration cfg, IBuilder builder)
           
static IBuildMacroProvider getBuildMacroProvider()
          Returns the instance of the Build Macro Provider
static IBuildPropertyManager getBuildPropertyManager()
           
static IManagedCommandLineGenerator getCommandLineGenerator(IConfiguration config, java.lang.String toolId)
          load tool provider defined or default (if not found) command line generator special for selected tool
static IManagedConfigElement getConfigElement(IBuildObject buildObj)
          This method public for implementation reasons.
static IConfiguration getConfigurationForDescription(org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfgDes)
           
static java.util.Map getConversionElements(IBuildObject buildObj)
           
static IProjectType[] getDefinedProjectTypes()
          Returns the list of project types that are defined by this project, projects referenced by this project, and by the extensions.
static org.eclipse.cdt.core.settings.model.ICConfigurationDescription getDescriptionForConfiguration(IConfiguration cfg)
           
static IEnvironmentVariableProvider getEnvironmentVariableProvider()
          Returns the instance of the Environment Variable Provider
static IBuilder getExtensionBuilder(IBuilder builder)
           
static IBuilder getExtensionBuilder(java.lang.String id)
          Returns the builder from the manifest with the ID specified in the argument or null.
static java.util.SortedMap getExtensionBuilderMap()
           
static IConfiguration getExtensionConfiguration(java.lang.String id)
          Returns the configuration from the manifest with the ID specified in the argument or null.
static IConfiguration[] getExtensionConfigurations(IToolChain tChain, IProjectType type)
           
static IConfiguration[] getExtensionConfigurations(IToolChain tChain, java.lang.String propertyType, java.lang.String propertyValue)
           
static IInputType getExtensionInputType(IInputType inType)
           
static IInputType getExtensionInputType(java.lang.String id)
          Returns the InputType from the manifest with the ID specified in the argument or null.
static IOption getExtensionOption(java.lang.String id)
          Returns the option from the manifest with the ID specified in the argument or null.
static IOutputType getExtensionOutputType(java.lang.String id)
          Returns the OutputType from the manifest with the ID specified in the argument or null.
static IProjectType getExtensionProjectType(java.lang.String id)
          Returns the project type from the manifest with the ID specified in the argument or null.
static java.util.SortedMap getExtensionProjectTypeMap()
           
static IResourceConfiguration getExtensionResourceConfiguration(java.lang.String id)
          Returns the resource configuration from the manifest with the ID specified in the argument or null.
static IToolChain[] getExtensionsToolChains(java.lang.String propertyType, java.lang.String propertyValue)
           
static IToolChain[] getExtensionsToolChains(java.lang.String propertyType, java.lang.String propertyValue, boolean supportedPropsOnly)
           
static ITarget getExtensionTarget(java.lang.String id)
          Returns the target from the manifest with the ID specified in the argument or null - CDT V2.0 object model.
static ITargetPlatform getExtensionTargetPlatform(java.lang.String id)
          Returns the target platform from the manifest with the ID specified in the argument or null.
static ITool getExtensionTool(ITool tool)
           
static ITool getExtensionTool(java.lang.String id)
          Returns the tool from the manifest with the ID specified in the argument or null.
static IToolChain getExtensionToolChain(IToolChain tc)
           
static IToolChain getExtensionToolChain(java.lang.String id)
          Returns the tool-chain from the manifest with the ID specified in the argument or null.
static java.util.SortedMap getExtensionToolChainMap()
           
static IToolChain[] getExtensionToolChains(IProjectType type)
           
static java.util.SortedMap getExtensionToolMap()
           
static IConfiguration getFirstExtensionConfiguration(IToolChain tChain)
           
static java.lang.String getIdFromIdAndVersion(java.lang.String idAndVersion)
          If the input to this function contains 'id & a valid version', it returns only the 'id' part Otherwise it returns the received input back.
static IBuilder getInternalBuilder()
           
static IManagedBuildInfo getOldStyleBuildInfo(org.eclipse.core.resources.IProject project)
           
static IConfiguration getPreferenceConfiguration(boolean write)
           
static IProjectType getProjectType(java.lang.String id)
          Returns the project type with the passed in ID
static int getRandomNumber()
          Returns the next random number.
static IBuilder getRealBuilder(IBuilder builder)
           
static IBuilder[] getRealBuilders()
           
static ITool getRealTool(ITool tool)
           
static IToolChain getRealToolChain(IToolChain tc)
           
static IToolChain[] getRealToolChains()
           
static ITool[] getRealTools()
           
static IConfiguration[] getReferencedConfigurations(IConfiguration config)
          Returns the configurations referenced by this configuration.
static java.lang.String getScannerInfoProfileId(IConfiguration config)
          Targets may have a scanner config discovery profile defined that knows how to discover built-in compiler defines and includes search paths.
 org.eclipse.cdt.core.parser.IScannerInfo getScannerInformation(org.eclipse.core.resources.IResource resource)
          The receiver will answer the current state of the build information for the resource specified in the argument.
static IConfiguration getSelectedConfiguration(org.eclipse.core.resources.IProject project)
          Gets the currently selected target.
static ITarget getTarget(org.eclipse.core.resources.IResource resource, java.lang.String id)
          Answers the result of a best-effort search to find a target with the specified ID, or null if one is not found.
static ITarget[] getTargets(org.eclipse.core.resources.IResource resource)
          Returns the targets owned by this project.
static java.net.URL getURLInBuildDefinitions(DefaultManagedConfigElement element, org.eclipse.core.runtime.IPath path)
          Get the full URL for a path that is relative to the plug-in in which .buildDefinitions are defined
static org.osgi.framework.Version getVersion()
           
static java.lang.String getVersionFromIdAndVersion(java.lang.String idAndVersion)
          Returns the version, if 'id' contains a valid version Returns null if 'id' does not contain a valid version Returns null if 'id' does not contain a version
static boolean hasTargetConversionElements(IBuildObject buildObj)
           
static org.eclipse.core.runtime.IStatus initBuildInfoContainer(org.eclipse.core.resources.IResource resource)
           
static void initializePathEntries(IConfiguration config, IOption option)
           
static void initializePathEntries(IResourceConfiguration resConfig, IOption option)
           
static java.lang.String locationToFullPath(java.lang.String path)
           
static boolean manages(org.eclipse.core.resources.IResource resource)
           
static int optionTypeToEntryKind(int type)
           
static int optionUndefTypeToEntryKind(int type)
           
static void OptionValidError(int errorId, java.lang.String id)
           
static void OptionValueHandlerError(java.lang.String attribute, java.lang.String id)
           
static void OutputDuplicateIdError(java.lang.String type, java.lang.String id)
           
static void OutputIconError(java.lang.String iconLocation)
           
static void OutputManifestError(java.lang.String message)
           
static void OutputResolveError(java.lang.String attribute, java.lang.String lookupId, java.lang.String type, java.lang.String id)
           
static void performValueHandlerEvent(IConfiguration config, int event)
          Send event to value handlers of relevant configuration including all its child resource configurations, if they exist.
static void performValueHandlerEvent(IConfiguration config, int event, boolean doChildren)
          Send event to value handlers of relevant configuration.
static void performValueHandlerEvent(IResourceInfo config, int event)
          Send event to value handlers of relevant configuration.
static void putConfigElement(IBuildObject buildObj, IManagedConfigElement configElement)
          This method public for implementation reasons.
static void removeBuildInfo(org.eclipse.core.resources.IResource resource)
           
static void resetConfiguration(org.eclipse.core.resources.IProject project, IConfiguration configuration)
          Resets the build information for the project and configuration specified in the arguments.
static void resetOptionSettings(IResourceInfo rcInfo)
           
static void resetResourceConfiguration(org.eclipse.core.resources.IProject project, IResourceConfiguration resConfig)
           
static void resortBuilders()
           
static void resortToolChains()
           
static void resortTools()
           
static boolean saveBuildInfo(org.eclipse.core.resources.IProject project, boolean force)
           
static boolean saveBuildInfoLegacy(org.eclipse.core.resources.IProject project, boolean force)
           
static void setDefaultConfiguration(org.eclipse.core.resources.IProject project, IConfiguration newDefault)
          Sets the default configuration for the project.
static void setLoaddedBuildInfo(org.eclipse.core.resources.IProject project, IManagedBuildInfo info)
           
static void setNewProjectVersion(org.eclipse.core.resources.IProject newProject)
          Adds the version of the managed build system to the project specified in the argument.
static IOption setOption(IConfiguration config, IHoldsOptions holder, IOption option, boolean value)
          Set the boolean value for an option for a given config.
static IOption setOption(IConfiguration config, IHoldsOptions holder, IOption option, java.lang.String value)
          Set the string value for an option for a given config.
static IOption setOption(IConfiguration config, IHoldsOptions holder, IOption option, java.lang.String[] value)
          Set the string array value for an option for a given config.
static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, IOption option, boolean value)
          Set the boolean value for an option for a given config.
static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, IOption option, OptionStringValue[] value)
           
static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, IOption option, java.lang.String value)
          Set the string value for an option for a given resource config.
static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, IOption option, java.lang.String[] value)
          Set the string array value for an option for a given resource config.
static void setPreferenceConfiguration(IConfiguration cfg)
           
static void setSelectedConfiguration(org.eclipse.core.resources.IProject project, IConfiguration config)
          Sets the currently selected configuration.
static void setToolCommand(IConfiguration config, ITool tool, java.lang.String command)
           
static void setToolCommand(IResourceConfiguration resConfig, ITool tool, java.lang.String command)
           
 void subscribe(org.eclipse.core.resources.IResource resource, IScannerInfoChangeListener listener)
          The receiver will register the listener specified in the argument to receive change notifications when the information for the IResource it is responsible for changes.
 void unsubscribe(org.eclipse.core.resources.IResource resource, IScannerInfoChangeListener listener)
          The receiver will no longer notify the listener specified in the argument when information about the reource it is responsible for changes.
static void updateCoreSettings(IConfiguration cfg)
           
static void updateCoreSettings(org.eclipse.core.resources.IProject project)
           
static void updateCoreSettings(org.eclipse.core.resources.IProject project, IConfiguration[] cfgs)
           
static void updateCoreSettings(org.eclipse.core.resources.IProject project, IConfiguration[] cfgs, boolean avoidSerialization)
           
 
Methods inherited from class org.eclipse.cdt.core.AbstractCExtension
getExtensionReference, getProject
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SETTINGS_FILE_NAME

public static final java.lang.String SETTINGS_FILE_NAME
See Also:
Constant Field Values

INTERFACE_IDENTITY

public static final java.lang.String INTERFACE_IDENTITY

EXTENSION_POINT_ID

public static final java.lang.String EXTENSION_POINT_ID

EXTENSION_POINT_ID_V2

public static final java.lang.String EXTENSION_POINT_ID_V2

MANIFEST_ERROR_RESOLVING

public static final java.lang.String MANIFEST_ERROR_RESOLVING
See Also:
Constant Field Values

MANIFEST_ERROR_DUPLICATE

public static final java.lang.String MANIFEST_ERROR_DUPLICATE
See Also:
Constant Field Values

MANIFEST_ERROR_ICON

public static final java.lang.String MANIFEST_ERROR_ICON
See Also:
Constant Field Values

ERROR_CATEGORY

public static final int ERROR_CATEGORY
See Also:
Constant Field Values

ERROR_FILTER

public static final int ERROR_FILTER
See Also:
Constant Field Values

BUILD_TYPE_PROPERTY_ID

public static final java.lang.String BUILD_TYPE_PROPERTY_ID
See Also:
Constant Field Values

BUILD_ARTEFACT_TYPE_PROPERTY_ID

public static final java.lang.String BUILD_ARTEFACT_TYPE_PROPERTY_ID
See Also:
Constant Field Values

BUILD_TYPE_PROPERTY_DEBUG

public static final java.lang.String BUILD_TYPE_PROPERTY_DEBUG
See Also:
Constant Field Values

BUILD_TYPE_PROPERTY_RELEASE

public static final java.lang.String BUILD_TYPE_PROPERTY_RELEASE
See Also:
Constant Field Values

BUILD_ARTEFACT_TYPE_PROPERTY_EXE

public static final java.lang.String BUILD_ARTEFACT_TYPE_PROPERTY_EXE
See Also:
Constant Field Values

BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB

public static final java.lang.String BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB
See Also:
Constant Field Values

BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB

public static final java.lang.String BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB
See Also:
Constant Field Values

CFG_DATA_PROVIDER_ID

public static final java.lang.String CFG_DATA_PROVIDER_ID

INTERNAL_BUILDER_ID

public static final java.lang.String INTERNAL_BUILDER_ID
See Also:
Constant Field Values

projectTypeMap

public static java.util.SortedMap projectTypeMap
Constructor Detail

ManagedBuildManager

public ManagedBuildManager()
Method Detail

getRandomNumber

public static int getRandomNumber()
Returns the next random number.

Returns:
int A positive integer

getDefinedProjectTypes

public static IProjectType[] getDefinedProjectTypes()
Returns the list of project types that are defined by this project, projects referenced by this project, and by the extensions.

Returns:
IProjectType[]

getProjectType

public static IProjectType getProjectType(java.lang.String id)
Returns the project type with the passed in ID

Parameters:
String -
Returns:
IProjectType

getVersion

public static org.osgi.framework.Version getVersion()

getExtensionProjectTypeMap

public static java.util.SortedMap getExtensionProjectTypeMap()

getExtensionToolChainMap

public static java.util.SortedMap getExtensionToolChainMap()

getExtensionToolMap

public static java.util.SortedMap getExtensionToolMap()

getExtensionBuilderMap

public static java.util.SortedMap getExtensionBuilderMap()

getTargets

public static ITarget[] getTargets(org.eclipse.core.resources.IResource resource)
Returns the targets owned by this project. If none are owned, an empty array is returned.

Parameters:
project -
Returns:

getExtensionProjectType

public static IProjectType getExtensionProjectType(java.lang.String id)
Returns the project type from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
IProjectType

getExtensionConfiguration

public static IConfiguration getExtensionConfiguration(java.lang.String id)
Returns the configuration from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
IConfiguration

getExtensionResourceConfiguration

public static IResourceConfiguration getExtensionResourceConfiguration(java.lang.String id)
Returns the resource configuration from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
IResourceConfiguration

getExtensionToolChain

public static IToolChain getExtensionToolChain(java.lang.String id)
Returns the tool-chain from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
IToolChain

getExtensionTool

public static ITool getExtensionTool(java.lang.String id)
Returns the tool from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
ITool

getExtensionTargetPlatform

public static ITargetPlatform getExtensionTargetPlatform(java.lang.String id)
Returns the target platform from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
ITargetPlatform

getExtensionBuilder

public static IBuilder getExtensionBuilder(java.lang.String id)
Returns the builder from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
IBuilder

getExtensionBuilder

public static IBuilder getExtensionBuilder(IBuilder builder)

getExtensionOption

public static IOption getExtensionOption(java.lang.String id)
Returns the option from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
IOption

getExtensionInputType

public static IInputType getExtensionInputType(java.lang.String id)
Returns the InputType from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
IInputType

getExtensionOutputType

public static IOutputType getExtensionOutputType(java.lang.String id)
Returns the OutputType from the manifest with the ID specified in the argument or null.

Parameters:
id -
Returns:
IOutputType

getExtensionTarget

public static ITarget getExtensionTarget(java.lang.String id)
Returns the target from the manifest with the ID specified in the argument or null - CDT V2.0 object model.

Parameters:
id -
Returns:
ITarget

getTarget

public static ITarget getTarget(org.eclipse.core.resources.IResource resource,
                                java.lang.String id)
Answers the result of a best-effort search to find a target with the specified ID, or null if one is not found.

Parameters:
resource -
id -
Returns:

setDefaultConfiguration

public static void setDefaultConfiguration(org.eclipse.core.resources.IProject project,
                                           IConfiguration newDefault)
Sets the default configuration for the project. Note that this will also update the default target if needed.

Parameters:
project -
newDefault -

setSelectedConfiguration

public static void setSelectedConfiguration(org.eclipse.core.resources.IProject project,
                                            IConfiguration config)
Sets the currently selected configuration. This is used while the project property pages are displayed

Parameters:
project -
target -

getBuildfileGenerator

public static IManagedBuilderMakefileGenerator getBuildfileGenerator(IConfiguration config)
Parameters:
targetId -
Returns:

getCommandLineGenerator

public static IManagedCommandLineGenerator getCommandLineGenerator(IConfiguration config,
                                                                   java.lang.String toolId)
load tool provider defined or default (if not found) command line generator special for selected tool

Parameters:
toolId - - id selected id
Returns:
IManagedCommandLineGenerator

getScannerInfoProfileId

public static java.lang.String getScannerInfoProfileId(IConfiguration config)
Targets may have a scanner config discovery profile defined that knows how to discover built-in compiler defines and includes search paths. Find the profile for the target specified.

Parameters:
string - the unique id of the target to search for
Returns:
scanner configuration discovery profile id

getSelectedConfiguration

public static IConfiguration getSelectedConfiguration(org.eclipse.core.resources.IProject project)
Gets the currently selected target. This is used while the project property pages are displayed

Parameters:
project -
Returns:
target

initializePathEntries

public static void initializePathEntries(IConfiguration config,
                                         IOption option)

initializePathEntries

public static void initializePathEntries(IResourceConfiguration resConfig,
                                         IOption option)

setNewProjectVersion

public static void setNewProjectVersion(org.eclipse.core.resources.IProject newProject)
Adds the version of the managed build system to the project specified in the argument.

Parameters:
newProject - the project to version

setOption

public static IOption setOption(IConfiguration config,
                                IHoldsOptions holder,
                                IOption option,
                                boolean value)
Set the boolean value for an option for a given config.

Parameters:
config - The configuration the option belongs to.
holder - The holder/parent of the option.
option - The option to set the value for.
value - The boolean that the option should contain after the change.
Returns:
IOption The modified option. This can be the same option or a newly created option.
Since:
3.0 - The type and name of the ITool tool parameter has changed to IHoldsOptions holder. Client code assuming ITool as type, will continue to work unchanged.

setOption

public static IOption setOption(IResourceInfo resConfig,
                                IHoldsOptions holder,
                                IOption option,
                                boolean value)
Set the boolean value for an option for a given config.

Parameters:
resConfig - The resource configuration the option belongs to.
holder - The holder/parent of the option.
option - The option to set the value for.
value - The boolean that the option should contain after the change.
Returns:
IOption The modified option. This can be the same option or a newly created option.
Since:
3.0 - The type and name of the ITool tool parameter has changed to IHoldsOptions holder. Client code assuming ITool as type, will continue to work unchanged.

setOption

public static IOption setOption(IConfiguration config,
                                IHoldsOptions holder,
                                IOption option,
                                java.lang.String value)
Set the string value for an option for a given config.

Parameters:
config - The configuration the option belongs to.
holder - The holder/parent of the option.
option - The option to set the value for.
value - The value that the option should contain after the change.
Returns:
IOption The modified option. This can be the same option or a newly created option.
Since:
3.0 - The type and name of the ITool tool parameter has changed to IHoldsOptions holder. Client code assuming ITool as type, will continue to work unchanged.

setOption

public static IOption setOption(IResourceInfo resConfig,
                                IHoldsOptions holder,
                                IOption option,
                                java.lang.String value)
Set the string value for an option for a given resource config.

Parameters:
resConfig - The resource configuration the option belongs to.
holder - The holder/parent of the option.
option - The option to set the value for.
value - The value that the option should contain after the change.
Returns:
IOption The modified option. This can be the same option or a newly created option.
Since:
3.0 - The type and name of the ITool tool parameter has changed to IHoldsOptions holder. Client code assuming ITool as type, will continue to work unchanged.

setOption

public static IOption setOption(IConfiguration config,
                                IHoldsOptions holder,
                                IOption option,
                                java.lang.String[] value)
Set the string array value for an option for a given config.

Parameters:
config - The configuration the option belongs to.
holder - The holder/parent of the option.
option - The option to set the value for.
value - The values the option should contain after the change.
Returns:
IOption The modified option. This can be the same option or a newly created option.
Since:
3.0 - The type and name of the ITool tool parameter has changed to IHoldsOptions holder. Client code assuming ITool as type, will continue to work unchanged.

setOption

public static IOption setOption(IResourceInfo resConfig,
                                IHoldsOptions holder,
                                IOption option,
                                java.lang.String[] value)
Set the string array value for an option for a given resource config.

Parameters:
resConfig - The resource configuration the option belongs to.
holder - The holder/parent of the option.
option - The option to set the value for.
value - The values the option should contain after the change.
Returns:
IOption The modified option. This can be the same option or a newly created option.
Since:
3.0 - The type and name of the ITool tool parameter has changed to IHoldsOptions holder. Client code assuming ITool as type, will continue to work unchanged.

setOption

public static IOption setOption(IResourceInfo resConfig,
                                IHoldsOptions holder,
                                IOption option,
                                OptionStringValue[] value)

setToolCommand

public static void setToolCommand(IConfiguration config,
                                  ITool tool,
                                  java.lang.String command)
Parameters:
config -
tool -
command -

setToolCommand

public static void setToolCommand(IResourceConfiguration resConfig,
                                  ITool tool,
                                  java.lang.String command)

saveBuildInfoLegacy

public static boolean saveBuildInfoLegacy(org.eclipse.core.resources.IProject project,
                                          boolean force)

saveBuildInfo

public static boolean saveBuildInfo(org.eclipse.core.resources.IProject project,
                                    boolean force)

updateCoreSettings

public static void updateCoreSettings(org.eclipse.core.resources.IProject project)
                               throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

updateCoreSettings

public static void updateCoreSettings(IConfiguration cfg)
                               throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

updateCoreSettings

public static void updateCoreSettings(org.eclipse.core.resources.IProject project,
                                      IConfiguration[] cfgs)
                               throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

updateCoreSettings

public static void updateCoreSettings(org.eclipse.core.resources.IProject project,
                                      IConfiguration[] cfgs,
                                      boolean avoidSerialization)
                               throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

removeBuildInfo

public static void removeBuildInfo(org.eclipse.core.resources.IResource resource)
Parameters:
resource -

resetConfiguration

public static void resetConfiguration(org.eclipse.core.resources.IProject project,
                                      IConfiguration configuration)
Resets the build information for the project and configuration specified in the arguments. The build information will contain the settings defined in the plugin manifest.

Parameters:
project -
configuration -

resetResourceConfiguration

public static void resetResourceConfiguration(org.eclipse.core.resources.IProject project,
                                              IResourceConfiguration resConfig)

resetOptionSettings

public static void resetOptionSettings(IResourceInfo rcInfo)

addExtensionProjectType

public static void addExtensionProjectType(ProjectType projectType)
Adds a ProjectType that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
projectType -

addExtensionConfiguration

public static void addExtensionConfiguration(Configuration configuration)
Adds a Configuration that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
configuration -

addExtensionResourceConfiguration

public static void addExtensionResourceConfiguration(ResourceConfiguration resourceConfiguration)
Adds a Resource Configuration that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
resourceConfiguration -

addExtensionToolChain

public static void addExtensionToolChain(ToolChain toolChain)
Adds a ToolChain that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
toolChain -

addExtensionTool

public static void addExtensionTool(Tool tool)
Adds a tool that is is specified in the manifest to the build system. This tool is available to any target that has a reference to it as part of its description. This permits a tool that is common to many targets to be defined only once.

Parameters:
tool -

addExtensionTargetPlatform

public static void addExtensionTargetPlatform(TargetPlatform targetPlatform)
Adds a TargetPlatform that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
targetPlatform -

addExtensionBuilder

public static void addExtensionBuilder(Builder builder)
Adds a Builder that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
Builder -

addExtensionOption

public static void addExtensionOption(Option option)
Adds a Option that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
option -

addExtensionOptionCategory

public static void addExtensionOptionCategory(OptionCategory optionCategory)
Adds a OptionCategory that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
optionCategory -

addExtensionInputType

public static void addExtensionInputType(InputType inputType)
Adds an InputType that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
inputType -

addExtensionOutputType

public static void addExtensionOutputType(OutputType outputType)
Adds an OutputType that is is specified in the manifest to the build system. It is available to any element that has a reference to it as part of its description.

Parameters:
outputType -

addExtensionTarget

public static void addExtensionTarget(Target target)
Adds a Target that is is specified in the manifest to the build system. It is available to any CDT 2.0 object model element that has a reference to it as part of its description.

Parameters:
target -

createManagedProject

public static IManagedProject createManagedProject(org.eclipse.core.resources.IResource resource,
                                                   IProjectType parent)
                                            throws BuildException
Creates a new project instance for the resource based on the parent project type.

Parameters:
resource -
parentTarget -
Returns:
new ITarget with settings based on the parent passed in the arguments
Throws:
BuildException

createTarget

public static ITarget createTarget(org.eclipse.core.resources.IResource resource,
                                   ITarget parentTarget)
                            throws BuildException
Creates a new target for the resource based on the parentTarget.

Parameters:
resource -
parentTarget -
Returns:
new ITarget with settings based on the parent passed in the arguments
Throws:
BuildException

initBuildInfoContainer

public static org.eclipse.core.runtime.IStatus initBuildInfoContainer(org.eclipse.core.resources.IResource resource)
Parameters:
resource -
Returns:

createBuildInfo

public static ManagedBuildInfo createBuildInfo(org.eclipse.core.resources.IResource resource)

setLoaddedBuildInfo

public static void setLoaddedBuildInfo(org.eclipse.core.resources.IProject project,
                                       IManagedBuildInfo info)
                                throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

manages

public static boolean manages(org.eclipse.core.resources.IResource resource)
Parameters:
project -
Returns:

getBuildInfo

public static IManagedBuildInfo getBuildInfo(org.eclipse.core.resources.IResource resource)
Finds, but does not create, the managed build information for the argument. Loads the build info in case it is not currently loadded Calling this method is the same as calling getBuildInfo(IResource resource, boolean forceLoad) with the "forceLoad" argument set to true

Parameters:
resource - The resource to search for managed build information on.
Returns:
IManagedBuildInfo The build information object for the resource.
See Also:
ManagedBuildManager#initBuildInfo(IResource)

getOldStyleBuildInfo

public static IManagedBuildInfo getOldStyleBuildInfo(org.eclipse.core.resources.IProject project)
                                              throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getBuildInfoLegacy

public static IManagedBuildInfo getBuildInfoLegacy(org.eclipse.core.resources.IProject project)

getBuildInfo

public static IManagedBuildInfo getBuildInfo(org.eclipse.core.resources.IResource resource,
                                             boolean forceLoad)
Finds, but does not create, the managed build information for the argument. If the build info is not currently loadded and "forceLoad" argument is set to true, loads the build info from the .cdtbuild file In case "forceLoad" is false, does not load the build info and returns null in case it is not loadded

Parameters:
resource - The resource to search for managed build information on.
forceLoad - specifies whether the build info should be loadded in case it is not loadded currently.
Returns:
IManagedBuildInfo The build information object for the resource.
See Also:
ManagedBuildManager#initBuildInfo(IResource)

canGetBuildInfo

public static boolean canGetBuildInfo(org.eclipse.core.resources.IResource resource)
Determines if the managed build information for the argument can be found.

Parameters:
resource - The resource to search for managed build information on.
Returns:
boolean True if the build info can be found; false otherwise.
See Also:
ManagedBuildManager#initBuildInfo(IResource)

getBuildInfoVersion

public static org.eclipse.core.runtime.PluginVersionIdentifier getBuildInfoVersion()
Answers the current version of the managed builder plugin.

Returns:
the current version of the managed builder plugin

getURLInBuildDefinitions

public static java.net.URL getURLInBuildDefinitions(DefaultManagedConfigElement element,
                                                    org.eclipse.core.runtime.IPath path)
Get the full URL for a path that is relative to the plug-in in which .buildDefinitions are defined

Returns:
the full URL for a path relative to the .buildDefinitions plugin

getScannerInformation

public org.eclipse.cdt.core.parser.IScannerInfo getScannerInformation(org.eclipse.core.resources.IResource resource)
Description copied from interface: IScannerInfoProvider
The receiver will answer the current state of the build information for the resource specified in the argument.

Specified by:
getScannerInformation in interface IScannerInfoProvider
Returns:

subscribe

public void subscribe(org.eclipse.core.resources.IResource resource,
                      IScannerInfoChangeListener listener)
Description copied from interface: IScannerInfoProvider
The receiver will register the listener specified in the argument to receive change notifications when the information for the IResource it is responsible for changes.

Specified by:
subscribe in interface IScannerInfoProvider

unsubscribe

public void unsubscribe(org.eclipse.core.resources.IResource resource,
                        IScannerInfoChangeListener listener)
Description copied from interface: IScannerInfoProvider
The receiver will no longer notify the listener specified in the argument when information about the reource it is responsible for changes.

Specified by:
unsubscribe in interface IScannerInfoProvider

putConfigElement

public static void putConfigElement(IBuildObject buildObj,
                                    IManagedConfigElement configElement)
This method public for implementation reasons. Not intended for use by clients.


getConfigElement

public static IManagedConfigElement getConfigElement(IBuildObject buildObj)
This method public for implementation reasons. Not intended for use by clients.


OptionValidError

public static void OptionValidError(int errorId,
                                    java.lang.String id)

OptionValueHandlerError

public static void OptionValueHandlerError(java.lang.String attribute,
                                           java.lang.String id)

OutputResolveError

public static void OutputResolveError(java.lang.String attribute,
                                      java.lang.String lookupId,
                                      java.lang.String type,
                                      java.lang.String id)

OutputDuplicateIdError

public static void OutputDuplicateIdError(java.lang.String type,
                                          java.lang.String id)

OutputManifestError

public static void OutputManifestError(java.lang.String message)

OutputIconError

public static void OutputIconError(java.lang.String iconLocation)

getEnvironmentVariableProvider

public static IEnvironmentVariableProvider getEnvironmentVariableProvider()
Returns the instance of the Environment Variable Provider

Returns:
IEnvironmentVariableProvider

getVersionFromIdAndVersion

public static java.lang.String getVersionFromIdAndVersion(java.lang.String idAndVersion)
Returns the version, if 'id' contains a valid version Returns null if 'id' does not contain a valid version Returns null if 'id' does not contain a version

Parameters:
idAndVersion -
Returns:
String

getIdFromIdAndVersion

public static java.lang.String getIdFromIdAndVersion(java.lang.String idAndVersion)
If the input to this function contains 'id & a valid version', it returns only the 'id' part Otherwise it returns the received input back.

Parameters:
idAndVersion -
Returns:
String

getBuildMacroProvider

public static IBuildMacroProvider getBuildMacroProvider()
Returns the instance of the Build Macro Provider

Returns:
IBuildMacroProvider

performValueHandlerEvent

public static void performValueHandlerEvent(IConfiguration config,
                                            int event)
Send event to value handlers of relevant configuration including all its child resource configurations, if they exist.

Parameters:
IConfiguration - configuration for which to send the event
event - to be sent
Since:
3.0

performValueHandlerEvent

public static void performValueHandlerEvent(IConfiguration config,
                                            int event,
                                            boolean doChildren)
Send event to value handlers of relevant configuration.

Parameters:
IConfiguration - configuration for which to send the event
event - to be sent
doChildren - - if true, also perform the event for all resource configurations that are children if this configuration.
Since:
3.0

performValueHandlerEvent

public static void performValueHandlerEvent(IResourceInfo config,
                                            int event)
Send event to value handlers of relevant configuration.

Parameters:
IResourceConfiguration - configuration for which to send the event
event - to be sent
Since:
3.0

convert

public static IBuildObject convert(IBuildObject buildObj,
                                   java.lang.String toId,
                                   boolean userhasConfirmed)

hasTargetConversionElements

public static boolean hasTargetConversionElements(IBuildObject buildObj)

getConversionElements

public static java.util.Map getConversionElements(IBuildObject buildObj)

calculateChildId

public static java.lang.String calculateChildId(java.lang.String superId,
                                                java.lang.String suffix)

calculateRelativePath

public static org.eclipse.core.runtime.IPath calculateRelativePath(org.eclipse.core.runtime.IPath container,
                                                                   org.eclipse.core.runtime.IPath contents)
Calculate a relative path given the full path to a folder and a file


getConfigurationForDescription

public static IConfiguration getConfigurationForDescription(org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfgDes)

optionTypeToEntryKind

public static int optionTypeToEntryKind(int type)

optionUndefTypeToEntryKind

public static int optionUndefTypeToEntryKind(int type)

entryKindToOptionType

public static int entryKindToOptionType(int kind)

entryKindToUndefOptionType

public static int entryKindToUndefOptionType(int kind)

getDescriptionForConfiguration

public static org.eclipse.cdt.core.settings.model.ICConfigurationDescription getDescriptionForConfiguration(IConfiguration cfg)

getBuildFullPath

public static org.eclipse.core.runtime.IPath getBuildFullPath(IConfiguration cfg,
                                                              IBuilder builder)

locationToFullPath

public static java.lang.String locationToFullPath(java.lang.String path)

fullPathToLocation

public static java.lang.String fullPathToLocation(java.lang.String path)

getBuildLocation

public static org.eclipse.core.runtime.IPath getBuildLocation(IConfiguration cfg,
                                                              IBuilder builder)

createBuilders

public static IBuilder[] createBuilders(org.eclipse.core.resources.IProject project,
                                        java.util.Map args)

createCustomBuilder

public static IBuilder createCustomBuilder(IConfiguration cfg,
                                           java.lang.String builderId)
                                    throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

createCustomBuilder

public static IBuilder createCustomBuilder(IConfiguration cfg,
                                           IBuilder base)

createBuilderForEclipseBuilder

public static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg,
                                                      java.lang.String eclipseBuilderID)
                                               throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getExtensionToolChains

public static IToolChain[] getExtensionToolChains(IProjectType type)

getExtensionConfigurations

public static IConfiguration[] getExtensionConfigurations(IToolChain tChain,
                                                          IProjectType type)

getFirstExtensionConfiguration

public static IConfiguration getFirstExtensionConfiguration(IToolChain tChain)

getExtensionConfigurations

public static IConfiguration[] getExtensionConfigurations(IToolChain tChain,
                                                          java.lang.String propertyType,
                                                          java.lang.String propertyValue)

getRealToolChains

public static IToolChain[] getRealToolChains()

getRealTools

public static ITool[] getRealTools()

getRealBuilders

public static IBuilder[] getRealBuilders()

getRealBuilder

public static IBuilder getRealBuilder(IBuilder builder)

getRealTool

public static ITool getRealTool(ITool tool)

getExtensionToolChain

public static IToolChain getExtensionToolChain(IToolChain tc)

getRealToolChain

public static IToolChain getRealToolChain(IToolChain tc)

findIdenticalToolChains

public static IToolChain[] findIdenticalToolChains(IToolChain tc)

findIdenticalTools

public static ITool[] findIdenticalTools(ITool tool)

findIdenticalBuilders

public static IBuilder[] findIdenticalBuilders(IBuilder b)

getExtensionsToolChains

public static IToolChain[] getExtensionsToolChains(java.lang.String propertyType,
                                                   java.lang.String propertyValue)

getExtensionsToolChains

public static IToolChain[] getExtensionsToolChains(java.lang.String propertyType,
                                                   java.lang.String propertyValue,
                                                   boolean supportedPropsOnly)

resortToolChains

public static void resortToolChains()

resortTools

public static void resortTools()

resortBuilders

public static void resortBuilders()

getBuildPropertyManager

public static IBuildPropertyManager getBuildPropertyManager()

getReferencedConfigurations

public static IConfiguration[] getReferencedConfigurations(IConfiguration config)
Returns the configurations referenced by this configuration. Returns an empty array if there are no referenced configurations.

Returns:
an array of IConfiguration objects referenced by this IConfiguration
See Also:
CoreModelUtil.getReferencedConfigurations()

buildConfigurations

public static void buildConfigurations(IConfiguration[] configs,
                                       org.eclipse.core.runtime.IProgressMonitor monitor)
                                throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

buildConfigurations

public static void buildConfigurations(IConfiguration[] configs,
                                       IBuilder builder,
                                       org.eclipse.core.runtime.IProgressMonitor monitor)
                                throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getInternalBuilder

public static IBuilder getInternalBuilder()

getExtensionTool

public static ITool getExtensionTool(ITool tool)

getExtensionInputType

public static IInputType getExtensionInputType(IInputType inType)

getPreferenceConfiguration

public static IConfiguration getPreferenceConfiguration(boolean write)

setPreferenceConfiguration

public static void setPreferenceConfiguration(IConfiguration cfg)
                                       throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException