ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Fennell" <>
Subject RE: *** Java Makefile ***
Date Wed, 26 Jul 2000 11:33:59 GMT
On the subject of package level can be kinda nice.  It is actually
pretty easy to get working with Ant. I use the following:

  <property name="package" value="*"/>
  <property name="sources"  value="**/${package}/*.java"/>

  <target name="compile" depends="init">
    <javac srcdir="${sourceDir}"
       <include name="${sources}"/>

By default this will compile everything, but it can be overridden. Both:
	ant -Dpackage=org/apache/tools/ant/taskdefs/** compile
and	ant -Dpackage=taskdefs/** compile	(Escaping stars where applicable)
will compile the taskdefs directory and down (though the first one is safer).
	ant -Dpackage=taskdefs compile
will compile just the taskdefs package, and no subpackages.

It works nicely when you want to avoid compiling some other packages for some
reason (i.e. someone has checked in broken code =o )  Still doesn't add the
ability to do explicit inter-package dependencies though.


-----Original Message-----
From: Stefan Bodewig []
Sent: Wednesday, July 26, 2000 07:08
Subject: Re: *** Java Makefile ***

>>>>> "VR" == Vijay Raghavan <> writes:

 VR> Any suggestions on how this can be implemented using ANT?


Vijay, I'm not sure I understand your question the way I should.

First, Ant won't force a fixed directory structure for the project on
you - though this might be useful within one organization.

I've not looked at the particular setup of this but it seems to me
that starting out with a very simple build file - take Ant's own for
example you will have all project level make targets from
<URL: Make> immediately -
you would have to add a target containing <java> tasks for the
run... targets but that should be trivial.

I don't see the value of the package level make targets but you could
get there quite easy as well. "make SomeFile.class" might become
"ant -Dbuild.class=SomeFile compilesingle" though.


View raw message