0
どうすればよいですか?いくつかのビルドファイルがあれば、ターゲット(コマンドラインから指定されたもの)が存在するものだけを含めることができます。 target::exists
を使用しても動作しないようです。ありがとう。ビルドファイルを含める/除外する
<target name="*">
<property name="curr.target" value="${target::get-current-target()}"/>
<nant target="${curr.target}">
<buildfiles>
<include name="*.build" if="${target::exists(curr.target)}"/>
<!-- avoid recursive execution of current build file-->
<exclude name="${project::get-buildfile-path()}" />
</buildfiles>
</nant>
</target>
robakerのソリューションを使用して、私の最終的なビルドファイルは次のようになります。ターゲットが特定のビルドファイルに見つからない場合(以前のコードとは異なります)、もはや失敗しません。
<project>
<include buildfile="A.build"/>
<include buildfile="B.build"/>
<target name="*">
<nant target="${target::get-current-target()}"/>
</target>
</project>
それは働いた!おかげでrobaker - 大いにあなたの助けに感謝! –