Interface CommandLineArgs

  • All Superinterfaces:
    AddsToRuleKey, CommandLineArgsApi, com.google.devtools.build.lib.skylarkinterface.SkylarkPrintable, com.google.devtools.build.lib.skylarkinterface.SkylarkValue
    All Known Implementing Classes:
    ImmutableRunInfo, RunInfo

    public interface CommandLineArgs
    extends AddsToRuleKey, CommandLineArgsApi
    Container for a list of objects that can be stringified into command line arguments for an action that executes a program.

    In the future this will also let us more efficiently concatenate command line arguments that are passed around as providers, as the CommandLineArgs objects may store the immutable objects more efficiently, and just construct a stream to interate over those internal collections.

    • Method Detail

      • getEnvironmentVariables

        com.google.common.collect.ImmutableSortedMap<String,​String> getEnvironmentVariables()
        Returns:
        Get a map of all environment variables that need to be added to execute this program.
      • getEstimatedArgsCount

        int getEstimatedArgsCount()
        Get the approximate number of arguments that will be returned for getArgsAndFormatStrings()

        This can be handy to pre-size destination collections

        Returns:
        the approximate number of arguments. If retrieving the accurate count is efficient, a correct number is preferred. However if getting a correct number is impossible or expensive, an approximation is acceptable.
      • visitInputsAndOutputs

        void visitInputsAndOutputs​(java.util.function.Consumer<Artifact> inputs,
                                   java.util.function.Consumer<OutputArtifact> outputs)
        Add any artifacts from getArgsAndFormatStrings() to inputs and outputs, inferring based on type