If it is a builder you can get the builderslist assuming the job is a 
Project is of MatrixProject type as these implement the getBuilders() 
http://javadoc.jenkins-ci.org/hudson/model/Project.html#getBuilders()
http://javadoc.jenkins-ci.org/hudson/matrix/MatrixProject.html#getBuilders()

Example code 
prebuild(AbstractBuild build,  BuildListener, listener) {

AbstractProject project = build.getProject();

   if(project instanceof Project || project instanceof MatrixProject) {
       List builders = project.getBuilders();

       // check for builder you want in list
       // do anything needed
   }
}

You could also use the the getBuildersList() from the Project if you need 
it.

If the descriptor implements the checking for the Project or MatrixProject 
in the isApplicable() method you might not need to check that.

Chris


On Tuesday, June 19, 2012 1:59:24 PM UTC+1, Christian Wolfgang wrote:
>
> What kind of build step? If it's a publisher you can use 
> project.getPublishersList(). 
>
> On Tue, Jun 19, 2012 at 2:42 PM, damarte <[email protected]> wrote: 
> > I am trying to get a list of build steps in the project on my 
> JobProperty in 
> > the prebuild method. I would like to know if a certain build step is 
> present 
> > in the project and during the prebuild method. I have a plug-in that 
> extends 
> > a JobProperty to initiate a connection at the beginning of the job and 
> > disconnects when the job completes. I would like the JobProperty to only 
> do 
> > this when there is a certain builder I extended in my plug-in is present 
> in 
> > the project as a build step. I appreciate any suggestions. 
> > 
> > 
> > Thanks 
>

Reply via email to