ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java
Date Wed, 03 Apr 2002 06:44:30 GMT
On Tue, 2 Apr 2002, Diane Holt <holtdl@yahoo.com> wrote:

> Hmm... I tested the snot out of it, so I'm surprised to hear that.

To be honest, I didn't actually test it, just ran the code in my head.
If dir is null, you'll get a NullPointerException - I didn't see that
it is extremely unlikely that dir is null, but it is possible.

See the code in execute that immediately preceedes the call to
initializeProject, it will leave dir as null if inheritAll is false
and dir hasn't been specified (to not override the basedir of the new
project).

> I ran it (with my changes) without specifying a dir, and it worked
> fine.

set inheritall to false - I think I'll simply add a JUnit testcase
that demonstrates the failure and fix it after that.

Run this:

<project name="foo" default="bar">
  <target name="foo">
    <echo message="baz"/>
  </target>

  <target name="bar">
    <ant inheritall="false" output="zyzzy.log" target="foo"
         antfile="foo.xml"/>
  </target>
</project>

>> As I'm not sure what you want to do in the presence of a dir
>> attribute, therefore I'm not patching the task right now.
> 
> The previous behaviour was that the output file would be created in
> the current directory rather than in the directory of the build file
> being called (if different from the current directory).

Yes.

But the question remains, where do we want to put the logfile if the
user has specified a dir attribute.  Into dir or still use the current
projects basedir?  We are talking about a backwards incompatible
change anyway, but one that can be called a bugfix for very good
reasons 8-).

Stefan

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message