You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Vijay Raghavan <vi...@netscape.com> on 2000/07/25 23:39:18 UTC

*** Java Makefile ***

Any suggestions on how this can be implemented using ANT?
Vijay

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

RE: *** Java Makefile ***

Posted by Tim Fennell <tf...@rcn.com>.
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 <vi...@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


Re: *** Java Makefile ***

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "VR" == Vijay Raghavan <vi...@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