01: /********************************************************************************
02: * CruiseControl, a Continuous Integration Toolkit
03: * Copyright (c) 2001, ThoughtWorks, Inc.
04: * 200 E. Randolph, 25th Floor
05: * Chicago, IL 60601 USA
06: * All rights reserved.
07: *
08: * Redistribution and use in source and binary forms, with or without
09: * modification, are permitted provided that the following conditions
10: * are met:
11: *
12: * + Redistributions of source code must retain the above copyright
13: * notice, this list of conditions and the following disclaimer.
14: *
15: * + Redistributions in binary form must reproduce the above
16: * copyright notice, this list of conditions and the following
17: * disclaimer in the documentation and/or other materials provided
18: * with the distribution.
19: *
20: * + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
21: * names of its contributors may be used to endorse or promote
22: * products derived from this software without specific prior
23: * written permission.
24: *
25: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
29: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36: ********************************************************************************/package net.sourceforge.cruisecontrol;
37:
38: import java.io.Serializable;
39: import java.util.Date;
40: import java.util.List;
41: import java.util.Map;
42:
43: /**
44: * This interface defines behavior required by ModificationSet.java when
45: * gathering information about the changes made to whatever source control tool
46: * that you choose.
47: *
48: * SourceControl implementations commonly define 2 special properties:
49: * <ul>
50: * <li> <code>void setProperty(String property)</code>:
51: * name of property to define if a modification is detected.
52: * The property should be added to the set of properties returned by the {@link #getProperties()} call.
53: * Allows the underlying build script to do conditional actions if the files watched by this
54: * SourceControl have been modified.
55: * </li>
56: * <li><code>void setPropertyOnDelete(String property)</code>:
57: * name of property to define if a deletion is detected.
58: * The property should be added to the set of properties returned by the {@link #getProperties()} call.
59: * </li>
60: * </ul>
61: *
62: * @author <a href="mailto:alden@thoughtworks.com">Alden Almagro</a>
63: * @author <a href="mailto:jcyip@thoughtworks.com">Jason Yip</a>
64: * @version $Id: SourceControl.java 2864 2007-02-18 05:38:22Z jchyip $
65: */
66: public interface SourceControl extends Serializable {
67:
68: /**
69: * Get a List of Modifications detailing all the changes between now and
70: * the last build
71: *
72: *@param lastBuild
73: *@param now
74: *@return List of Modification objects
75: */
76: public List getModifications(Date lastBuild, Date now);
77:
78: public void validate() throws CruiseControlException;
79:
80: /**
81: * Any properties that have been set in this sourcecontrol.
82: * Will be passed onto the Builder, which may then pass the properties to the underlying
83: * build implementation. For example, the Ant builder will define these properties so that
84: * the underlying Ant script can use them.
85: */
86: public Map getProperties();
87: }
|