ファイル(パターンで指定)をAntmacrodefの特定の場所に移動しようとしています。
<macrodef name="extract">
<attribute name="package"/>
<sequential>
<!-- the path will contain the unique file in extracted regardless of the name -->
<path id="source_refid">
<dirset dir="${dep}/lib/@{package}/extracted/">
<include name="@{package}-*"/>
</dirset>
</path>
<!-- this is not working: properties are immutable -->
<property name="source_name" refid="source_refid"/>
<move
file="${source_name}"
tofile="${dep}/@{package}/"
overwrite="true"
/>
</sequential>
</macrodef>
${source_name}
これは、不変であるため、一度だけ機能します。
オプションは変数タスクを使用することですが、refidをに割り当てる方法が見つかりませんでしたvar
。
macrodefにローカル変数に似たものを含める方法はありますか?または(XY問題)私の問題を解決するためのより良い方法はありますか?