Bug 60185

Summary: "record" task doesn't work correctly when invoked from another build
Product: Ant Reporter: Tom hill <bz.apache.org>
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: normal CC: bz.apache.org
Priority: P2    
Version: 1.9.7   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X 10.1   
Attachments: example of the problem.
Patch for issue.

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