• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Revision Number using Ant 1.7

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to display the SVN revision number using Ant build system. I have tried to use svntask. However, it gives me the revision of the current directory. I would like to default it to the base directory, I've attached the code snippet:::::

target name="version">
<typedef resource="com/googlecode/svntask/svntask.xml">
<classpath>
<fileset dir="${srcdir}/CAMViewerEar/lib">
<include name="svnkit.jar"/>
<include name="svntask.jar"/>
</fileset>
</classpath>
</typedef>

<svn><info path="." revisionProperty="revisionVersion" /></svn>
<property name="revision" value="${revisionVersion}" />
<echo message="revision number is : ${revision}" />
</target>


Any help is appreciated, TIA
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I took a good look at the docs and I'm afraid I can't see a direct solution. Maybe you could switch to the BASE get the revision number and switch back? Expensive operation I know...
 
Piyush Mattoo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to be able to run our ANT script on both Windows as well as Unix. What would be the best way to navigate back to the base directory as well as return to the current directory that would work in both the platforms.
Any help is appreciated, TIA!
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Piyush Mattoo:
I want to be able to run our ANT script on both Windows as well as Unix. What would be the best way to navigate back to the base directory as well as return to the current directory that would work in both the platforms.
Any help is appreciated, TIA!



Hello Piyush,

You can make use of relative path names for your directory names.

For instance, your directory structure is like this:-



In init.properties, define two properties like this:-

Now, in your build file,

Modify the svn task you have written as:-


Now, you will be able to use same Ant Script for both linux as well as windows...
[ November 23, 2008: Message edited by: Manish Doomra ]
 
Piyush Mattoo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all your help.I found a nice little tool called svntask http://code.google.com/p/svntask/ .All we have to do is to specify the directory from where we want to pick up the revision numer and it works perfect.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic