4

I'm maintaining a build system that uses svnant from a one directory to update a large number of projects in another directory. It then moves to one of those projects that's been updated, and does the actual build.

Is it safe to do everything from that main project? Can the main project use svnant to update itself, or could there be a problem if svn needs to update the build.xml file that ant is currently using?

Giles
  • 63
  • 3

2 Answers2

1

For the self-updated main project build.xml - you might have a problem with running the subversion update and build in one go. The nature of the problem depends on exactly what change is made to the build.xml. Simply rerunning the build would probably fix it, as the build.xml Ant then loads at start up would be up-to-date.

If you really have to reliably update build.xml and carry out a build in one go, you might consider wrapping the post-svnant part of the build in an antcall task. When Ant runs the antcall'ed target, it re-reads the build.xml, so any change to that file since Ant was invoked is taken in to account. Antcall starts processing from scratch, so if you have (possibly expensive) initialisations these would need to be run again.

martin clayton
  • 76,436
  • 32
  • 213
  • 198
0

If that doesn't take too much disk space (of if disk space is not an issue), you could have two working directories:

  • one where you 'svnant' anything you want
  • one where you launch the builds, except any launch would be preceded by a rsynch in order to import any modifications from the first working directory to the second one.

In other word, you would pull the modifications before launching any build.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250