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

public final class Restore extends ToolCommand
A build step to run "dotnet tool restore", restoring local tools as described in a tool manifest.
  • Constructor Details

    • Restore

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

    • addCommandLineArguments

      protected void addCommandLineArguments(@NonNull DotNetArguments args) throws AbortException
      Adds command line arguments for this "dotnet nuget push" invocation.

      This adds:

      1. Any arguments added by ToolCommand.addCommandLineArguments(DotNetArguments).
      2. --add-source xxx, for each source specified via setAdditionalSource(String), setAdditionalSources(String...) or setAdditionalSourcesString(String).
      3. --configfile xxx, if a config file was specified via setConfigfile(String).
      4. --disable-parallel, if requested via setDisableParallel(boolean).
      5. --ignore-failed-sources, if requested via setIgnoreFailedSources(boolean).
      6. --no-cache, if requested via setNoCache(boolean).
      7. --tool-manifest xxx, if a tool manifest was specified via setToolManifest(String).
      8. -v:xxx, if a verbosity has been specified via setVerbosity(String).
      Overrides:
      addCommandLineArguments in class ToolCommand
      Parameters:
      args - The current set of arguments.
      Throws:
      AbortException - When something goes wrong.
    • getAdditionalSource

      public String getAdditionalSource()
      Gets the sole additional source to use for the restore.
      Returns:
      The sole additional source to use for the restore, or null when there is not exactly one additional source set.
    • setAdditionalSource

      @DataBoundSetter public void setAdditionalSource(String additionalSource)
      Sets the sole additional source to use for the restore.

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

      Parameters:
      additionalSource - The sole additional source to use for the restore.
    • getAdditionalSources

      public String[] getAdditionalSources()
      Gets the list of additional sources to use for the restore.
      Returns:
      The list of additional sources to use for the restore.
    • setAdditionalSources

      @DataBoundSetter public void setAdditionalSources(String... additionalSources)
      Sets the list of additional sources to use for the restore.
      Parameters:
      additionalSources - The list of additional sources to use for the restore.
    • getAdditionalSourcesString

      public String getAdditionalSourcesString()
      Gets the list of additional sources to use for the restore.
      Returns:
      The list of additional sources to use for the restore.
    • setAdditionalSourcesString

      @DataBoundSetter public void setAdditionalSourcesString(String additionalSources)
      Sets the list of additional sources to use for the restore.
      Parameters:
      additionalSources - The list of additional sources to use for the restore.
    • getConfigfile

      public String getConfigfile()
      Gets the NuGet configuration (nuget.config) file to use.
      Returns:
      The NuGet configuration (nuget.config) file to use.
    • setConfigfile

      @DataBoundSetter public void setConfigfile(String configfile)
      Sets the NuGet configuration (nuget.config) file to use.
      Parameters:
      configfile - The NuGet configuration (nuget.config) file to use.
    • isDisableParallel

      public boolean isDisableParallel()
      Determines whether multiple projects can be restored in parallel.
      Returns:
      true when multiple projects are restored one by one; false otherwise.
    • setDisableParallel

      @DataBoundSetter public void setDisableParallel(boolean disableParallel)
      Determines whether multiple projects can be restored in parallel.
      Parameters:
      disableParallel - true to restore multiple projects one by one; false otherwise.
    • isIgnoreFailedSources

      public boolean isIgnoreFailedSources()
      Determines whether failed sources should be ignored.
      Returns:
      true when failed sources are ignored; false otherwise.
    • setIgnoreFailedSources

      @DataBoundSetter public void setIgnoreFailedSources(boolean ignoreFailedSources)
      Determines whether failed sources should be ignored.
      Parameters:
      ignoreFailedSources - true to ignore failed sources; false otherwise.
    • isNoCache

      public boolean isNoCache()
      Determines whether HTTP requests should be cached.
      Returns:
      true when HTTP requests are not cached; false otherwise.
    • setNoCache

      @DataBoundSetter public void setNoCache(boolean noCache)
      Determines whether HTTP requests should be cached.
      Parameters:
      noCache - true not to cache HTTP requests; false otherwise.
    • getToolManifest

      public String getToolManifest()
      Gets the path to the manifest file.
      Returns:
      The path to the manifest file.
    • setToolManifest

      @DataBoundSetter public void setToolManifest(String toolManifest)
      Sets the path to the manifest file.
      Parameters:
      toolManifest - The path to the manifest file.
    • getVerbosity

      @CheckForNull public String getVerbosity()
      Gets the verbosity to use for the command.
      Returns:
      The verbosity to use for the command.
    • setVerbosity

      @DataBoundSetter public void setVerbosity(@CheckForNull String verbosity)
      Sets the verbosity to use for the command.
      Parameters:
      verbosity - The verbosity to use for the command.