2011-02-08 4 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 - 크게 도움을 주셔서 감사합니다! –