ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Cohen" <SCo...@sportvision.com>
Subject RE: re-reading build file from within ant
Date Thu, 19 Jun 2003 19:49:34 GMT
stripped of the extraneous stuff, here it is:

    <target name="checkout.build.xml"  description=" --> Checkout
project build.xml from StarTeam">
        <antcall target="checkout">
            <param name="starteam.rootlocalfolder"
value="${starteam.rootlocalfolder}"/>
            <param name="starteam.projectname" value =
"${starteam.projectname}" />
            <param name="starteam.viewname" value = "${project.version}"
/>
            <param name="starteam.rootstarteamfolder" value =
"${starteam.rootstarteamfolder}" />
            <param name="starteam.includes" value="build.xml"/>
            <param name="starteam.recursive" value="false"/>
            <param name="checkout" value="yes"/>
        </antcall>
    </target>

...

    <target name="autobuild">
	...
    </target>

    <target name="auto" depends="checkout.build.xml">
        <echo message="ant.file=${ant.file}"/>
        <ant antfile="${ant.file}" target="autobuild"
inheritrefs="false" inheritall="false"/>
    </target>

Neither of these targets, auto or autobuild, is the default target,
although, conceivably, either could be.  

Are you perhaps missing the "target" attribute of the ant task?

-----Original Message-----
From: Phillip Lord [mailto:p.lord@russet.org.uk] 
Sent: Thursday, June 19, 2003 12:41 PM
To: Ant Users List
Subject: Re: re-reading build file from within ant


>>>>> "Steve" == Steve Cohen <SCohen@sportvision.com> 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)...


build.xml
        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?

Cheers

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message