ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Goodnough" <>
Subject How to set a property based on a mapper result of another property
Date Thu, 20 Apr 2006 18:47:03 GMT
I've got a property with the value
"http://subversion/svn/ccap/BBE/branches/02_4X/BBEApp".  This
property will change based on context.  I want to create a new property
from this other property that contains the value "02_4X".  I'm looking
for a feature in the <property> task that can accept a <mapper> (like
the <propertyset> task) but works on a single property.  I'm thinking it
would look something like the code below.  Is there anything which
currently would do this?

<!-- Setup first property -->
<property name=""

<!-- Assign second from the first using a mapper -->
<property name="svn.branch">
	<property name="">
                                    <!-- This regex is probably bad,
but you get the point -->
		<mapper type="regex" type="regexp"
from="^(.*)/([^branches]+)/([^/]*)$$" to="\2"/>

<!-- Echo the result -->
<echo message="Branch=${svn.branch}"/>

Desired Result:

> Branch=02_4X


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message