ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Lord <>
Subject Re: re-reading build file from within ant
Date Thu, 19 Jun 2003 17:41:07 GMT
>>>>> "Steve" == Steve Cohen <> writes:

  Steve> I have written a build.xml that, as the first step, calls
  Steve> version control (StarTeam in this case but that's not
  Steve> important) and checks out the latest version of build.xml,
  Steve> then calls into it using the <ant> task to do the real work.
  Steve> This works like a charm, and I see no reason why a similar
  Steve> scheme would not work for your regeneration.  Jeff's solution
  Steve> might be a little easier and less error prone depending on
  Steve> the level of regeneration you are doing, but assuming that is
  Steve> all worked out and solid, you could use the same file, as I
  Steve> do in mine.

How does this work if the default target of build.xml is NOT
called. Also does the build not run twice?

Say I have (if you will excuse my ant pseudo code)...

        default-target = compile
        target antmerge
                update build.xml
                if update call antmerge
        target compile depends antmerge
                does compile 
        target jar depends compile
                does jar

So if I modify my source, call "ant antmerge" antmerge runs, and then
calls ant. Then compile gets run, and everything is fine.

But say I call "ant compile", antmerge runs, the ant tasks calls ant
internally, and the compile gets run. But then the ant task
terminates, and the original ant runs compile presumably on the old
build.xml. So we build twice, possibly incorrectly once. 

Or say I call "ant jar". This time the internal ant still runs ant
compile, as this is the default. And then ant jar runs

So this time we do some of the build twice, but ant jar only once, and
by the original build.xml, which is possibly incorrect. 

Are you using yours in a nightly build system or some such? Where you
are always running the same target?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message