All Implemented Interfaces:
ExtensionPoint, Describable<Builder>, BuildStep, SimpleBuildStep

public final class Build extends MSBuildCommand
A build step to run "dotnet build", building a project.
  • Constructor Details

    • Build

      @DataBoundConstructor public Build()
      Creates a new "dotnet build" build step.
  • Method Details

    • addCommandLineArguments

      protected void addCommandLineArguments(@NonNull DotNetArguments args)
      Adds command line arguments for this "dotnet build" invocation.

      This adds:

      1. Any arguments added by MSBuildCommand.addCommandLineArguments(DotNetArguments).
      2. --force, if requested via setForce(boolean).
      3. --no-dependencies, if requested via setNoDependencies(boolean).
      4. --no-incremental, if requested via setNoIncremental(boolean).
      5. --no-restore, if requested via setNoRestore(boolean).
      6. -f:xxx, if a target framework moniker has been specified via setFramework(String).
      7. -r:xxx, if a runtime identifier has been specified via setRuntime(String).
      8. -t:xxx for each target specified via setTarget(String), setTargets(String...) or setTargetsString(String).
      9. --version-suffix xxx, if a version suffix has been specified via setRuntime(String).
      Overrides:
      addCommandLineArguments in class MSBuildCommand
      Parameters:
      args - The current set of arguments.
    • isForce

      public boolean isForce()
      Determines whether dependency resolution should be forced.
      Returns:
      true when all dependencies should be resolved even if the last restore was successful; false otherwise.
    • setForce

      @DataBoundSetter public void setForce(boolean force)
      Determines whether dependency resolution should be forced.
      Parameters:
      force - true to resolve all dependencies even if the last restore was successful; false otherwise.
    • getFramework

      @CheckForNull public String getFramework()
      Gets the target framework moniker to use.
      Returns:
      The target framework moniker to use.
    • setFramework

      @DataBoundSetter public void setFramework(@CheckForNull String framework)
      Sets the target framework moniker to use.
      Parameters:
      framework - The target framework moniker to use.
    • isNoDependencies

      public boolean isNoDependencies()
      Determines whether to ignore project-to-project dependencies.
      Returns:
      true when project-to-project dependencies are ignored; false otherwise.
    • setNoDependencies

      @DataBoundSetter public void setNoDependencies(boolean noDependencies)
      Determines whether to ignore project-to-project dependencies.
      Parameters:
      noDependencies - true when project-to-project dependencies should be ignored; false otherwise.
    • isNoIncremental

      public boolean isNoIncremental()
      Determines whether incremental builds are allowed.
      Returns:
      true when incremental builds are disabled; false otherwise.
    • setNoIncremental

      @DataBoundSetter public void setNoIncremental(boolean noIncremental)
      Determines whether incremental builds are allowed.
      Parameters:
      noIncremental - true to disallow incremental builds; false otherwise.
    • isNoRestore

      public boolean isNoRestore()
      Determines whether an implicit restore should be executed as part of this command.
      Returns:
      true when the implicit restore is disabled; false otherwise.
    • setNoRestore

      @DataBoundSetter public void setNoRestore(boolean noRestore)
      Determines whether an implicit restore should be executed as part of this command.
      Parameters:
      noRestore - true to disable the implicit restore; false otherwise.
    • getRuntime

      @CheckForNull public String getRuntime()
      Gets the runtime identifier to use.
      Returns:
      The runtime identifier to use.
    • setRuntime

      @DataBoundSetter public void setRuntime(@CheckForNull String runtime)
      Sets the runtime identifier to use.
      Parameters:
      runtime - The runtime identifier to use.
    • getTarget

      @CheckForNull public String getTarget()
      Gets the sole target to build.
      Returns:
      The sole target to build, or null when there is not exactly one target set.
    • setTarget

      @DataBoundSetter public void setTarget(@CheckForNull String target)
      Sets the sole target to build.

      To set more than one, use setTargets(String...) instead.

      Parameters:
      target - The sole target to build.
    • getTargets

      @CheckForNull public String[] getTargets()
      Gets the targets to build.
      Returns:
      The targets to build.
    • setTargets

      @DataBoundSetter public void setTargets(@CheckForNull String... targets)
      Sets the targets to build.
      Parameters:
      targets - The targets to build.
    • getTargetsString

      @CheckForNull public String getTargetsString()
      Gets the targets to build.
      Returns:
      The targets to build.
    • setTargetsString

      @DataBoundSetter public void setTargetsString(@CheckForNull String targets)
      Sets the targets to build.
      Parameters:
      targets - The targets to build.
    • getVersionSuffix

      @CheckForNull public String getVersionSuffix()
      Sets the version suffix to use.
      Returns:
      The version suffix to use.
    • setVersionSuffix

      @DataBoundSetter public void setVersionSuffix(@CheckForNull String versionSuffix)
      Sets the version suffix to use.
      Parameters:
      versionSuffix - The version suffix to use.