가끔씩 if문 같은 conditional statement를 ant에서 하고 싶을때가 있다. 그때는.. available이라는 녀석을 잘 사용하면 된다.

 

<available file="**/x.jar" property="isExist" />

 

isExist에 boolean 값이 저장이 된다.

 

이에 대해서. 특정 target이 실행을 하려고 하면,  다음과 사용하면 된다.

 

<target name="build.start" depends="setup" if="isExist">
  ...
</target>

<target name="build.end" depends="setup" unless="isExist">
  ...
</target>

 

 


Posted by '김용환'
,