Package org.eclipse.cdt.core.build
Interface IToolChain
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
public interface IToolChain
extends org.eclipse.core.runtime.IAdaptable
Toolchains are a collection of tools that take the source code and converts
it into an executable system.
- Since:
- 6.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property: The CPU architecture the toolchain supports.static final String
Property: The OS the toolchain builds for.static final String
Property: A package ID to reflect different version/package line up of the platform this toolchain supports. -
Method Summary
Modifier and TypeMethodDescriptionReturns the IDs for the binary parsers that can parse the build output of the toolchain.default String
Return a toolchain specific part of the build configuration name.getCommandPath
(Path command) Returns the absolute path of the tool represented by the commandString[]
Returns the list of compiler tools.default String[]
getCompileCommands
(ILanguage language) Returns the list of compiler tools for a given language.default IExtendedScannerInfo
getDefaultScannerInfo
(org.eclipse.core.resources.IBuildConfiguration buildConfig, IExtendedScannerInfo baseScannerInfo, ILanguage language, URI buildDirectoryURI) Return the default scanner info for this toolchain.String[]
Returns the error parser IDs use to create error markers for builds with this toolchain.getId()
The ID of the toolchaingetName()
The user friendly name for the toolchaingetProperty
(String key) Returns an property of the toolchain.The provider of the toolchain.default org.eclipse.core.resources.IResource[]
getResourcesFromCommand
(String[] command, URI buildDirectoryURI) Deprecated.default org.eclipse.core.resources.IResource[]
getResourcesFromCommand
(List<String> command, URI buildDirectoryURI) Returns the list of resources referenced in a compile command.default IExtendedScannerInfo
getScannerInfo
(org.eclipse.core.resources.IBuildConfiguration buildConfig, Path command, String[] args, IExtendedScannerInfo baseScannerInfo, org.eclipse.core.resources.IResource resource, URI buildDirectoryURI) Deprecated.default IExtendedScannerInfo
getScannerInfo
(org.eclipse.core.resources.IBuildConfiguration buildConfig, List<String> command, IExtendedScannerInfo baseScannerInfo, org.eclipse.core.resources.IResource resource, URI buildDirectoryURI) Get the scanner info for a given build config, command, base scanner info, resource and build directory.default String
The type id for the toolchain.getVariable
(String name) Return the environment variable of the given name used when invoking the toolchain.Return the environment variables to be set when invoking the tools in the toolchain.Deprecated.the version doesn't matter.default boolean
Determine if this toolchain supports targets with the given set of properties.void
setProperty
(String key, String value) Set a property on the toolchain.stripCommand
(List<String> command, org.eclipse.core.resources.IResource[] resources) Strips the resources from the compile command.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Field Details
-
ATTR_OS
Property: The OS the toolchain builds for.- See Also:
-
ATTR_ARCH
Property: The CPU architecture the toolchain supports.- See Also:
-
ATTR_PACKAGE
Property: A package ID to reflect different version/package line up of the platform this toolchain supports.- See Also:
-
-
Method Details
-
getProvider
IToolChainProvider getProvider()The provider of the toolchain.- Returns:
- toolchain provider
-
getId
String getId()The ID of the toolchain- Returns:
- toolchain ID
-
getVersion
Deprecated.the version doesn't matter. id's for a given type must be unique.The version of the toolchain- Returns:
- toolchain version
-
getName
String getName()The user friendly name for the toolchain- Returns:
- toolchain name
-
getBuildConfigNameFragment
Return a toolchain specific part of the build configuration name. This should be enough to ensure the build config generated proper code for the selected target. As a default implementation, we do what the CMakeBuildConfigationProvider did which has been copied to a number of other providers, i.e. use the os and arch.- Returns:
- fragment to be used in the build config name
- Since:
- 6.9
-
getTypeId
The type id for the toolchain. The combination of type id and toolchain id uniquely identify the toolchain in the system.- Since:
- 6.4
-
getProperty
Returns an property of the toolchain. Used to determine applicability of a toolchain for a given situation.- Parameters:
key
- key of the property- Returns:
- value of the property or null if the toolchain does not have that property
-
setProperty
Set a property on the toolchain.- Parameters:
key
- key of the propertyvalue
- value of the property
-
getVariables
IEnvironmentVariable[] getVariables()Return the environment variables to be set when invoking the tools in the toolchain.- Returns:
- environment variables
-
getVariable
Return the environment variable of the given name used when invoking the toolchain.- Parameters:
name
- environment variable name- Returns:
- environment variable value
-
getErrorParserIds
String[] getErrorParserIds()Returns the error parser IDs use to create error markers for builds with this toolchain.- Returns:
- error parser IDs
-
getBinaryParserIds
Returns the IDs for the binary parsers that can parse the build output of the toolchain.- Returns:
- binary parser IDs for this toolchain
- Since:
- 8.0
-
getScannerInfo
default IExtendedScannerInfo getScannerInfo(org.eclipse.core.resources.IBuildConfiguration buildConfig, List<String> command, IExtendedScannerInfo baseScannerInfo, org.eclipse.core.resources.IResource resource, URI buildDirectoryURI) Get the scanner info for a given build config, command, base scanner info, resource and build directory.- Parameters:
buildConfig
- the build configuration this scanner info applies tocommand
- the compile command that is used to build the resourcebaseScannerInfo
- base scanner info that this scanner info extends/replacesresource
- the resource this scanner info applies to, usually a source filebuildDirectoryURI
- where the build command is run to build this resource- Returns:
- scanner info for this resource
- Since:
- 6.1
-
getScannerInfo
@Deprecated default IExtendedScannerInfo getScannerInfo(org.eclipse.core.resources.IBuildConfiguration buildConfig, Path command, String[] args, IExtendedScannerInfo baseScannerInfo, org.eclipse.core.resources.IResource resource, URI buildDirectoryURI) Deprecated. -
getDefaultScannerInfo
default IExtendedScannerInfo getDefaultScannerInfo(org.eclipse.core.resources.IBuildConfiguration buildConfig, IExtendedScannerInfo baseScannerInfo, ILanguage language, URI buildDirectoryURI) Return the default scanner info for this toolchain. This is used before any build information is available to provide at least a minimal scanner info based on the compiler built-ins.- Parameters:
buildConfig
- the build configuration this scanner info applies tobaseScannerInfo
- base scanner info that this scanner info extends/replaceslanguage
- the source language that selects the tool to provide scanner info forbuildDirectoryURI
- the build directory that would be used to run commands- Returns:
- default scanner info for this language
- Since:
- 6.1
-
getCommandPath
Returns the absolute path of the tool represented by the command- Parameters:
command
- the command as it usually appears on the command line- Returns:
- the absolute path to the tool for the command
-
getCompileCommands
String[] getCompileCommands()Returns the list of compiler tools.- Returns:
- list of compiler tools
-
getCompileCommands
Returns the list of compiler tools for a given language.- Parameters:
language
- the language for the commands- Returns:
- the compile commands for the language
- Since:
- 6.1
-
getResourcesFromCommand
default org.eclipse.core.resources.IResource[] getResourcesFromCommand(List<String> command, URI buildDirectoryURI) Returns the list of resources referenced in a compile command.- Parameters:
command
- the compile commandbuildDirectoryURI
- the directory the compile command runs in- Returns:
- the list of resources referenced in the compile command
- Since:
- 6.1
-
getResourcesFromCommand
@Deprecated default org.eclipse.core.resources.IResource[] getResourcesFromCommand(String[] command, URI buildDirectoryURI) Deprecated. -
stripCommand
default List<String> stripCommand(List<String> command, org.eclipse.core.resources.IResource[] resources) Strips the resources from the compile command. Use to produce the common parts of the command shared by a number of resources.- Parameters:
command
- the original compile commandresources
- the resources this command compiles for usually returned by getResourcesFromCommand()- Returns:
- the stripped command
- Since:
- 6.1
-
matches
Determine if this toolchain supports targets with the given set of properties.- Parameters:
properties
- the set of properties to test against- Returns:
- does this toolchain support these properties
- Since:
- 6.1
-