cruisecontrol与svn集成之config.xml与build.xml

config.xml

<cruisecontrol>
    <project name="demo">
		<!--据说是老版才需要
		<plugin name="svn" classname="net.sourceforge.cruisecontrol.sourcecontrols.SVN"/>
		<plugin name="svnbootstrapper" classname="net.sourceforge.cruisecontrol.bootstrappers.SVNBootstrapper"/>
		-->
        <listeners>
            <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
        </listeners>

        <!--bootstrappers>
            <cvsbootstrapper localWorkingCopy="projects/${project.name}" />
        </bootstrappers-->
        
        <bootstrappers>  
            <svnbootstrapper localWorkingCopy="projects/${project.name}" />  
        </bootstrappers>  
        <!--quietperiod会使用svn log命令检查,出错,未解决,暂时注释-->
        <!--modificationset quietperiod="30">
            <svn LocalWorkingCopy="projects/${project.name}"/-->
            <!--cvs localWorkingCopy="projects/${project.name}"/-->
            <!--filesystem folder="projects/${project.name}"/-->
        <!--/modificationset-->
        
        <schedule interval="600">
            <ant anthome="apache-ant-1.6.5" buildfile="build.xml" target="pull"/>
        </schedule>
        
        <log>
            <merge dir="projects/${project.name}/build/test/data"/>
        </log>
        
        <publishers>
            <onsuccess>
                <artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/dist/webapps/${project.name}.war"/>
            </onsuccess>
               
            <htmlemail mailhost="localhost" 
                returnaddress="[email protected]" 
                buildresultsurl="http://home.raibledesigns.com:8888/buildresults/${project.name}" 
                css="webapps/cruisecontrol/css/cruisecontrol.css"
                xsldir="webapps/cruisecontrol/xsl"
                logdir="logs/${project.name}" 
                subjectprefix="[CruiseControl] ">
                
                <map alias="mraible" address="[email protected]"/>
                <failure address="mraible" reportWhenFixed="true"/>
            </htmlemail>
        </publishers>
    </project>
</cruisecontrol>



config.xml
<project name="demo" default="pull" basedir=".">

    <!-- Uncomment if you're using Subversion - you'll need to download svnant into the same directory -->
	<path id= "svnant.classpath" >
     <fileset dir= "D:/cruisecontrol-bin-2.6.1/svnant-1.1.0-RC2/lib" >
         <include name= "*.jar" />
     </fileset>
	</path>
    
	<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" /> 

    <target name="svn">
        <delete dir="projects/${ant.project.name}"/>
        <svn>
            <checkout url="http://daiah:[email protected]/project/omm/trunk/src/demo" 
                  revision="HEAD" destPath="projects/${ant.project.name}" />
        </svn>
    </target>
    
    <target name="pull">
		<delete dir="projects/${ant.project.name}"/>
		<svn username="xx" password="xx">
			<checkout url="http://192.168.100.1/project/test/trunk" revision="HEAD" destPath="projects/demo" />
		</svn>
	</target>

    <!--target name="cvs">
        <delete dir="projects/${ant.project.name}"/>
        <cvs command="co ${ant.project.name}" dest="projects"
            cvsRoot=":pserver:[email protected]:/cvs"/> 
    </target-->
    
    <target name="test" depends="svn">
        <!-- Test on a port that's not being used --> 
        <property name="http.port" value="8180"/>
        <ant dir="projects/${ant.project.name}" target="setup"/>
        <ant dir="projects/${ant.project.name}" target="test-all"/>
    </target>

    <!--target name="clean">
        <delete dir="projects/${ant.project.name}"/>
    </target-->
</project>

你可能感兴趣的:(xml,SVN,subversion,cvs)