Class DotNetWrapper
- All Implemented Interfaces:
ExtensionPoint
,Describable<BuildWrapper>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The descriptor for the .NET wrapper.Nested classes/interfaces inherited from class jenkins.tasks.SimpleBuildWrapper
SimpleBuildWrapper.Context, SimpleBuildWrapper.Disposer
Nested classes/interfaces inherited from class hudson.tasks.BuildWrapper
BuildWrapper.Environment
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateLoggerDecorator
(Run<?, ?> build) Creates a new logger decorator for the wrapper.getSdk()
Gets the name of the SDK that this wrapper will make available.boolean
Determines whether this .NET wrapper will enforce a specific SDK version.void
Sets the name of the SDK that this wrapper will make available.void
setSpecificSdkVersion
(boolean specificSdkVersion) Determines whether this .NET wrapper should enforce a specific SDK version.void
setUp
(SimpleBuildWrapper.Context context, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars initialEnvironment) Sets up the .NET wrapper.Methods inherited from class jenkins.tasks.SimpleBuildWrapper
createContext, decorateLauncher, decorateLogger, getProjectActions, makeBuildVariables, makeSensitiveBuildVariables, preCheckout, requiresWorkspace, runPreCheckout, setUp, setUp
Methods inherited from class hudson.tasks.BuildWrapper
all, getProjectAction, setUp
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
DotNetWrapper
@DataBoundConstructor public DotNetWrapper()Creates a new .NET wrapper.
-
-
Method Details
-
getSdk
Gets the name of the SDK that this wrapper will make available.- Returns:
- The name of the SDK that this wrapper will make available, or
null
if none was set (which will cause a runtime exception if the wrapper gets used).
-
setSdk
Sets the name of the SDK that this wrapper will make available.- Parameters:
sdk
- The name of the SDK to make available.
-
isSpecificSdkVersion
public boolean isSpecificSdkVersion()Determines whether this .NET wrapper will enforce a specific SDK version.This mainly matters for Windows agents that have an SDK installed at the system level. Some SDK versions will always run the most recent SDK version available on the system; with this set, a
global.json
file will be created to ensure a specific SDK version gets used.- Returns:
true
whenglobal.json
will be used to ensure a specific SDK version gets used;false
otherwise.
-
setSpecificSdkVersion
@DataBoundSetter public void setSpecificSdkVersion(boolean specificSdkVersion) Determines whether this .NET wrapper should enforce a specific SDK version.This mainly matters for Windows agents that have an SDK installed at the system level. Some SDK versions will always run the most recent SDK version available on the system; with this set, a
global.json
file will be created to ensure a specific SDK version gets used.- Parameters:
specificSdkVersion
-true
ifglobal.json
should be used to ensure a specific SDK version gets used;false
otherwise.
-
setUp
public void setUp(@NonNull SimpleBuildWrapper.Context context, @NonNull Run<?, ?> build, @NonNull FilePath workspace, @NonNull Launcher launcher, @NonNull TaskListener listener, @NonNull EnvVars initialEnvironment) throws IOException, InterruptedExceptionSets up the .NET wrapper.This will ensure that a valid SDK is specified, then extends the environment with the SDK's variables. If requested, it will also set up a
global.json
(and arrange for it to be cleaned up when the wrapper ends).- Overrides:
setUp
in classSimpleBuildWrapper
- Parameters:
context
- The context the wrapper is run in.build
- The build in which this wrapper is being run.workspace
- The workspace in which the wrapper is being activated.launcher
- The launcher the wrapper can use to execute programs, if needed.listener
- The listener for the build.initialEnvironment
- The initial environment for the wrapper.- Throws:
IOException
InterruptedException
-
createLoggerDecorator
Creates a new logger decorator for the wrapper.- Overrides:
createLoggerDecorator
in classSimpleBuildWrapper
- Parameters:
build
- The build in which this wrapper is being run.- Returns:
- A new
DiagnosticFilter
instance.
-