https://issues.apache.org/bugzilla/show_bug.cgi?id=30569





--- Comment #15 from Jesse Glick <[EMAIL PROTECTED]>  2008-07-16 08:47:40 PST 
---
I hope I'm not the only one who finds Ant's treatment of basedir very
confusing!

When you run a script using 'ant <target>' or 'ant -f <script> <target>', the
basedir attribute on <project> is always considered (defaulting to "."), and is
resolved relative to the directory containing the script. Thus, a given script
always behaves the same way, regardless of who called it from where, modulo
explicitly passed parameters. (As a special case, basedir is just ignored in
<import>ed scripts.) This is how I want it to work in every single case I have
ever encountered when using Ant: if I have a need for a generic script to
perform some operations on a particular directory to be specified externally, I
will pass in the path to that directory using -D or <property> as an explicit,
descriptive property name. This is clearer, and anyway more flexible since I
may want to pass several directories at once.

Unfortunately, <ant> and <subant> do not use basedir consistently; they
sometimes set the basedir to some other value, according to a complicated logic
matrix. For compatibility reasons the existing behavior of these tasks cannot
be changed. What I really want is a single attribute for both tasks - say,
naturalbasedir="true" - which invokes the scripts as they would be by the Ant
launcher, regardless of the basedir of the current project, regardless of
whether or not you are using the dir="..." attribute to select the script,
regardless of what inherit* options you are using, etc.

Such an attribute would be useful for solving thorny issues like

http://www.netbeans.org/issues/show_bug.cgi?id=136694

where Ant persists in using a weird basedir value and there is no easy way to
tell it to stop.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Reply via email to