Ant는 if문이 있지만, core에는 없고 contribute.jar(?) 라는 파일을 써야 if 조건을 쓸 수 있다.
core만 가지고 실행할 수 있도록 하나 만들었다.
condition과 antcall. target만 가지고도 비슷하게 만들 수 있다.
build.properties
dbpropmanager.application=false
build.xml
<target name="build">
....
<condition property="applied" value="false">
<equals arg1="${dbpropmanager.application}" arg2="false" />
</condition>
<condition property="applied" value="true">
<not><equals arg1="${dbpropmanager.application}" arg2="false" /></not>
</condition>
<antcall target="dbpropmanager_${applied}"/>
</target>
<target name="dbpropmanager_true">
<taskdef name="dbPropertiesTask" classname="com.google.laputa.dbpropmanager.anttask.AntTaskTest" />
<dbPropertiesTask server="${settings.dbProperiesManagerServer}"/>
<echo message="DB Properties Client Module was executed." />
</target>
<target name="dbpropmanager_false">
<echo message="DB Properties Client Module was not executed." />
</target>
....
<condition property="applied" value="false">
<equals arg1="${dbpropmanager.application}" arg2="false" />
</condition>
<condition property="applied" value="true">
<not><equals arg1="${dbpropmanager.application}" arg2="false" /></not>
</condition>
<antcall target="dbpropmanager_${applied}"/>
</target>
<target name="dbpropmanager_true">
<taskdef name="dbPropertiesTask" classname="com.google.laputa.dbpropmanager.anttask.AntTaskTest" />
<dbPropertiesTask server="${settings.dbProperiesManagerServer}"/>
<echo message="DB Properties Client Module was executed." />
</target>
<target name="dbpropmanager_false">
<echo message="DB Properties Client Module was not executed." />
</target>
'etc tools' 카테고리의 다른 글
ivy vs maven 2 비교 자료 (0) | 2010.07.07 |
---|---|
Load Runner 대체 툴 Grinder (1) | 2010.02.01 |
라이브온에어 (0) | 2009.04.07 |
여러 줄에서 특정 정규 패턴 찾아내기 (1) | 2009.03.09 |
ACK 의 위력 (faster than grep) (0) | 2009.03.04 |