Not sure of why you would need to create a branch for each build. If you are
just trying to keep artifacts, you may want to just put each build into its own
directory. I do that by:
<tstamp>
<format pattern="yyyyMMddHHmm" property="build_time"/>
</tstamp>
<propertyregex property="cjh_tmp" input="${basedir}" regexp="C:\\[A-Za-z0-9
_-]*\\(.*)" select="\1"/>
<property name="release_dir" value="C:/Builds/${cjh_tmp}/${build_time}"/>
The build results go into ${release_dir}. Some of the artifacts I produce
during the build are the detailed list of changes and the version number of the
repository that exists at the time of the build. The code to get the detailed
list is as follows:
<target name="__assemble_chg_log">
<!--
#######################################################################################################################################
TARGET: __assemble_chg_log
Purpose: The property "release_start_rev" contains the subversion version
number for when the last branch was made from a specific
branch. The property "targetRevision" contains the subversion version
number for the release being built. The subversion comments
for all versions from the start to target inclusive are then retrieved and
placed into a file. This file is then added uploaded
to the task that is sent to QA so they can see all of the changes that have
been made. These changes include all that are
specific to the branch being built and the changes merged from other
branches.
See:
#######################################################################################################################################
-->
<!--
##################################################
This target pulls the subversion logs from where the last branch was created to
the current version.
##################################################
-->
<if>
<isset property="release_start_rev"/>
<then>
<echo level="info">Issuing: ${svn} log --verbose --revision
${release_start_rev}:${targetRevision} ${baseTargetURL}</echo>
<echo level="info">Output will be in: ${release_dir}/svn_log_info.txt</echo>
<exec executable="${svn}" output="${release_dir}/svn_log_info.txt">
<arg value="--username"/>
<arg value="${svnuser}"/>
<arg value="--password"/>
<arg value="${svnpass}"/>
<arg value="log"/>
<arg value="--verbose"/>
<arg value="--revision"/>
<arg value="${release_start_rev}:${targetRevision}"/>
<arg value="${baseTargetURL}"/>
</exec>
</then>
</if>
</target>
I just use an exec for the svn command. You should be able to use the fragments
above, along with the subversion manual, to come up with a target to create
tags if you need to. The problem you can have is that subversion could change
between the beginning of your build and the end of the build if you wait to
until you determine if the build is successful to add the branch. If you add
the branch at the beginning of the build, you could create a branch for an
unsuccessful build.
jpyork <[EMAIL PROTECTED]> wrote:
Is it possible to create a task that creates a tag every time you do a build?
--
View this message in context:
http://www.nabble.com/Ant-and-Subversion-tp15162188p15162188.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.