OSDN Git Service

add a little program 'chartool'
[sawarabi-fonts/sawarabi-fonts.git] / chartool / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="chartool" default="dest" basedir=".">
3
4   <property name="src" location="src"/>
5   <property name="build" location="build"/>
6   <property name="dest" location="dest"/>
7   <property name="lib" location="lib"/>
8   <property name="temp" location="temp"/>
9   <property name="rhino.ftp.dir" 
10             value="ftp://ftp.mozilla.org/pub/mozilla.org/js"/>
11   <property name="rhino.name" value="rhino1_7R2"/>
12   <property name="manifest.name" value="MANIFEST.MF"/>
13
14   <target name="init">
15     <mkdir dir="${build}"/>
16     <mkdir dir="${lib}"/>
17   </target>
18
19   <target name="rhino.check" depends="init">
20     <available file="${lib}/js.jar" property="rhino.exists"/>
21   </target>
22
23   <target name="download" depends="rhino.check" unless="rhino.exists">
24     <mkdir dir="${temp}"/>
25     <get src="${rhino.ftp.dir}/${rhino.name}.zip" 
26          dest="${temp}/${rhino.name}.zip"/>
27     <unzip src="${temp}/${rhino.name}.zip" dest="${temp}"/>
28     <move file="${temp}/${rhino.name}/js.jar" todir="${lib}"/>
29   </target>
30
31   <target name="compile" depends="download">
32     <javac srcdir="${src}" 
33            destdir="${build}"
34            classpath="${lib}/js.jar"/>
35   </target>
36
37   <target name="manifest" depends="compile">
38     <mkdir dir="${temp}"/>
39     <manifest file="${temp}/${manifest.name}">
40       <attribute name="Class-Path" value=". lib/js.jar"/>
41       <attribute name="Main-Class"
42                  value="jp.sourceforge.sawarabifonts.chartool.Main"/>
43     </manifest>
44   </target>
45
46   <target name="dest" depends="manifest">
47     <mkdir dir="${dest}"/>
48     <copy todir="${dest}/lib">
49       <fileset dir="${lib}"/>
50     </copy>
51     <copy todir="${dest}/js">
52       <fileset dir="js"/>
53     </copy>
54     <jar destfile="${dest}/chartool.jar"
55          basedir="${build}"
56          manifest="${temp}/${manifest.name}"/>
57   </target>
58
59   <target name="clean">
60     <delete dir="${build}"/>
61     <delete dir="${temp}"/>
62   </target>
63 </project>