ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Goodnough" <Andrew.Goodno...@wicourts.gov>
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="svn.info.url"
value="http://subversion/svn/ccap/BBE/branches/02_4X/BBEApp"/>

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

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

Desired Result:

> Branch=02_4X


Andy


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


Mime
View raw message