ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: local build file with ant
Date Sat, 22 Mar 2003 17:46:44 GMT

----- Original Message -----
From: "Ray Tayek" <>
To: <>
Sent: Saturday, March 22, 2003 00:10
Subject: local build file with ant

> hi, i''ve been trying to come up with a build file that lives in the
> package that it builds (imho, this seems like the appropriate place for it
> to hang out - but this is contrary to most of the examples i have seen).

That's where you differ from everyone else. The reason to keep the build
file at the base of a project is that you should only need one per project,
and you end up with >1 package in any complex project. Many ant projects get
away with a single build file. it keeps maintenance costs down and execution
speed up.

> so i came up with the following build script (see below). this seems to
> sorta do what i want (and it works in netbeans except for getting the
> environment variables).

You could try setting the basedir attribute of <project> as "../../.." and
have everything resolved relative to there.

> it seems like you would want to have one of these in most packages that
> were deliverable (say as a jar) or required some extra (non-unit) testing.
> has anyone else fooled around with this idea?
> i am wondering how to build on something like this when the build script
> at a higher level and wants to build all of the stuff below it. perhaps
> there is some ant mechanism that goes around and builds everything below
> it?. i would not object to having a build file in *every* package as that
> will keep the information on how to build close to what it is building/

That is the makefile approach; I guess you used make a lot, eh?
You can do it in ant with <ant>, but you dont need to . Javac happily
compiles a directory tree, <jar> happily jars it. What more do you need.

View raw message