2011-04-20 7 views
1

NANT를 사용하여 프로젝트 (A)를 빌드하려고합니다. 프로젝트 (A)는 NANT로 건설 된 다른 프로젝트 (B)를 의지합니다. 프로젝트 (A) 빌드 내에서 종속 프로젝트 (B)의 빌드를 호출 할 수 있기를 원합니다. 프로젝트 B의 빌드 파일을 프로젝트 A의 빌드 파일에 포함 시키려고했습니다. 두 빌드 파일에 동일한 이름을 가진 대상이 포함되어 있기 때문에 오류가 발생합니다.NANT를 사용하여 하위 프로젝트 빌드

포함 된 빌드 파일의 별칭을 지정하는 방법이 있습니까?

답변

0

내가 포함 작업을 사용하여이 작업을 시도했지만 실제로는 필수 작업이 아닌 것으로 나타났습니다.

3

"nant"조치를 사용하여 다른 빌드 파일을 호출하는 "상위"빌드 파일을 작성하여 이와 같이 수행 할 수 있습니다.

<target name="rebuild" depends="" > 
    <nant target="${target::get-current-target()}"> 
     <buildfiles> 
      <include name="projectB.build" /> 
      <include name="projectC.build" /> 
     </buildfiles> 
    </nant> 
</target> 
0

'마스터'파일에는 이러한 대상이 여러 개있을 수 있습니다. 필자는 종종 다음 구성을 사용하여 스크립트 유지 관리를 쉽게하기 위해 대상간에 빌드 파일 세트를 공유합니다.

<fileset id="buildfiles.all"> 
    <include name="projectB.build"/> 
    <include name="projectB.build"/> 
</fileset> 

<target name="build"> 
    <nant target="${target::get-current-target()}"> 
     <buildfiles refid="buildfiles.all" /> 
    </nant> 
</target> 

<target name="clean"> 
    <nant target="${target::get-current-target()}"> 
     <buildfiles refid="buildfiles.all" /> 
    </nant> 
</target> 

<target name="publish"> 
    <nant target="${target::get-current-target()}"> 
     <buildfiles refid="buildfiles.all" /> 
    </nant> 
</target> 
관련 문제