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

      Fields 
      Modifier and Type Field Description
      static java.lang.String ATTR_ARCH
      Property: The CPU architecture the toolchain supports.
      static java.lang.String ATTR_OS
      Property: The OS the toolchain builds for.
      static java.lang.String ATTR_PACKAGE
      Property: A package ID to reflect different version/package line up of the platform this toolchain supports.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String getBinaryParserId()
      Returns the IDs for the binary parsers that can parse the build output of the toolchain.
      default java.lang.String getBuildConfigNameFragment()
      Return a toolchain specific part of the build configuration name.
      java.nio.file.Path getCommandPath​(java.nio.file.Path command)
      Returns the absolute path of the tool represented by the command
      java.lang.String[] getCompileCommands()
      Returns the list of compiler tools.
      default java.lang.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, java.net.URI buildDirectoryURI)
      Return the default scanner info for this toolchain.
      java.lang.String[] getErrorParserIds()
      Returns the error parser IDs use to create error markers for builds with this toolchain.
      java.lang.String getId()
      The ID of the toolchain
      java.lang.String getName()
      The user friendly name for the toolchain
      java.lang.String getProperty​(java.lang.String key)
      Returns an property of the toolchain.
      IToolChainProvider getProvider()
      The provider of the toolchain.
      default org.eclipse.core.resources.IResource[] getResourcesFromCommand​(java.lang.String[] command, java.net.URI buildDirectoryURI)
      Deprecated.
      default org.eclipse.core.resources.IResource[] getResourcesFromCommand​(java.util.List<java.lang.String> command, java.net.URI buildDirectoryURI)
      Returns the list of resources referenced in a compile command.
      default IExtendedScannerInfo getScannerInfo​(org.eclipse.core.resources.IBuildConfiguration buildConfig, java.nio.file.Path command, java.lang.String[] args, IExtendedScannerInfo baseScannerInfo, org.eclipse.core.resources.IResource resource, java.net.URI buildDirectoryURI)
      Deprecated.
      default IExtendedScannerInfo getScannerInfo​(org.eclipse.core.resources.IBuildConfiguration buildConfig, java.util.List<java.lang.String> command, IExtendedScannerInfo baseScannerInfo, org.eclipse.core.resources.IResource resource, java.net.URI buildDirectoryURI)
      Get the scanner info for a given build config, command, base scanner info, resource and build directory.
      default java.lang.String getTypeId()
      The type id for the toolchain.
      IEnvironmentVariable getVariable​(java.lang.String name)
      Return the environment variable of the given name used when invoking the toolchain.
      IEnvironmentVariable[] getVariables()
      Return the environment variables to be set when invoking the tools in the toolchain.
      java.lang.String getVersion()
      Deprecated.
      the version doesn't matter.
      default boolean matches​(java.util.Map<java.lang.String,​java.lang.String> properties)
      Determine if this toolchain supports targets with the given set of properties.
      void setProperty​(java.lang.String key, java.lang.String value)
      Set a property on the toolchain.
      default java.util.List<java.lang.String> stripCommand​(java.util.List<java.lang.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 Detail

      • ATTR_OS

        static final java.lang.String ATTR_OS
        Property: The OS the toolchain builds for.
        See Also:
        Constant Field Values
      • ATTR_ARCH

        static final java.lang.String ATTR_ARCH
        Property: The CPU architecture the toolchain supports.
        See Also:
        Constant Field Values
      • ATTR_PACKAGE

        static final java.lang.String ATTR_PACKAGE
        Property: A package ID to reflect different version/package line up of the platform this toolchain supports.
        See Also:
        Constant Field Values
    • Method Detail

      • getProvider

        IToolChainProvider getProvider()
        The provider of the toolchain.
        Returns:
        toolchain provider
      • getId

        java.lang.String getId()
        The ID of the toolchain
        Returns:
        toolchain ID
      • getVersion

        @Deprecated
        java.lang.String 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

        java.lang.String getName()
        The user friendly name for the toolchain
        Returns:
        toolchain name
      • getBuildConfigNameFragment

        default java.lang.String 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

        default java.lang.String 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

        java.lang.String getProperty​(java.lang.String key)
        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

        void setProperty​(java.lang.String key,
                         java.lang.String value)
        Set a property on the toolchain.
        Parameters:
        key - key of the property
        value - 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

        IEnvironmentVariable getVariable​(java.lang.String name)
        Return the environment variable of the given name used when invoking the toolchain.
        Parameters:
        name - environment variable name
        Returns:
        environment variable value
      • getErrorParserIds

        java.lang.String[] getErrorParserIds()
        Returns the error parser IDs use to create error markers for builds with this toolchain.
        Returns:
        error parser IDs
      • getBinaryParserId

        java.lang.String getBinaryParserId()
        Returns the IDs for the binary parsers that can parse the build output of the toolchain.
        Returns:
        binary parser IDs for this toolchain
      • getScannerInfo

        default IExtendedScannerInfo getScannerInfo​(org.eclipse.core.resources.IBuildConfiguration buildConfig,
                                                    java.util.List<java.lang.String> command,
                                                    IExtendedScannerInfo baseScannerInfo,
                                                    org.eclipse.core.resources.IResource resource,
                                                    java.net.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 to
        command - the compile command that is used to build the resource
        baseScannerInfo - base scanner info that this scanner info extends/replaces
        resource - the resource this scanner info applies to, usually a source file
        buildDirectoryURI - 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,
                                                    java.nio.file.Path command,
                                                    java.lang.String[] args,
                                                    IExtendedScannerInfo baseScannerInfo,
                                                    org.eclipse.core.resources.IResource resource,
                                                    java.net.URI buildDirectoryURI)
        Deprecated.
      • getDefaultScannerInfo

        default IExtendedScannerInfo getDefaultScannerInfo​(org.eclipse.core.resources.IBuildConfiguration buildConfig,
                                                           IExtendedScannerInfo baseScannerInfo,
                                                           ILanguage language,
                                                           java.net.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 to
        baseScannerInfo - base scanner info that this scanner info extends/replaces
        language - the source language that selects the tool to provide scanner info for
        buildDirectoryURI - the build directory that would be used to run commands
        Returns:
        default scanner info for this language
        Since:
        6.1
      • getCommandPath

        java.nio.file.Path getCommandPath​(java.nio.file.Path command)
        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

        java.lang.String[] getCompileCommands()
        Returns the list of compiler tools.
        Returns:
        list of compiler tools
      • getCompileCommands

        default java.lang.String[] getCompileCommands​(ILanguage language)
        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​(java.util.List<java.lang.String> command,
                                                                               java.net.URI buildDirectoryURI)
        Returns the list of resources referenced in a compile command.
        Parameters:
        command - the compile command
        buildDirectoryURI - 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​(java.lang.String[] command,
                                                                               java.net.URI buildDirectoryURI)
        Deprecated.
      • stripCommand

        default java.util.List<java.lang.String> stripCommand​(java.util.List<java.lang.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 command
        resources - the resources this command compiles for usually returned by getResourcesFromCommand()
        Returns:
        the stripped command
        Since:
        6.1
      • matches

        default boolean matches​(java.util.Map<java.lang.String,​java.lang.String> properties)
        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