ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: [script]masking dotted ant properties ?
Date Thu, 30 Nov 2006 09:44:04 GMT
The reason is that ant properties may have names
that are not valid variable names in the the various
scritpting languages - so ant only makes variables
out of the properties that have a chance of being
a valid variable name in most lanuages.

for example:
$ant.working.dir is not a valid ruby global variable name.

Peter


On 11/30/06, Rebhan, Gilbert <Gilbert.Rebhan@huk-coburg.de> wrote:
>
> Thanks a lot Peter !!
>
> Didn't realise it would be that easy
>
> In the meantime i tried with
>
> <script language="ruby">
>             <![CDATA[
>             require 'java'
>             antworkingdir=$project.getProperty "ant.working.dir"
>             jversion=$project.getProperty "java.version"
>             puts antworkingdir
>             puts jversion
>             ]]>
>         </script>
>
> putting the dotted properties into strings, which worked too.
> so i was already on the right way ;-)
>
> But it's funny that undotted properties can be used
> by ruby right away with $propertyname,
> whereas dotted properties have to be called
> with getProperty method.
>
> Regards, Gilbert
>
> -----Original Message-----
> From: Peter Reilly [mailto:peter.kitt.reilly@gmail.com]
> Sent: Thursday, November 30, 2006 10:11 AM
> To: Ant Users List
> Subject: Re: [script]masking dotted ant properties ?
>
> There is no syntax for the dotted properties.
> The only properties that are set in
> scripts are those that have "java identifier" like
> names.
>
> Use:
>
> <script language="ruby">
>    puts $project.getProperty('ant.working.dir')
> </script>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message