1

我在脚本开头填充了一个文件集,如下所示;

<!-- Define the list of projects to be built -->
<fileset id="ivy.buildlist.fileset" dir="${ivy.buildlist.dir}" includes="${ivy.buildlist.includes}" excludes="${ivy.buildlist.excludes}" />

但是如果用户选择特定任务,我想更新这个参考。为此,我编写了一个新目标<intersect>,将调用该目标,但不会更新引用;

<target name="getPreReleaseList" description="Target to override the component list for pre release" >
    <echo message="Existing List : ${toString:ivy.buildlist.fileset}" />
    <intersect>
        <fileset refid="ivy.buildlist.fileset" />
        <fileset dir="${ivy.buildlist.dir}" 
            includes="${ivy.pre.buildlist.includes}"
            excludes="${ivy.pre.buildlist.excludes}" />
    </intersect>
    <echo message="Updated List : ${toString:ivy.buildlist.fileset}" />
</target>

之前和之后的列表ivy.buildlist.fileset是相同的:(。我错过了什么还是我采用了不同的方法。

4

1 回答 1

0

Your problem is due to the fact that ant properties are immutable.

In order to modify a property, you could either use the variable task or use a macrodef.

I suggest you take a look at the following question for more detail.

于 2013-08-20T17:05:44.550 回答