1 package hudson.tasks; 2 3 import hudson.Launcher; 4 import hudson.model.Action; 5 import hudson.model.Build; 6 import hudson.model.BuildListener; 7 import hudson.model.Descriptor; 8 import hudson.model.Project; 9 import hudson.tasks.junit.JUnitResultArchiver; 10 11 import java.io.IOException ; 12 import java.util.ArrayList ; 13 import java.util.Collection ; 14 import java.util.List ; 15 16 35 public interface BuildStep { 36 37 44 boolean prebuild( Build build, BuildListener listener ); 45 46 70 boolean perform(Build build, Launcher launcher, BuildListener listener) throws InterruptedException , IOException ; 71 72 87 Action getProjectAction(Project project); 88 89 94 public static final List <Descriptor<Builder>> BUILDERS = Descriptor.toList( 95 Shell.DESCRIPTOR, 96 BatchFile.DESCRIPTOR, 97 Ant.DESCRIPTOR, 98 Maven.DESCRIPTOR 99 ); 100 101 111 public static final PublisherList PUBLISHERS = new PublisherList(Descriptor.toList( 112 ArtifactArchiver.DESCRIPTOR, 113 Fingerprinter.DESCRIPTOR, 114 JavadocArchiver.DESCRIPTOR, 115 JUnitResultArchiver.DescriptorImpl.DESCRIPTOR, 116 BuildTrigger.DESCRIPTOR, 117 Mailer.DESCRIPTOR 118 )); 119 120 123 public static final class PublisherList extends ArrayList <Descriptor<Publisher>> { 124 public PublisherList(Collection <? extends Descriptor<Publisher>> c) { 125 super(c); 126 } 127 128 138 public void addNotifier( Descriptor<Publisher> d ) { 139 add(d); 140 } 141 142 151 public void addRecorder( Descriptor<Publisher> d ) { 152 int idx = super.indexOf(Mailer.DESCRIPTOR); 153 add(idx,d); 154 } 155 } 156 } 157 | Popular Tags |