Interface ICommand


  • public interface ICommand
    A builder command names a builder and supplies a table of name-value argument pairs.

    Changes to a command will only take effect if the modified command is installed into a project description via IProjectDescription.setBuildSpec(ICommand[]).

    See Also:
    IProjectDescription
    Restriction:
    This interface is not intended to be implemented by clients.
    Restriction:
    This interface is not intended to be extended by clients.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Map<String,​String> getArguments()
      Returns a table of the arguments for this command, or null if there are no arguments.
      String getBuilderName()
      Returns the name of the builder to run for this command, or null if the name has not been set.
      boolean isBuilding​(int kind)
      Returns whether this build command responds to the given kind of build.
      boolean isConfigurable()
      Returns whether this command allows configuring of what kinds of builds it responds to.
      void setArguments​(Map<String,​String> args)
      Sets this command's arguments to be the given table of name-values pairs, or to null if there are no arguments.
      void setBuilderName​(String builderName)
      Sets the name of the builder to run for this command.
      void setBuilding​(int kind, boolean value)
      Specifies whether this build command responds to the provided kind of build.
    • Method Detail

      • getArguments

        Map<String,​String> getArguments()
        Returns a table of the arguments for this command, or null if there are no arguments. The argument names and values are both strings.
        Returns:
        a table of command arguments (key type : String value type : String), or null
        See Also:
        setArguments(Map)
      • getBuilderName

        String getBuilderName()
        Returns the name of the builder to run for this command, or null if the name has not been set.
        Returns:
        the name of the builder, or null if not set
        See Also:
        setBuilderName(String)
      • isBuilding

        boolean isBuilding​(int kind)
        Returns whether this build command responds to the given kind of build.

        By default, build commands respond to all kinds of builds.

        Parameters:
        kind - One of the *_BUILD constants defined on IncrementalProjectBuilder
        Returns:
        true if this build command responds to the specified kind of build, and false otherwise.
        Since:
        3.1
        See Also:
        setBuilding(int, boolean)
      • isConfigurable

        boolean isConfigurable()
        Returns whether this command allows configuring of what kinds of builds it responds to. By default, commands are only configurable if the corresponding builder defines the isConfigurable() attribute in its builder extension declaration. A command that is not configurable will always respond to all kinds of builds.
        Returns:
        true If this command allows configuration of what kinds of builds it responds to, and false otherwise.
        Since:
        3.1
        See Also:
        setBuilding(int, boolean)
      • setArguments

        void setArguments​(Map<String,​String> args)
        Sets this command's arguments to be the given table of name-values pairs, or to null if there are no arguments. The argument names and values are both strings.

        Individual builders specify their argument expectations.

        Note that modifications to the arguments of a command being used in a running builder may affect the run of that builder but will not affect any subsequent runs. To change a command permanently you must install the command into the relevant project build spec using IProjectDescription.setBuildSpec(ICommand[]).

        Parameters:
        args - a table of command arguments (keys and values must both be of type String), or null
        See Also:
        getArguments()
      • setBuilderName

        void setBuilderName​(String builderName)
        Sets the name of the builder to run for this command.

        The builder name comes from the extension that plugs in to the standard org.eclipse.core.resources.builders extension point.

        Parameters:
        builderName - the name of the builder
        See Also:
        getBuilderName()
      • setBuilding

        void setBuilding​(int kind,
                         boolean value)
        Specifies whether this build command responds to the provided kind of build.

        When a command is configured to not respond to a given kind of build, the builder instance will not be called when a build of that kind is initiated.

        This method has no effect if this build command does not allow its build kinds to be configured.

        Note:

        • A request for INCREMENTAL_BUILD or AUTO_BUILD will result in the builder being called with the FULL_BUILD kind, if there is no previous delta (e.g. after a clean build).
        • If INCREMENTAL_BUILD (or AUTO_BUILD) is promoted to FULL_BUILD, the builder will be called, if the command responds to INCREMENTAL_BUILD (or AUTO_BUILD).
        • If INCREMENTAL_BUILD is promoted to FULL_BUILD, the builder will be called, if the command responds to FULL_BUILD.
        • If AUTO_BUILD is promoted to FULL_BUILD, the builder will be called, only if the command responds to AUTO_BUILD.
        Parameters:
        kind - One of the *_BUILD constants defined on IncrementalProjectBuilder
        value - true if this build command responds to the specified kind of build, and false otherwise.
        Since:
        3.1
        See Also:
        isBuilding(int), isConfigurable(), IWorkspace.build(int, IProgressMonitor), IProject.build(int, IProgressMonitor), IncrementalProjectBuilder.FULL_BUILD, IncrementalProjectBuilder.INCREMENTAL_BUILD, IncrementalProjectBuilder.AUTO_BUILD, IncrementalProjectBuilder.CLEAN_BUILD