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

public final class Publish extends MSBuildCommand
A build step to run "dotnet publish", publishing a project.
  • Constructor Details

    • Publish

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

    • addCommandLineArguments

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

      This adds:

      1. Any arguments added by MSBuildCommand.addCommandLineArguments(DotNetArguments).
      2. --force, if requested via setForce(boolean).
      3. -f:xxx, if a target framework moniker has been specified via setFramework(String).
      4. --manifest xxx for each manifest specified via setManifest(String), setManifests(String...) or setManifestsString(String).
      5. --no-build, if requested via setNoBuild(boolean).
      6. --no-dependencies, if requested via setNoDependencies(boolean).
      7. --no-restore, if requested via setNoRestore(boolean).
      8. -r:xxx, if a runtime identifier has been specified via setRuntime(String).
      9. --self-contained true/false, if a value has been specified via setSelfContained(Boolean).
      10. --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.
    • getManifest

      @CheckForNull public String getManifest()
      Gets the sole manifest to use.
      Returns:
      The sole manifest to use, or null when there is not exactly one manifest set.
    • setManifest

      @DataBoundSetter public void setManifest(@CheckForNull String manifest)
      Sets the sole manifest to use.

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

      Parameters:
      manifest - The sole manifest to use.
    • getManifests

      @CheckForNull public String[] getManifests()
      Gets the manifests to use.
      Returns:
      The manifests to use.
    • setManifests

      @DataBoundSetter public void setManifests(@CheckForNull String... manifests)
      Sets the manifests to use.
      Parameters:
      manifests - The manifests to use.
    • getManifestsString

      @CheckForNull public String getManifestsString()
      Gets the manifests to use.
      Returns:
      The manifests to use.
    • setManifestsString

      @DataBoundSetter public void setManifestsString(@CheckForNull String manifests)
      Sets the manifests to use.
      Parameters:
      manifests - The manifests to use.
    • isNoBuild

      public boolean isNoBuild()
      Determines whether a build should be performed before publishing.
      Returns:
      true when neither a restore nor a build will be performed before publishing; false otherwise.
    • setNoBuild

      @DataBoundSetter public void setNoBuild(boolean noBuild)
      Determines whether a build should be performed before publishing.
      Parameters:
      noBuild - true to perform neither a restore nor a build before publishing; false otherwise.
    • 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.
    • 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.
    • getSelfContained

      @CheckForNull public Boolean getSelfContained()
      Determines whether the project should be published self-contained.
      Returns:
      null when the project decides; true when publishing self-contained; false otherwise.
    • setSelfContained

      @DataBoundSetter public void setSelfContained(@CheckForNull Boolean selfContained)
      Determines whether the project should be published self-contained.
      Parameters:
      selfContained - null to let the project decide; true to publish self-contained; false otherwise.
    • 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.