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
Nested ClassesModifier and TypeClassDescriptionstatic final classA descriptor for "dotnet restore" build steps.Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherListNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested 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, workDirectoryFields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds 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.booleanDetermines whether multiple projects can be restored in parallel.booleanisForce()Determines whether dependency resolution should be forced.booleanDetermines whether all dependencies should be re-evaluated even when a lock file exists.booleanDetermines whether failed sources should be ignored.booleanDetermines whether updating the project lock file is allowed.booleanDetermines whether HTTP requests should be cached.booleanDetermines whether to ignore project-to-project dependencies.booleanDetermines whether a project lock file should be generated and used.voidsetConfigfile(String configfile) Sets the NuGet configuration (nuget.config) file to use.voidsetDisableParallel(boolean disableParallel) Determines whether multiple projects can be restored in parallel.voidsetForce(boolean force) Determines whether dependency resolution should be forced.voidsetForceEvaluate(boolean forceEvaluate) Determines whether all dependencies should be re-evaluated even when a lock file exists.voidsetIgnoreFailedSources(boolean ignoreFailedSources) Determines whether failed sources should be ignored.voidsetLockedMode(boolean lockedMode) Determines whether updating the project lock file is allowed.voidsetLockFilePath(String lockFilePath) Sets the path to the lock file.voidsetNoCache(boolean noCache) Determines whether HTTP requests should be cached.voidsetNoDependencies(boolean noDependencies) Determines whether to ignore project-to-project dependencies.voidsetPackages(String packages) Sets the directory to use for restored packages.voidsetProject(String project) Sets the project to restore.voidsetRuntime(String runtime) Sets the sole runtime identifier to use.voidsetRuntimes(String... runtimes) Sets the runtime identifiers to use.voidsetRuntimesString(String runtimes) Sets the runtime identifiers to use.voidSets the sole package source to use.voidsetSources(String... sources) Sets the package sources to use.voidsetSourcesString(String sources) Sets the package sources to use.voidsetUseLockFile(boolean useLockFile) Determines whether a project lock file should be generated and used.voidsetVerbosity(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, setWorkDirectoryMethods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuildMethods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuildMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuildMethods 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:xxxfor each runtime identifier specified viasetRuntime(String),setRuntimes(String...)orsetRuntimesString(String). -
-s:xxxfor 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:
addCommandLineArgumentsin 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:
truewhen multiple projects are restored one by one;falseotherwise.
-
setDisableParallel
@DataBoundSetter public void setDisableParallel(boolean disableParallel) Determines whether multiple projects can be restored in parallel.- Parameters:
disableParallel-trueto restore multiple projects one by one;falseotherwise.
-
isForce
public boolean isForce()Determines whether dependency resolution should be forced.- Returns:
truewhen all dependencies should be resolved even if the last restore was successful;falseotherwise.
-
setForce
@DataBoundSetter public void setForce(boolean force) Determines whether dependency resolution should be forced.- Parameters:
force-trueto resolve all dependencies even if the last restore was successful;falseotherwise.
-
isForceEvaluate
public boolean isForceEvaluate()Determines whether all dependencies should be re-evaluated even when a lock file exists.- Returns:
truewhen all dependencies are re-evaluated even when a lock file exists;falseotherwise.
-
setForceEvaluate
@DataBoundSetter public void setForceEvaluate(boolean forceEvaluate) Determines whether all dependencies should be re-evaluated even when a lock file exists.- Parameters:
forceEvaluate-trueto re-evaluate all dependencies even when a lock file exists;falseotherwise.
-
isIgnoreFailedSources
public boolean isIgnoreFailedSources()Determines whether failed sources should be ignored.- Returns:
truewhen failed sources are ignored;falseotherwise.
-
setIgnoreFailedSources
@DataBoundSetter public void setIgnoreFailedSources(boolean ignoreFailedSources) Determines whether failed sources should be ignored.- Parameters:
ignoreFailedSources-trueto ignore failed sources;falseotherwise.
-
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:
truewhen updating the project lock file is not allowed;falseotherwise.
-
setLockedMode
@DataBoundSetter public void setLockedMode(boolean lockedMode) Determines whether updating the project lock file is allowed.- Parameters:
lockedMode-trueto disallow updating the project lock file;falseotherwise.
-
isNoCache
public boolean isNoCache()Determines whether HTTP requests should be cached.- Returns:
truewhen HTTP requests are not cached;falseotherwise.
-
setNoCache
@DataBoundSetter public void setNoCache(boolean noCache) Determines whether HTTP requests should be cached.- Parameters:
noCache-truenot to cache HTTP requests;falseotherwise.
-
isNoDependencies
public boolean isNoDependencies()Determines whether to ignore project-to-project dependencies.- Returns:
truewhen project-to-project dependencies are ignored;falseotherwise.
-
setNoDependencies
@DataBoundSetter public void setNoDependencies(boolean noDependencies) Determines whether to ignore project-to-project dependencies.- Parameters:
noDependencies-truewhen project-to-project dependencies should be ignored;falseotherwise.
-
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
nullwhen 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:
truewhen a project lock file is generated and used;falseotherwise.
-
setUseLockFile
@DataBoundSetter public void setUseLockFile(boolean useLockFile) Determines whether a project lock file should be generated and used.- Parameters:
useLockFile-trueto generate and use a project lock file;falseotherwise.
-
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.
-