ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: AW: project basedir
Date Thu, 20 Feb 2003 10:40:23 GMT
Also, don't forget about:

	ant -propertyfile myprops.properties



On Thursday, February 20, 2003, at 05:18  AM, 
Jan.Materne@rzf.fin-nrw.de wrote:

> I think it depends on the order in which this special property is set:
> during parsing time
> of the build file BEFORE loading the properties-file.
>
> But you should be able to set a different one by invokint Ant:
> 	ant -Dbasedir=c:\development ...
>
> One momen - a small test ...
> ... jepp:
>
> <project name="test" default="test" basedir=".">
>     <target name="test">
>         <echo>basedir=${basedir}</echo>
>     </target>
> </project>
>
> ant
> test:
>      [echo] basedir=C:\temp
>
> ant -Dbasedir=..
> test:
>      [echo] basedir=..
>
> ant -Dbasedir=c:\development
> BUILD FAILED
> Basedir C:\development does not exist
>
> ant -Dbasedir=c:\winnt
> test:
>      [echo] basedir=c:\winnt
>
>
>
> Maybe you write a wrapper script which evaluates an environment 
> variable or
> so...
>
>
> Jan Matèrne
>
>> -----Urspr√ľngliche Nachricht-----
>> Von: Matthew Oatham [mailto:matthewoatham@hotmail.com]
>> Gesendet am: Donnerstag, 20. Februar 2003 11:15
>> An: user@ant.apache.org
>> Betreff: project basedir
>>
>> Hi,
>>
>> I need my project to be able to take different basedir values i.e.
>>
>> <project ... basedir="c:\code">
>> <project ... basedir="c:\development">
>>
>> depending on a users setup. Therefore I thought I would
>> specify basedir in a properties file that coould be changed
>> by users depending on there set-up.
>>
>> i.e
>>
>> <project ... basedir="${someProperty}">
>>
>> someProperty=c:\code
>>
>> However this didn't work so I tried, as suggested by others,
>> removing the basedir attribute and putting it in a properties
>> file i.e.
>>
>> <project ...>
>>
>> basedir=c:\code
>>
>> Again this still didn't pick up the basedir.
>>
>> Has anyone managed to do this?
>>
>> Regards.
>>
>> Matt.
>>


Mime
View raw message