tags:

views:

181

answers:

2

I'm trying to store a relative path to a file in my ant build.xml like this:

<property name="foo" location="somedir/myfile" relative="true"/>

According to the Ant manual for Property this is ok syntax, but when running it Ant says:

property doesn't support the "relative" attribute

I'm using Apache Ant version 1.7.1 compiled on August 13 2009

A: 

I think that if in the location is not specified the root path ('/') which is absolute , it takes relative as default, so the "relative=true" is unnecesary.

location Sets the property to the absolute filename of the given file. If the value of this attribute is an absolute path, it is left unchanged (with / and \ characters converted to the current platforms conventions). Otherwise it is taken as a path relative to the project's basedir and expanded. (from the documentation)

Aito
But i don't want an absolute path. The ant cvs target requires a relative path to the file being committed.
leif81
perhaps you ommit the base url from where to be relative <property name="foo" location="my/file.txt" relative="true" basedir="cvs"/>
Aito
+1  A: 

Manual that came with 1.7.1 distribution does not mention relative property.

If you look at the top of ant manual link, it says 1.8.0RC1. I guess these are new 1.8.0 attributes of property task. Probably you should report a bug to the ant team to mark relative and basedir attributes as Since 1.8.0

On the other hand if you need a relative path to a basedir, just use a value attribute of property task.

-- UPDATE

I've submitted a bug to ant team

Alexander Pogrebnyak
thankyou, submitted https://issues.apache.org/bugzilla/show_bug.cgi?id=48610
leif81
you beat me to it
leif81