Bug 17781

Summary: name attribute of record task is not relative to basedir
Product: Ant Reporter: Marius Scurtescu <marius.scurtescu>
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: enhancement CC: leichen, marius.scurtescu
Priority: P3    
Version: 1.5   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Marius Scurtescu 2003-03-07 17:55:12 UTC
The 'name' attribute of the 'record' task is specifying a file name and this
file name is relative to the current folder and not to the 'basedir' of the project.

If the build file is run by some other tool (like Antelope) then the current
folder is not even the folder where the build file is.

The 'name' attribute probably should be relative to the project 'basedir' (as
difined in the 'project' root tag), the same way the 'echoproperties' optional
tag works for example.
Comment 1 Stefan Bodewig 2003-09-25 13:36:58 UTC
You are correct, that name should resolve relative files as most other tasks do.

Unfortunately if we change current behavior, we may break existing code, so we
can't.  What we could do, was implementing an additional attribute with the
correct behavior.

As a workaround, you can prepend ${basedir} to the value of your name attribute.
Comment 2 Stefan Bodewig 2003-10-02 12:21:26 UTC
*** Bug 23563 has been marked as a duplicate of this bug. ***
Comment 3 Jan Mat 2003-10-02 12:56:51 UTC
I played a little bit with that. An additional file-attribute would help.
But I have to search for a solution for getting the right name from the file.

Scenario:
    <record file="logs/log.txt" action="start" />
    <record name="logs/log.txt" action="stop" />  		  	
Both should use the same recorder. But file is a java.io.File and set by Ant 
with an absolute value (e.g. /home/test/logs/log.txt). So I have to get the 
relative part (/home/test = basedir). But the problem is: what if I set the 
file value to an absolute value by myself?
  	<record file="/logs/antlogs/logs/log.txt" action="start" />