Class MSBuildCommand
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
io.jenkins.plugins.dotnet.commands.Command
io.jenkins.plugins.dotnet.commands.msbuild.MSBuildCommand
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,SimpleBuildStep
A build step executing an MSBuild-based .NET CLI command.
-
Nested Class Summary
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
Modifier and TypeFieldDescriptionprotected String
The project configuration to use.protected boolean
Flag indicating whether the MSBuild version/copyright lines should be suppressed.protected String
Additional options to pass to the command.protected String
The output directory for the command.protected String
The project to process; for some commands this can also be a directory or a solution.protected String
MSBuild properties to set.protected String
The verbosity to use for the command.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
ConstructorDescriptionCreates a newdotnet
build step based on MSBuild processing.MSBuildCommand
(String command) Creates a newdotnet
build step based on MSBuild processing. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds command line arguments for this invocation of thedotnet
CLI.Gets the project configuration to use.Gets the single additional option to pass to the command.String[]
Gets additional options to pass to the command.Gets additional options to pass to the command.Gets the output directory for the command.Gets the name of the project file to process.Gets MSBuild properties to be applied to the command.Gets MSBuild properties to be applied to the command.Gets the verbosity to use for the command.boolean
isNologo()
Determines whether the MSBuild version/copyright lines should be suppressed.boolean
Determines whether any build servers started by the main command should be shut down.boolean
Determines whether the presence of errors makes the build unstable (instead of failed).boolean
Determines whether the presence of warnings makes the build unstable (instead of successful).void
setConfiguration
(String configuration) Sets the project configuration to use.void
setNologo
(boolean noLogo) Determines whether the MSBuild version/copyright lines should be suppressed.void
Sets a single additional option to pass to the command.void
setOptions
(String... options) Sets additional options to pass to the command.void
setOptionsString
(String options) Sets additional options to pass to the command.void
setOutputDirectory
(String outputDirectory) Sets the output directory for the command.void
setProject
(String project) Sets the name of the project file to process.void
setProperties
(Map<String, String> properties) Sets MSBuild properties to be applied to the command.void
setPropertiesString
(String properties) Sets MSBuild properties to be applied to the command.void
setShutDownBuildServers
(boolean shutDownBuildServers) Determines whether any build servers started by the main command should be shut down.void
setUnstableIfErrors
(boolean unstableIfErrors) Determines whether the presence of errors makes the build unstable (instead of failed).void
setUnstableIfWarnings
(boolean unstableIfWarnings) Determines whether the presence of warnings makes the build unstable (instead of successful).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
-
Field Details
-
configuration
The project configuration to use. -
nologo
protected boolean nologoFlag indicating whether the MSBuild version/copyright lines should be suppressed. -
options
Additional options to pass to the command. Options specified via more specific settings will take precedence over options specified here. -
outputDirectory
The output directory for the command. -
project
The project to process; for some commands this can also be a directory or a solution. -
properties
MSBuild properties to set. -
verbosity
The verbosity to use for the command.
-
-
Constructor Details
-
MSBuildCommand
public MSBuildCommand()Creates a newdotnet
build step based on MSBuild processing. -
MSBuildCommand
Creates a newdotnet
build step based on MSBuild processing.- Parameters:
command
- Thedotnet
command to execute.
-
-
Method Details
-
addCommandLineArguments
Adds command line arguments for this invocation of thedotnet
CLI.This adds:
- The command name, if applicable.
- The project specified via
setProject(String)
. -
Any raw options specified via
setOption(String)
,setOptions(String...)
orsetOptionsString(String)
. -c:xxx
, if a configuration has been specified viasetConfiguration(String)
.--nologo
, if requested viasetNologo(boolean)
.--output xxx
, if an output directory has been specified viasetOutputDirectory(String)
.-
-p:name=value
, for all properties specified viasetProperties(Map)
orsetPropertiesString(String)
. -v:xxx
, if a verbosity has been specified viasetVerbosity(String)
.
- Overrides:
addCommandLineArguments
in classCommand
- Parameters:
args
- The current set of arguments.
-
getConfiguration
Gets the project configuration to use.- Returns:
- The project configuration to use.
-
setConfiguration
Sets the project configuration to use.- Parameters:
configuration
- The project configuration to use.
-
isNologo
public boolean isNologo()Determines whether the MSBuild version/copyright lines should be suppressed.- Returns:
true
if the MSBuild startup banner should be suppressed;false
otherwise.
-
setNologo
@DataBoundSetter public void setNologo(boolean noLogo) Determines whether the MSBuild version/copyright lines should be suppressed.- Parameters:
noLogo
-true
if the MSBuild startup banner should be suppressed;false
otherwise.
-
getOption
Gets the single additional option to pass to the command.- Returns:
- An additional option to pass to the command, or
null
when there is not exactly one such option set.
-
setOption
Sets a single additional option to pass to the command.To set more than one, use
setOptions(String...)
instead.- Parameters:
option
- An additional option to pass to the command.
-
getOptions
Gets additional options to pass to the command.- Returns:
- Additional options to pass to the command.
-
setOptions
Sets additional options to pass to the command. Options specified via more specific settings will take precedence over options specified here.- Parameters:
options
- Additional options to pass to the command.
-
getOptionsString
Gets additional options to pass to the command. Options specified via more specific settings will take precedence over options specified here.- Returns:
- Additional options to pass to the command.
-
setOptionsString
Sets additional options to pass to the command. Options specified via more specific settings will take precedence over options specified here.- Parameters:
options
- Additional options to pass to the command.
-
getOutputDirectory
Gets the output directory for the command.- Returns:
- The output directory for the command.
-
setOutputDirectory
Sets the output directory for the command.- Parameters:
outputDirectory
- The output directory for the command.
-
getProject
Gets the name of the project file to process. For some commands, this can also be a directory or a solution file. Whennull
, a project or solution from the current directory will usually be processed.- Returns:
- The project to process.
-
setProject
Sets the name of the project file to process. For some commands, this can also be a directory or a solution file. Whennull
, a project or solution from the current directory will usually be processed.- Parameters:
project
- The project to process.
-
getProperties
Gets MSBuild properties to be applied to the command.- Returns:
- MSBuild properties to be applied to the command (one key=value setting per line).
- Throws:
IOException
- When there is a problem loading the properties into a JavaProperties
object.
-
setProperties
@DataBoundSetter public void setProperties(@CheckForNull Map<String, String> properties) throws IOExceptionSets MSBuild properties to be applied to the command.- Parameters:
properties
- MSBuild properties to be applied to the command (one key=value setting per line).- Throws:
IOException
- When there is a problem using aProperties
object to generate a string form for the map.
-
getPropertiesString
Gets MSBuild properties to be applied to the command.- Returns:
- MSBuild properties to be applied to the command (one key=value setting per line).
-
setPropertiesString
Sets MSBuild properties to be applied to the command.- Parameters:
properties
- MSBuild properties to be applied to the command (one key=value setting per line).
-
isShutDownBuildServers
public boolean isShutDownBuildServers()Determines whether any build servers started by the main command should be shut down.- Returns:
true
if "dotnet build-server shutdown
" should be run after the main command;false
otherwise.
-
setShutDownBuildServers
@DataBoundSetter public void setShutDownBuildServers(boolean shutDownBuildServers) Determines whether any build servers started by the main command should be shut down.- Parameters:
shutDownBuildServers
-true
if "dotnet build-server shutdown
" should be run after the main command;false
otherwise.
-
isUnstableIfErrors
public boolean isUnstableIfErrors()Determines whether the presence of errors makes the build unstable (instead of failed).- Returns:
true
if errors cause the build to be marked as unstable (instead of failed);false
otherwise.
-
setUnstableIfErrors
@DataBoundSetter public void setUnstableIfErrors(boolean unstableIfErrors) Determines whether the presence of errors makes the build unstable (instead of failed).- Parameters:
unstableIfErrors
-true
if errors cause the build to be marked as unstable (instead of failed);false
otherwise.
-
isUnstableIfWarnings
public boolean isUnstableIfWarnings()Determines whether the presence of warnings makes the build unstable (instead of successful).- Returns:
true
if warnings cause the build to be marked as unstable (instead of successful);false
otherwise.
-
setUnstableIfWarnings
@DataBoundSetter public void setUnstableIfWarnings(boolean unstableIfWarnings) Determines whether the presence of warnings makes the build unstable (instead of successful).- Parameters:
unstableIfWarnings
-true
if warnings cause the build to be marked as unstable (instead of successful);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.
-