ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Strip a dirname from a property that represents a path
Date Thu, 09 Apr 2009 22:22:36 GMT



--- On Thu, 4/9/09, Eric Wood <EWood@llbean.com> wrote:

> From: Eric Wood <EWood@llbean.com>
> Subject: Strip a dirname from a property that represents a path
> To: "Ant Users List" <user@ant.apache.org>
> Date: Thursday, April 9, 2009, 1:31 PM
> I have a property that is a path
> reference to a jar file and I want to
> get the directory name for the element.  The task
> dirname works with a
> file to set a property, but is there a simply solution to
> grabbing the
> path to from a file.  I assume that I could use the
> ant-contrib
> PropertyRegex task, but was thinking that there is a
> simpler more
> elegant solution.  Any thoughts?
>  
> <property name="pmd.jar"
> value="/release/pmd/pmd/4.1/pmd-4.1.jar" />
>  
> what I want is a property for the "release/pmd/pmd/4.1"
> directory.
>  

>From your example I don't see any reason you can't use

<dirname property="foo" file="${pmd.jar}" />

-Matt

> Thanks, Eric
> 


      

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


Mime
View raw message