Created
February 23, 2011 15:12
-
-
Save sourcerebels/840534 to your computer and use it in GitHub Desktop.
CVStoSVN ant script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project> | |
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpath="svnant.jar" /> | |
<property file="build.properties"/> | |
<target name="clean"> | |
<delete dir="${source}"/> | |
<delete dir="${target}"/> | |
<mkdir dir="${source}"/> | |
<mkdir dir="${target}"/> | |
</target> | |
<target name="validate-tag-param"> | |
<fail unless="tag" message="Property 'tag' is not set. Please specify -Dtag=TAG_NAME."/> | |
</target> | |
<target name="checkout-src" depends="validate-tag-param,clean"> | |
<echo message="Checking out ${source.scm.url}"/> | |
<!-- No funciona amb Windows, descomentar si es vol ver servir a Linux | |
<cvspass cvsroot="${source.scm.url}" password="${source.scm.pass}"/> | |
--> | |
<cvs cvsRoot="${source.scm.url}" package="${source.scm.module}" | |
tag="${tag}" dest="${source}" failonerror="true"/> | |
</target> | |
<target name="checkout-target" depends="clean"> | |
<echo message="Checking out ${target.scm.url}"/> | |
<svn username="${target.scm.user}" password="${target.scm.pass}" failonerror="true"> | |
<checkout url="${target.scm.url}" revision="HEAD" destPath="${target}" /> | |
</svn> | |
</target> | |
<target name="sync-files" depends="checkout-src, checkout-target"> | |
<echo message="Sync copy from '${source}' to '${target}'"/> | |
<copy todir="${target}"> | |
<fileset dir="${source}"> | |
<exclude name="CVS"/> | |
</fileset> | |
</copy> | |
</target> | |
<target name="commit-target" depends="sync-files"> | |
<echo message="TARGET ${target}"/> | |
<property name="commitMessage" value="Entrega ${tag}"/> | |
<svn username="${target.scm.user}" password="${target.scm.pass}" failonerror="true"> | |
<add recurse="true"> | |
<fileset dir="${target}"> | |
<exclude name=".svn"/> | |
</fileset> | |
</add> | |
<commit dir="${target}" recurse="true" message=""/> | |
<copy srcUrl="${target.scm.url}" destUrl="${target.scm.tag.url}/${tag}" | |
revision="HEAD" message="${commitMessage}"/> | |
</svn> | |
</target> | |
<target name="sync" depends="commit-target"/> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
build.properties
A continuació es descriu cadascun de les propietats que fa servir el script i que s'han d'escriure al fitxer build.properties.
Requereix ANT i les tasques pròpies de SVN per ANT (svnant).