1 /******************************************************************************** 2 * CruiseControl, a Continuous Integration Toolkit 3 * Copyright (c) 2001, ThoughtWorks, Inc. 4 * 651 W Washington Ave. Suite 600 5 * Chicago, IL 60661 USA 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * 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 ********************************************************************************/ 37 38 package net.sourceforge.cruisecontrol; 39 40 import java.util.Date; 41 import java.util.List; 42 import java.util.Map; 43 44 /** 45 * This interface defines behavior required by ModificationSet.java when 46 * gathering information about the changes made to whatever source control tool 47 * that you choose. 48 * 49 * SourceControl implementations may define 2 special properties: 50 * <ul> 51 * <li> <code>void setProperty(String property)</code>: 52 * name of property to define if a modification is detected. 53 * The property should be added to the set of properties returned by the {@link #getProperties()} call. 54 * Allows the underlying build script to do conditional actions if the files watched by this 55 * SourceControl have been modified. 56 * </li> 57 * <li><code>void setPropertyOnDelete(String property)</code>: 58 * name of property to define if a deletion is detected. 59 * The property should be added to the set of properties returned by the {@link #getProperties()} call. 60 * </li> 61 * </ul> 62 * 63 * @author <a HREF="mailto:alden@thoughtworks.com">Alden Almagro</a> 64 * @author <a HREF="mailto:jcyip@thoughtworks.com">Jason Yip</a> 65 * @version $Id: SourceControl.java,v 1.11 2006/03/19 12:02:12 jchyip Exp $ 66 */ 67 public interface SourceControl { 68 69 /** 70 * Get a List of Modifications detailing all the changes between now and 71 * the last build 72 * 73 *@param lastBuild 74 *@param now 75 *@return List of Modification objects 76 */ 77 public List getModifications(Date lastBuild, Date now); 78 79 80 public void validate() throws CruiseControlException; 81 82 /** 83 * Any properties that have been set in this sourcecontrol. 84 * Will be passed onto the Builder, which may then pass the properties to the underlying 85 * build implementation. For example, the Ant builder will define these properties so that 86 * the underlying Ant script can use them. 87 */ 88 public Map getProperties(); 89 } 90