Bug 60185 - "record" task doesn't work correctly when invoked from another build
Summary: "record" task doesn't work correctly when invoked from another build
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.9.7
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2016-09-28 20:31 UTC by Tom hill
Modified: 2016-09-29 23:39 UTC (History)
1 user (show)

example of the problem. (2.16 KB, application/x-gzip)
2016-09-28 20:31 UTC, Tom hill
Patch for issue. (742 bytes, patch)
2016-09-28 20:36 UTC, Tom hill
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom hill 2016-09-28 20:31:52 UTC
Created attachment 34309 [details]
example of the problem.

The record tasks writes relative to the current directory, not relative to its build.xml directory. This is an issue when invoking one build.xml file from another with the "ant" task.

All other tasks (mkdir, copy, javac, etc.) write relative to the build directory. The current behavior makes builds break when the initialization for "record" makes the directory in one place, but record tries to write in another.

Minimal reproducing case attached.
Comment 1 Tom hill 2016-09-28 20:36:16 UTC
Created attachment 34310 [details]
Patch for issue.
Comment 2 Tom hill 2016-09-28 20:49:56 UTC
Note that my patch does change behavior, in the case where one build file invokes another file,  which then ecords. 

If complete backwards compatibility is desired, a new parameter which has the correct behavior could be added. (Correct in the sense that it behaves like other ant core tasks). I'd suggest "file".
Comment 3 Tom hill 2016-09-29 23:39:10 UTC
Oh, well. It looks like this is a duplicate of https://bz.apache.org/bugzilla/show_bug.cgi?id=17781