Class DotNetWrapper
- All Implemented Interfaces:
ExtensionPoint,Describable<BuildWrapper>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe descriptor for the .NET wrapper.Nested classes/interfaces inherited from class jenkins.tasks.SimpleBuildWrapper
SimpleBuildWrapper.Context, SimpleBuildWrapper.DisposerNested classes/interfaces inherited from class hudson.tasks.BuildWrapper
BuildWrapper.EnvironmentNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
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.booleanDetermines whether this .NET wrapper will enforce a specific SDK version.voidSets the name of the SDK that this wrapper will make available.voidsetSpecificSdkVersion(boolean specificSdkVersion) Determines whether this .NET wrapper should enforce a specific SDK version.voidsetUp(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, setUpMethods inherited from class hudson.tasks.BuildWrapper
all, getProjectAction, setUpMethods 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
nullif 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.jsonfile will be created to ensure a specific SDK version gets used.- Returns:
truewhenglobal.jsonwill be used to ensure a specific SDK version gets used;falseotherwise.
-
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.jsonfile will be created to ensure a specific SDK version gets used.- Parameters:
specificSdkVersion-trueifglobal.jsonshould be used to ensure a specific SDK version gets used;falseotherwise.
-
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:
setUpin 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:
IOExceptionInterruptedException
-
createLoggerDecorator
Creates a new logger decorator for the wrapper.- Overrides:
createLoggerDecoratorin classSimpleBuildWrapper- Parameters:
build- The build in which this wrapper is being run.- Returns:
- A new
DiagnosticFilterinstance.
-