Ant 사용기
이번에 블로그를 스프링으로 적용시키면서 처음으로 Ant 를 이용해봤습니다.
자동으로 빌드를 해 주는 툴이라고만 들었는데, 실제로 써보니 상당히 편하네요.
밑에는 간단한 소스입니다.
자세한 내용은 http://ant.apache.org/manual/index.html 에서 확인 할 수 있습니다.
<?xml version="1.0" encoding="UTF-8"?>
<project name="blog" default="build">
<property name="src" value="www/WEB-INF/src"/>
<property name="build" value="www/WEB-INF/classes"/>
<path id="classpath">
<fileset dir="www/WEB-INF/lib">
<include name="*.jar" />
</fileset>
<fileset dir="tomcat/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
<mkdir dir="${build}" />
</target>
<target name="build" depends="init">
<javac srcdir="${src}" destdir="${build}"
debug="yes"
source="1.5"
target="1.5"
encoding="UTF-8">
<classpath refid="classpath" />
</javac>
</target>
<target name="clean">
<delete dir="${build}"/>
</target>
</project>
사용방법
ant
현재 디렉토리의 build.xml 파일을 default target 으로 실행합니다.
ant -buildfile test.xml
현재 디렉토리의 test.xml 파일을 default target 으로 실행합니다.
ant -buildfile test.xml dist
현재 디렉토리의 test.xml
파일을 타겟으로 dist
을 실행합니다..