views:

84

answers:

1

This is in a Windows XP environment.

I'm trying to install and edit some files that have default settings. I want to update these settings use items from ${env}

+3  A: 

Using foreach from ant-contrib, you could iterate over ${env} like:

<target name="run">
    <foreach item="String" in="${env.CLASSPATH}" delim=";" property="x">
        <echo message="${x}" />
    </foreach>
</target>

I was able to do this with NAnt:

<target name="run">
    <foreach item="String" in="${environment::get-variable('CLASSPATH')}" delim=";" property="x">
        <echo message="${x}" />
    </foreach>
</target>
Forgotten Semicolon
ant-contrib works too =] what about getting each ${env.*} ?
codeninja
`echoproperties` may be what you're looking for. http://ant.apache.org/manual/OptionalTasks/echoproperties.html
Forgotten Semicolon