hudson.plugins.nant
Class NantBuilder

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Builder
          extended by hudson.plugins.nant.NantBuilder
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Builder>, hudson.tasks.BuildStep

public class NantBuilder
extends hudson.tasks.Builder

Sample Builder.

When the user configures the project and enables this builder, Descriptor.newInstance(StaplerRequest) is invoked and a new NantBuilder is created. The created instance is persisted to the project configuration XML by using XStream, so this allows you to use instance fields (like nantName) to remember the configuration.

When a build is performed, the BuildStepCompatibilityLayer.perform(Build, Launcher, BuildListener) method will be invoked.

Author:
kyle.sweeney@valtech.com

Nested Class Summary
static class NantBuilder.DescriptorImpl
          Descriptor for NantBuilder.
static class NantBuilder.NantInstallation
           
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
static NantBuilder.DescriptorImpl DESCRIPTOR
          Descriptor should be singleton.
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
NantBuilder(java.lang.String nantBuildFile, java.lang.String nantName, java.lang.String targets)
          When this builder is created in the project configuration step, the builder object will be created from the strings below.
 
Method Summary
 hudson.model.Descriptor<hudson.tasks.Builder> getDescriptor()
           
 NantBuilder.NantInstallation getNant()
          Gets the NAnt to invoke, or null to invoke the default one.
 java.lang.String getNantBuildFile()
           
 java.lang.String getNantName()
           
 java.lang.String getTargets()
          We'll use these from the config.jelly.
 boolean perform(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
           
 
Methods inherited from class hudson.tasks.Builder
all, getProjectAction, getRequiredMonitorService, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, 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, prebuild
 

Field Detail

DESCRIPTOR

@Extension
public static final NantBuilder.DescriptorImpl DESCRIPTOR
Descriptor should be singleton.

Constructor Detail

NantBuilder

@DataBoundConstructor
public NantBuilder(java.lang.String nantBuildFile,
                                        java.lang.String nantName,
                                        java.lang.String targets)
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 fild
targets - Whitespace separated list of nant targets to run
Method Detail

getNant

public NantBuilder.NantInstallation getNant()
Gets the NAnt to invoke, or null to invoke the default one.


getTargets

public java.lang.String getTargets()
We'll use these from the config.jelly.


getNantBuildFile

public java.lang.String getNantBuildFile()

getNantName

public java.lang.String getNantName()

perform

public boolean perform(hudson.model.AbstractBuild<?,?> build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
                throws java.lang.InterruptedException,
                       java.io.IOException
Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer
Throws:
java.lang.InterruptedException
java.io.IOException

getDescriptor

public hudson.model.Descriptor<hudson.tasks.Builder> getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<hudson.tasks.Builder>
Overrides:
getDescriptor in class hudson.tasks.Builder


Copyright © 2009. All Rights Reserved.