fast ant

R

Roedy Green

I would have thought there would be a way to get the JVM to load ant,
then process a great slew of build.xml scripts. Yet I don't see how
you do that.

What is the trick?


--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
T

Thomas Fritsch

Roedy said:
I would have thought there would be a way to get the JVM to load ant,
then process a great slew of build.xml scripts. Yet I don't see how
you do that.

What is the trick?

I would write a meta build.xml script like the one below, which
processes the build.xml scripts of several directories:

<project name="AllProjects">
<ant dir="project1">
</ant>
<ant dir="project2">
</ant>
<ant dir="project3">
</ant>
</project>

It's just a guess, I didn't actually work out the details.

May be the docu of the "ant" task gives some more ideas:
<http://ant.apache.org/manual/>
-> Ant Tasks -> Core Tasks -> Ant
 
R

Roedy Green

I would write a meta build.xml script like the one below, which
processes the build.xml scripts of several directories:

<project name="AllProjects">
<ant dir="project1">

Here is what I have done so far. It is incredibly fast. It compiles
and jars about 30 projects in 6 seconds. The only catch is, I have not
figured out how to pass a target in. You would think the target to
the everything build would be inherited, but it is not. I have been
studying other people's scripts that use <ant and <antcall. They seem
to have to pass an explicit target to used sub build. They use this
for example to do all the cleaning, then all the compiling, then all
the jarring.

<?xml version="1.0"?>
<!-- compile and jar the universe using ant, starting with JDK 1.1
stuff and working to JDK 1.5 -->
<project name="everything" basedir="C:\">

<!-- j11 -->

<ant antfile="com/mindprod/common11/build.xml"></ant>
<ant antfile="com/mindprod/csv/build.xml"></ant>
<ant antfile="com/mindprod/go/build.xml"></ant>
<ant antfile="com/mindprod/hunkio/build.xml"></ant>
<ant antfile="com/mindprod/isbn/build.xml"></ant>
<ant antfile="com/mindprod/ledatastream/build.xml"></ant>

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
T

Thomas Fritsch

Roedy said:
... The only catch is, I have not
figured out how to pass a target in. You would think the target to
the everything build would be inherited, but it is not. I have been
studying other people's scripts that use <ant and <antcall. They seem
to have to pass an explicit target to used sub build. They use this
for example to do all the cleaning, then all the compiling, then all
the jarring.
You are talking about
<ant ... target="clean"/>
<ant ... target="compile"/>
...
don't you?

I would prefer defining a default target in each of the subordinate
build.xml files, which is defined to call all its sister targets in
order. For example:

<project default="all" ...>
<target name="all" depends="clean,compile,jar"/>
<target name="clean">
...
</target>
<target name="compile">
...
</target>
<target name="jar">
...
</target>
</project>

Then you can use your universe build.xml as is, without giving an
explicit target on each ant call. Alternatively you could add
target="all"
 
R

Roedy Green

What is the trick?

<subant is the trick to run all the build files in the universe

<ant lets you pick out particular sub scripts to run.


<?xml version="1.0"?>
<!-- compile and jar the universe using ant, does all cleans before
all compiles -->
<project name="everything" default="jar" basedir="C:\">

<target name="clean">
<subant target="clean"> <!-- must duplicate or get default target-->
<fileset dir="com/mindprod" includes="*/build.xml"/>
</subant>
</target>

<target name="compile">
<subant target="compile">
<fileset dir="com/mindprod" includes="*/build.xml"/>
</subant>
</target>

<target name="jar" depends="compile">
<subant target="jar" >
<fileset dir="com/mindprod" includes="*/build.xml"/>
</subant>
</target>

</project>


It does all the cleans, then all the compiles then all the jars.

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top