2011-02-08 10 views
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> 

答えて

1

代わりにinclude taskを使用して、すべての子ビルドスクリプトを組み込むのはなぜですか?

+0

それは働いた!おかげでrobaker - 大いにあなたの助けに感謝! –

関連する問題