We can also do it that way using javasvn:
<!-- ========================================== -->
<!-- Load version provided by buidserver.
-->
<!-- ========================================== -->
<target name="load.version.file">
<property name="repository.URL" value="${basedir}" />
<java classname="org.tmatesoft.svn.cli.SVN" dir="${basedir}"
fork="true" failonerror="true" output="svninfo.xml" logError="true">
<arg value="info" />
<arg value="${repository.URL}" />
<arg value="--xml" />
<classpath>
<pathelement location="${project.lib.dir}/ganymed.jar" />
<pathelement location="${project.lib.dir}/javasvn.jar" />
<pathelement location="${project.lib.dir}/javasvn-cli.jar" />
</classpath>
</java>
<xmlproperty file="svninfo.xml" prefix="svn" />
<delete file="svninfo.xml" quiet="true" />
<property name="build.version" value="2.0.0.${svn.info.entry
(revision)}" />
<echo>version: ${build.version}</echo>
<!-- <loadfile property="build.version"
srcFile="buildserver.version" /> -->
</target>
This uses the latest version of javasvn i.e. head as I had to get a
bug fixed for it to work, and we need to add the three jars in the
lib. I have included the right version.
As it is a pure Java implementation it should work on all platforms.
Pierre

On 22-May-06, at 10:42 AM, Mike Schrag wrote:
> echo -n does it
>
> On May 22, 2006, at 1:39 PM, Anjo Krank wrote:
>
>>
>> Am 22.05.2006 um 19:07 schrieb Mike Schrag:
>>
>>> I like this idea ...
>>>
>>> On May 22, 2006, at 10:19 AM, Anjo Krank wrote:
>>>
>>>> Wouldn't is be easier to just take the svn repository version
>>>> that was active when the build started?
>>>>
>>>> echo 2.0.0.`svn info|grep Revision|cut -d ' ' -f 2`
>>>> >buildserver.version
>>>>
>>>> -->2.0.0.2709
>>
>> Except that it puts a ^J at the end of the version and ant appends
>> it to the build number... is there a "chop" for the shell or some
>> one-liner in perl?
>>
>> Cheers, Anjo
>
>
This archive was generated by hypermail 2.0.0 : Mon Jul 03 2006 - 16:14:36 EDT