ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nat Gross <natgross.rentalsyst...@verizon.net>
Subject Re: AW: Last element of current directory name.
Date Wed, 26 Jan 2005 15:43:57 GMT
Hey! I didn't know you can use Javascript in Ant, (not that I know 
Javascript well, but still..) it's cool.
Thanks
-nat
ps. oh, thats what Matt meant by 'using a script'.

Jan.Materne@rzf.fin-nrw.de wrote:

>The upcase part can be done with <script>.
>See http://marc.theaimsgroup.com/?l=ant-user&m=104486168926737&w=2
>
>Jan
>
>  
>
>>-----Urspr√ľngliche Nachricht-----
>>Von: Nat Gross [mailto:natgross.rentalsystems@verizon.net]
>>Gesendet am: Dienstag, 25. Januar 2005 23:20
>>An: Ant Users List
>>Betreff: Re: Last element of current directory name.
>>
>>Matt Benson wrote:
>>
>>    
>>
>>>--- Nat Gross <natgross.rentalsystems@verizon.net>
>>>wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>How do I get just the last element of the current
>>>>directory.
>>>>Suppose basedir = dira/dirb/dirc. (Or any path for
>>>>that matter.)
>>>>   
>>>>
>>>>        
>>>>
>>>Whatever is "the current directory"--${user.dir}?
>>>${basedir}?... You can use the basename task to get
>>>the last element of a path.
>>> 
>>>
>>>      
>>>
>>I have used basename for filenames without realizing that it 
>>also works 
>>for directory names.
>>Thanks.
>>
>>    
>>
>>>>I need a property to = "Dirc". (1st character
>>>>uppercased, if possible.)
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>Changing case is more problematical.  I would either
>>>try ant-contrib's propertyregex (though I'm not good
>>>with changing case in regular expressions either),
>>>write something in Java, or deal with the case as-is. 
>>>Others might use a script.
>>> 
>>>
>>>      
>>>
>>Thanks. I need to explore regex, I guess.
>>
>>    
>>
>>>>For the pros out there it should be 123, but for
>>>>me... forget it!
>>>>   
>>>>
>>>>        
>>>>
>>>HTH,
>>>Matt
>>> 
>>>
>>>      
>>>
>>>>Thanks
>>>>-nat
>>>>   
>>>>        
>>>>


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


Mime
View raw message