Package hudson.plugins.nant
Class NantBuilder
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Builder
-
- hudson.plugins.nant.NantBuilder
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
public class NantBuilder extends Builder
SampleBuilder
.When the user configures the project and enables this builder,
Descriptor.newInstance(StaplerRequest)
is invoked and a newNantBuilder
is created. The created instance is persisted to the project configuration XML by using XStream, so this allows you to use instance fields (likenantName
) to remember the configuration.When a build is performed, the
#perform(Build, Launcher, BuildListener)
method will be invoked.- Author:
- kyle.sweeney@valtech.com, Justin Holzer (jsholzer@gmail.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NantBuilder.DescriptorImpl
Descriptor forNantBuilder
.static class
NantBuilder.NantInstallation
-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static NantBuilder.DescriptorImpl
DESCRIPTOR
Descriptor should be singleton.-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description NantBuilder(String nantBuildFile, String nantName, String targets, String properties)
When this builder is created in the project configuration step, the builder object will be created from the strings below.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Descriptor<Builder>
getDescriptor()
NantBuilder.NantInstallation
getNant()
Gets the NAnt to invoke, or null to invoke the default one.String
getNantBuildFile()
String
getNantName()
String
getProperties()
String
getTargets()
We'll use these from theconfig.jelly
.boolean
perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener)
-
Methods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuild
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, prebuild
-
-
-
-
Field Detail
-
DESCRIPTOR
@Extension public static final NantBuilder.DescriptorImpl DESCRIPTOR
Descriptor should be singleton.
-
-
Constructor Detail
-
NantBuilder
@DataBoundConstructor public NantBuilder(String nantBuildFile, String nantName, String targets, String properties)
When this builder is created in the project configuration step, the builder object will be created from the strings below.- Parameters:
nantBuildFile
- The name/location of the nant build fildtargets
- Whitespace separated list of nant targets to runproperties
- property definitions (in Java properties format)
-
-
Method Detail
-
getNant
public NantBuilder.NantInstallation getNant()
Gets the NAnt to invoke, or null to invoke the default one.
-
getTargets
public String getTargets()
We'll use these from theconfig.jelly
.
-
getNantBuildFile
public String getNantBuildFile()
-
getNantName
public String getNantName()
-
getProperties
public String getProperties()
-
perform
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException
- Specified by:
perform
in interfaceBuildStep
- Overrides:
perform
in classBuildStepCompatibilityLayer
- Throws:
InterruptedException
IOException
-
getDescriptor
public Descriptor<Builder> getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Builder>
- Overrides:
getDescriptor
in classBuilder
-
-