ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Fennell" <tfe...@rcn.com>
Subject RE: *** Java Makefile ***
Date Wed, 26 Jul 2000 11:33:59 GMT
On the subject of package level makes...it 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}"
            destdir="${destDir}"
             optimize="on"
              deprecation="on"
               debug="on">
       <include name="${sources}"/>
    </javac>

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).
Also:
	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.

-t

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@bost.de]
Sent: Wednesday, July 26, 2000 07:08
To: ant-dev@jakarta.apache.org
Subject: Re: *** Java Makefile ***


>>>>> "VR" == Vijay Raghavan <vijay@netscape.com> writes:

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

 VR> http://www.geosoft.no/javamake.html

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:http://www.geosoft.no/javamake.html#Running 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.

Stefan


Mime
View raw message