른록노트
[ant] 외부 라이브러리 이용하여 build 하는 방법 본문
@ 방법
<?xml version="1.0"?>
<project name="AntTest" default="main" basedir=".">
<property name="name" value="dist"></property>
<property name="project.version" value="1.0.0"></property>
<property name="src.dir" value="src"></property>
<property name="build.dir" value="build"></property>
<property name="classes.dir" value="${build.dir}/classes"></property>
<property name="jar.dir" value="${build.dir}/jar"></property>
<property name="lib.dir" value="lib"></property>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"></fileset>
</path>
<target name="clean">
<delete dir="${build.dir}"></delete>
</target>
<target name="init">
<mkdir dir="${build.dir}"></mkdir>
<mkdir dir="${build.dir}/classes"></mkdir>
</target>
<target name="compile" depends="init">
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" includeantruntime="false">
</javac>
</target>
<target name="jar" depends="compile">
<jar destfile="${build.dir}/${name}-${project.version}.jar" basedir="${build.dir}/classes">
</jar>
</target>
<target name="main" depends="clean,jar">
</target>
</project>
@실행방법
build.xml이 있는곳으로 경로를 이동하여
ant main 명령어 실행
@ 참고사이트
반응형
Comments