1 package hudson.scm; 2 3 import hudson.FilePath; 4 import hudson.Launcher; 5 import hudson.model.AbstractBuild; 6 import hudson.model.AbstractProject; 7 import hudson.model.BuildListener; 8 import hudson.model.Descriptor; 9 import hudson.model.TaskListener; 10 import org.kohsuke.stapler.StaplerRequest; 11 12 import java.io.File ; 13 import java.io.IOException ; 14 import java.util.Map ; 15 16 21 public class NullSCM extends SCM { 22 public boolean pollChanges(AbstractProject project, Launcher launcher, FilePath dir, TaskListener listener) throws IOException { 23 return false; 25 } 26 27 public boolean checkout(AbstractBuild build, Launcher launcher, FilePath remoteDir, BuildListener listener, File changeLogFile) throws IOException { 28 return createEmptyChangeLog(changeLogFile, listener, "log"); 29 } 30 31 public boolean checkout(Launcher launcher, FilePath workspace, TaskListener listener) throws IOException , InterruptedException { 32 return true; 33 } 34 35 public Descriptor<SCM> getDescriptor() { 36 return DESCRIPTOR; 37 } 38 39 public void buildEnvVars(Map <String ,String > env) { 40 } 42 43 public FilePath getModuleRoot(FilePath workspace) { 44 return workspace; 45 } 46 47 public ChangeLogParser createChangeLogParser() { 48 return new NullChangeLogParser(); 49 } 50 51 static final Descriptor<SCM> DESCRIPTOR = new Descriptor<SCM>(NullSCM.class) { 52 public String getDisplayName() { 53 return "None"; 54 } 55 56 public SCM newInstance(StaplerRequest req) { 57 return new NullSCM(); 58 } 59 }; 60 } 61 | Popular Tags |