Thanks for this idea!

The problem is that the input list is of unknown size, and I could not find
a regexp that will convert all items in this list correctly (I bet this can
be done).

So I came up with the following solution using <for>, <var> and
<propertyregex>:

    <var name="dependencies.path" value="" />
    <property name="input.list" value="aaa,bbb,ccc" />

    <target name="calculate-dependencies-path" description="Converts the
input.list comma-seperated list to dependencies.path">
        <for param="item" list="${input.list}">
            <sequential>
                <propertyregex property="item.path"
                        override="true"
                        input="@{item}"
                        regexp="(.+)"
                        replace="**/\1\/"
                        casesensitive="false"/>
                <var name="dependencies.path"
value="${dependencies.path},${item.path}" />
            </sequential>
        </for>
        <echo>RESULT: ${dependencies.path}</echo>
    </target>

This prints
    RESULT: ,**/aaa/,**/bbb/,**/ccc/

If there is an easier solution using one line regexp I would gladly use it,
as this is somewhat cumbersome.

Thanks!
Ariel
-- 
View this message in context: 
http://www.nabble.com/How-to-build-an-Ant-path-from-a-comma-seperated-list--tp20572597p20587661.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to