[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: RE: svn-ant how to get latest revision?

From: John Niven <jniven_at_bravurasolutions.com>
Date: Thu, 11 Sep 2008 17:48:47 +1200

> -----Original Message-----
> From: John Niven [mailto:jniven_at_bravurasolutions.com]
> Sent: Thursday, 11 September 2008 17:38
> To: users_at_subversion.tigris.org
> Subject: RE: svn-ant how to get latest revision?
>
> > -----Original Message-----
> > From: Fu-Tung Cheng [mailto:futung.cheng_at_yahoo.com]
> > Sent: Wednesday, 10 September 2008 18:55
> > To: users_at_subversion.tigris.org; user_at_ant.apache.org
> > Subject: svn-ant how to get latest revision?
> >
> > Hi,
> >
> > I am trying to figure out which command I can use from svn-ant that
> > will get me the highest revision from the repository.
> >
> > I've tried svn-info but both the rev and lastRev properties
> return the
> > working copies revision number.
> >
> > I've also tried the wcVersion task but again that just
> tells you the
> > working copies last revision.
> >
> > In order for me to get the information it appears I need to
> update my
> > working copy to the latest and then call one of these targets.
> > Shouldn't there be a way using svn-ant to just get the
> latest version?

I've just read your follow up message on user_at_ant.apache.org; you want
the rev number so that you can recreate the build at some future point.
This is a common use case for any SCM system. Typically you would label
- or tag - the source tree - and that's exactly what I'd propose in SVN.
Create a tag, and then run your build off the tag. Typically the tag
and the final artefact would have related names.

For example, assuming a Java JAR is the expected artefact, your Ant
build script would:
(a) SVN copy the contents of /trunk to /tags/build_2008-09-11_1745
(say);
(b) Use the Java source in /tags/build_2008-09-11_1745 to compile class
files and assemble a JAR;
(c) rename the JAR to product_2008-09-11_1745 and copy it to a
distribution directory.

If you needed to recreate that build's JAR at some future point you'd
simply re-run the Ant build script, but configure it to skip step (a).

Cheers
John

> >
> > Does no one automate tasks using ant and svn? The svn-ant
> tasks seem
> > somewhat less mature than I would have expected.
>
> Your question isn't really on-topic for
> users_at_subversion.tigris.org (or
> user_at_ant.apache.org) - you would probably get a better
> response from users_at_subclipse.tigris.org (SvnAnt being part
> of the Subclipse project, not SVN itself and certainly not Ant).
>
> I understand that SvnAnt has been without an active
> maintainer for some time, but that that has now changed:
> http://svn.haxx.se/subdev/archive-2008-08/0022.shtml -
> version 1.2.0-RC1, targetting SVN 1.5, was released very
> recently. I noticed a few wrinkles in it ("svn copy
> --parents" isn't fully implemented, for example), but
> otherwise it's an improvement on 1.1.0.RC2.
>
> You might also want to take a look at SvnKit - it's a pure
> Java implementation of SVN and it looks (I've not tried it)
> trivial to use from Ant using the "java" task. To my mind
> SvnKit seems easier to use for someone who's familiar with
> SVN, and arguably more powerful. That said, I've always
> found SvnAnt does whatever I need it to, with very little
> hacking required.
>
> Cheers
> John
>
> >
> > If I was using maven to do my building would I find better support?
> >
> >
> > Thank you,
> >
> > Fu-Tung
> >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
> > For additional commands, e-mail: users-help_at_subversion.tigris.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: users-help_at_subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-11 07:49:18 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.