ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Matèrne (jhm) <apa...@materne.de>
Subject AW: basedir setting not working?
Date Thu, 18 Apr 2013 06:15:57 GMT
The "." in the basedir attribute is relative to the buildfile itself, not
the current directory.
You could access that via ${user.dir} :

<project basedir=".">
    <echo>BaseDir: ${basedir}</echo>
    <echo>UserDir: ${user.dir}</echo>
</project>

You can't set that value as basedir because at the time when basedir is set,
the system properties aren't populates as Ant properties.
(Also I would not do that because can't be sure from where a user is calling
the buildfile with strange site effects ... think of a "ant clean" in your
home dir?)


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Michael Niemand [mailto:michael.niemand@gmail.com]
> Gesendet: Mittwoch, 17. April 2013 16:12
> An: user@ant.apache.org
> Betreff: basedir setting not working?
> 
> Hi folks,
> 
> my basedir setting doesnt seem to work.
> 
> I have the same project I check out to two different locations.
> 
> in the second project the basedir setting doesnt seem to work.
> 
> Here's what I do:
> 
> <!-- <project name="ClientKapselTest" default="targets" basedir="./">
> also tried that --> <project name="ClientKapselTest" default="targets"
> >
> 
> <!-- ==================== Initialization properties
> =====================
> -->
> <echo message="*** what's considered basedir before setting it:
> ${basedir}"
> />
> <property name="basedir" value="."/>
> <echo message="*** what's considered basedir after setting it:
> ${basedir}"
> />
> 
> </project>
> 
> The result is always:
> 
>      [echo] *** what's considered basedir before setting it:
> M:\path\to\A
>      [echo] *** what's considered basedir after setting it:
> M:\path\to\A
> 
> 
> even though I execute the ant-skript in M:\path\to\B
> 
> 
> I thought basedir is always the path where the build.xml itself
> resides?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message