开发者

In an ANT build.xml file, how can I iterate over the items in the ${env} variable?

开发者 https://www.devze.com 2022-12-14 14:56 出处:网络
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} Using foreach from an

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}


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消