2011-10-12 2 views

답변

5

예를 들어 대상에 if 속성을 사용합니다. :

<project name="test" default="init"> 
    <target name="init" if="${path}"> 
     <!--This will only execute if ${path} is defined from the command line--> 
    </target> 
</project> 

두 번째 옵션 : 더 자세한

<project name="test" default="init"> 
    <target name="init"> 
     <fail message="Path is not set! Exiting ant script!"> 
     <condition> 
      <not> 
      <isset property="${path}"/> 
      </not> 
     </condition> 
     </fail> 
    </target> 
</project>