ant1.6.1のjarタスク
じゃーjarファイルをantで作ってみましょう。
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="daipresens_build" basedir=".">
<property file="build.properties" />
<target name="init"> <mkdir dir="${temp.dir}"/>
<delete> <fileset dir="${temp.dir}"></fileset> </delete>
<mkdir dir="${temp.src.dir}"/> <mkdir dir="${temp.classes.dir}"/> <mkdir dir="${temp.lib.dir}"/> </target>
<target name="makejar"> <copy todir="${temp.src.dir}"> <fileset dir="${src.dir}"> <exclude name="${copy.exclude}" /> </fileset> </copy>
<delete includeemptydirs="true"> <fileset dir="${temp.src.dir}" includes="${copy.exclude}" /> </delete>
<javac srcdir="${temp.src.dir}" destdir="${temp.classes.dir}" encoding="UTF-8" classpath="${classes.dir}"> <classpath> <pathelement path="" /> <fileset dir="${lib.dir}"> <include name="**/*.jar" /> </fileset> </classpath> </javac>
<jar destfile="${temp.lib.dir}/${jar.name}" basedir="${temp.classes.dir}" /> </target>
</project>
builde.properties
project.root=D:/daipresents/project/daipresentsant.dir=${project.root}/ant
temp.dir=${ant.dir}/temptemp.src.dir=${temp.dir}/srctemp.classes.dir=${temp.dir}/classestemp.lib.dir=${temp.dir}/lib
copy.exclude=**/test/**
src.dir=${project.root}/srclib.dir=${project.root}/libclasses.dir=${project.root}/bin;C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/servlet-api.jar
jar.name=daipresents.jar
I'm a software engineer who like travel to island in Japanese. Recently I am enjoying agile manager, coach, product owner for my work. The person grows like that.











