Class Restore
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
io.jenkins.plugins.dotnet.commands.Command
io.jenkins.plugins.dotnet.commands.Restore
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,SimpleBuildStep
A build step to run "
dotnet restore
", restoring packages for a project.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A descriptor for "dotnet restore
" build steps.Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Nested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
-
Field Summary
Fields inherited from class io.jenkins.plugins.dotnet.commands.Command
sdk, showSdkInfo, shutDownBuildServers, unstableIfErrors, unstableIfWarnings, workDirectory
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds command line arguments for this "dotnet restore
" invocation.Gets the NuGet configuration (nuget.config) file to use.Gets the path to the lock file.Gets the directory to use for restored packages.Gets the project to restore.Gets the runtime identifiers to use.String[]
Gets the runtime identifiers to use.Gets the runtime identifiers to use.Gets the sole package source to use.String[]
Gets the package sources to use.Gets the package sources to use.Gets the verbosity to use for the command.boolean
Determines whether multiple projects can be restored in parallel.boolean
isForce()
Determines whether dependency resolution should be forced.boolean
Determines whether all dependencies should be re-evaluated even when a lock file exists.boolean
Determines whether failed sources should be ignored.boolean
Determines whether updating the project lock file is allowed.boolean
Determines whether HTTP requests should be cached.boolean
Determines whether to ignore project-to-project dependencies.boolean
Determines whether a project lock file should be generated and used.void
setConfigfile
(String configfile) Sets the NuGet configuration (nuget.config) file to use.void
setDisableParallel
(boolean disableParallel) Determines whether multiple projects can be restored in parallel.void
setForce
(boolean force) Determines whether dependency resolution should be forced.void
setForceEvaluate
(boolean forceEvaluate) Determines whether all dependencies should be re-evaluated even when a lock file exists.void
setIgnoreFailedSources
(boolean ignoreFailedSources) Determines whether failed sources should be ignored.void
setLockedMode
(boolean lockedMode) Determines whether updating the project lock file is allowed.void
setLockFilePath
(String lockFilePath) Sets the path to the lock file.void
setNoCache
(boolean noCache) Determines whether HTTP requests should be cached.void
setNoDependencies
(boolean noDependencies) Determines whether to ignore project-to-project dependencies.void
setPackages
(String packages) Sets the directory to use for restored packages.void
setProject
(String project) Sets the project to restore.void
setRuntime
(String runtime) Sets the sole runtime identifier to use.void
setRuntimes
(String... runtimes) Sets the runtime identifiers to use.void
setRuntimesString
(String runtimes) Sets the runtime identifiers to use.void
Sets the sole package source to use.void
setSources
(String... sources) Sets the package sources to use.void
setSourcesString
(String sources) Sets the package sources to use.void
setUseLockFile
(boolean useLockFile) Determines whether a project lock file should be generated and used.void
setVerbosity
(String verbosity) Sets the verbosity to use for the command.Methods inherited from class io.jenkins.plugins.dotnet.commands.Command
getCharset, getDescriptor, getSdk, getSdkDescriptor, getWorkDirectory, isContinueOnError, isShowSdkInfo, isSpecificSdkVersion, perform, setCharset, setContinueOnError, setSdk, setShowSdkInfo, setSpecificSdkVersion, setWorkDirectory
Methods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuild
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuild
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
Constructor Details
-
Restore
@DataBoundConstructor public Restore()Creates a new "dotnet restore
" build step.
-
-
Method Details
-
addCommandLineArguments
Adds command line arguments for this "dotnet restore
" invocation.This adds:
restore
- The project specified via
setProject(String)
. --configfile xxx
, if a config file was specified viasetConfigfile(String)
.--disable-parallel
, if requested viasetDisableParallel(boolean)
.--force
, if requested viasetForce(boolean)
.--force-evaluate
, if requested viasetForceEvaluate(boolean)
.--ignore-failed-sources
, if requested viasetIgnoreFailedSources(boolean)
.--lock-file-path xxx
, if a lock file path was specified viasetLockFilePath(String)
.--locked-mode
, if requested viasetLockedMode(boolean)
.--no-cache
, if requested viasetNoCache(boolean)
.--no-dependencies
, if requested viasetNoDependencies(boolean)
.--packages xxx
, if a package directory was specified viasetPackages(String)
.-
-r:xxx
for each runtime identifier specified viasetRuntime(String)
,setRuntimes(String...)
orsetRuntimesString(String)
. -
-s:xxx
for each source specified viasetSourcesString(String)
,setSources(String...)
orsetSourcesString(String)
. --use-lock-file
, if requested viasetUseLockFile(boolean)
.-v:xxx
, if a verbosity has been specified viasetVerbosity(String)
.
- Overrides:
addCommandLineArguments
in classCommand
- Parameters:
args
- The current set of arguments.
-
getConfigfile
Gets the NuGet configuration (nuget.config) file to use.- Returns:
- The NuGet configuration (nuget.config) file to use.
-
setConfigfile
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.
-
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.
-
isForceEvaluate
public boolean isForceEvaluate()Determines whether all dependencies should be re-evaluated even when a lock file exists.- Returns:
true
when all dependencies are re-evaluated even when a lock file exists;false
otherwise.
-
setForceEvaluate
@DataBoundSetter public void setForceEvaluate(boolean forceEvaluate) Determines whether all dependencies should be re-evaluated even when a lock file exists.- Parameters:
forceEvaluate
-true
to re-evaluate all dependencies even when a lock file exists;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.
-
getLockFilePath
Gets the path to the lock file.- Returns:
- The path to the lock file.
-
setLockFilePath
Sets the path to the lock file.- Parameters:
lockFilePath
- The path to the lock file.
-
isLockedMode
public boolean isLockedMode()Determines whether updating the project lock file is allowed.- Returns:
true
when updating the project lock file is not allowed;false
otherwise.
-
setLockedMode
@DataBoundSetter public void setLockedMode(boolean lockedMode) Determines whether updating the project lock file is allowed.- Parameters:
lockedMode
-true
to disallow updating the project lock file;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.
-
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.
-
getPackages
Gets the directory to use for restored packages.- Returns:
- The directory to use for restored packages.
-
setPackages
Sets the directory to use for restored packages.- Parameters:
packages
- The directory to use for restored packages.
-
getProject
Gets the project to restore.- Returns:
- The project to restore.
-
setProject
Sets the project to restore.- Parameters:
project
- The project to restore.
-
getRuntime
Gets the runtime identifiers to use.- Returns:
- The runtime identifiers to use.
-
setRuntime
Sets the sole runtime identifier to use.To set more than one, use
setRuntimes(String...)
instead.- Parameters:
runtime
- The sole runtime identifier to use.
-
getRuntimes
Gets the runtime identifiers to use.- Returns:
- The runtime identifiers to use.
-
setRuntimes
Sets the runtime identifiers to use.- Parameters:
runtimes
- The runtime identifiers to use.
-
getRuntimesString
Gets the runtime identifiers to use.- Returns:
- The runtime identifiers to use.
-
setRuntimesString
Sets the runtime identifiers to use.- Parameters:
runtimes
- The runtime identifiers to use.
-
getSource
Gets the sole package source to use.- Returns:
- The sole package source to use, or
null
when there is not exactly one package source set.
-
setSource
Sets the sole package source to use.To set more than one, use
setSources(String...)
instead.- Parameters:
source
- The sole package source to use.
-
getSources
Gets the package sources to use.- Returns:
- The package sources to use.
-
setSources
Sets the package sources to use.- Parameters:
sources
- The package sources to use.
-
getSourcesString
Gets the package sources to use.- Returns:
- The package sources to use.
-
setSourcesString
Sets the package sources to use.- Parameters:
sources
- The package sources to use.
-
isUseLockFile
public boolean isUseLockFile()Determines whether a project lock file should be generated and used.- Returns:
true
when a project lock file is generated and used;false
otherwise.
-
setUseLockFile
@DataBoundSetter public void setUseLockFile(boolean useLockFile) Determines whether a project lock file should be generated and used.- Parameters:
useLockFile
-true
to generate and use a project lock file;false
otherwise.
-
getVerbosity
Gets the verbosity to use for the command.- Returns:
- The verbosity to use for the command.
-
setVerbosity
Sets the verbosity to use for the command.- Parameters:
verbosity
- The verbosity to use for the command.
-