hudson.ivy
Class IvyBuildTrigger

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Publisher
          extended by hudson.tasks.Notifier
              extended by hudson.ivy.IvyBuildTrigger
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.DependecyDeclarer, hudson.model.Describable<hudson.tasks.Publisher>, hudson.tasks.BuildStep

public class IvyBuildTrigger
extends hudson.tasks.Notifier
implements hudson.model.DependecyDeclarer

Trigger the build of other project based on the Ivy dependency management system.

Author:
jmetcalf@dev.java.net, martinficker@dev.java.net, hibou@dev.java.net

Nested Class Summary
static class IvyBuildTrigger.DescriptorImpl
          The descriptor implementation of this trigger
static class IvyBuildTrigger.IvyConfiguration
          Container for the Ivy configuration.
static class IvyBuildTrigger.UserCause
          This cause is used when triggering downstream builds from the external event trigger.
 
Nested classes/interfaces inherited from class hudson.tasks.Publisher
hudson.tasks.Publisher.DescriptorExtensionListImpl
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
static IvyBuildTrigger.DescriptorImpl DESCRIPTOR
          The descriptor of this trigger.
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
IvyBuildTrigger(java.lang.String ivyFile, java.lang.String ivyConfName)
          Constructor
 
Method Summary
 void buildDependencyGraph(hudson.model.AbstractProject owner, hudson.model.DependencyGraph graph)
          Build the dependency graph based on the Ivy ModuleDescriptor for this trigger.
 org.apache.ivy.Ivy getIvy()
           
 java.lang.String getIvyConfName()
           
 java.lang.String getIvyFile()
           
 hudson.tasks.BuildStepMonitor getRequiredMonitorService()
           
 boolean needsToRunAfterFinalized()
          IvyBuildTrigger is only responsible for helping to build dependency graphs based on Ivy settings and configuration.
 boolean perform(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          The BuildStep perform implementation.
 
Methods inherited from class hudson.tasks.Notifier
getDescriptor
 
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, 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 IvyBuildTrigger.DescriptorImpl DESCRIPTOR
The descriptor of this trigger. It is annotated as an Extension so Hudson can automatically register this instance as associated with IvyBuildTrigger.

Constructor Detail

IvyBuildTrigger

public IvyBuildTrigger(java.lang.String ivyFile,
                       java.lang.String ivyConfName)
Constructor

Parameters:
ivyFile - the ivy.xml file path within the workspace
ivyConfName - the Ivy configuration name to use
Method Detail

getIvyFile

public java.lang.String getIvyFile()
Returns:
the ivy.xml file path within the workspace

getIvyConfName

public java.lang.String getIvyConfName()
Returns:
the Ivy configuration name used

getIvy

public org.apache.ivy.Ivy getIvy()
Returns:
the Ivy instance based on the ivyConfName
Throws:
java.text.ParseException
java.io.IOException

perform

public boolean perform(hudson.model.AbstractBuild<?,?> build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
                throws java.lang.InterruptedException,
                       java.io.IOException
The BuildStep perform implementation. It performs a conditional recomputation of the project ModuleDescriptor.

Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer
Returns:
always returns true so the build can continue
Throws:
java.lang.InterruptedException
java.io.IOException

needsToRunAfterFinalized

public boolean needsToRunAfterFinalized()
IvyBuildTrigger is only responsible for helping to build dependency graphs based on Ivy settings and configuration. It never alters build status and its execution time should not be included in build time.

Overrides:
needsToRunAfterFinalized in class hudson.tasks.Publisher
Returns:
always returns true meaning that the perform method will not run until the build is marked complete
See Also:
perform(AbstractBuild, Launcher, BuildListener)

getRequiredMonitorService

public hudson.tasks.BuildStepMonitor getRequiredMonitorService()
Specified by:
getRequiredMonitorService in interface hudson.tasks.BuildStep

buildDependencyGraph

public void buildDependencyGraph(hudson.model.AbstractProject owner,
                                 hudson.model.DependencyGraph graph)
Build the dependency graph based on the Ivy ModuleDescriptor for this trigger.

Specified by:
buildDependencyGraph in interface hudson.model.DependecyDeclarer
Parameters:
owner - the project this trigger belongs to
graph - the DependencyGraph to which computed dependencies are added


Copyright © 2010. All Rights Reserved.