File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\scm\NullSCM.java.html

1 /*
2 * The MIT License
3 *
4 * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24 package hudson.scm;
25
26 import hudson.FilePath;
27 import hudson.Launcher;
28 import hudson.Extension;
29 import hudson.model.AbstractBuild;
30 import hudson.model.AbstractProject;
31 import hudson.model.BuildListener;
32 import hudson.model.TaskListener;
33 import net.sf.json.JSONObject;
34 import org.kohsuke.stapler.StaplerRequest;
35
36 import java.io.File;
37 import java.io.IOException;
38
39 /**
40 * No {@link SCM}.
41 *
42 * @author Kohsuke Kawaguchi
43 */
44 public class NullSCM extends SCM {
45 public SCMRevisionState calcRevisionsFromBuild(AbstractBuild<?, ?> build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
46 return null;
47 }
48
49 protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException {
50 return PollingResult.NO_CHANGES;
51 }
52
53 public boolean checkout(AbstractBuild<?,?> build, Launcher launcher, FilePath remoteDir, BuildListener listener, File changeLogFile) throws IOException, InterruptedException {
54 return createEmptyChangeLog(changeLogFile, listener, "log");
55 }
56
57 public ChangeLogParser createChangeLogParser() {
58 return NullChangeLogParser.INSTANCE;
59 }
60
61 @Extension
62 public static class DescriptorImpl extends SCMDescriptor<NullSCM> {
63 public DescriptorImpl() {
64 super(null);
65 }
66
67 public String getDisplayName() {
68 return Messages.NullSCM_DisplayName();
69 }
70
71 @Override
72 public SCM newInstance(StaplerRequest req, JSONObject formData) throws FormException {
73 return new NullSCM();
74 }
75 }
76 }
77