Make ascent speed a command line option.
[dive.git] / build.xml
blob81006e7e8a6be30b2707267299665a022b339cbf
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!-- Ametros Dive Computer
3      Copyright (C) 2010 Geoff Johnstone
5      This program is free software: you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published by
7      the Free Software Foundation, either version 3 of the License, or
8      (at your option) any later version.
10      This program is distributed in the hope that it will be useful,
11      but WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13      GNU General Public License for more details.
15      You should have received a copy of the GNU General Public License
16      along with this program.  If not, see http://www.gnu.org/licenses/.
17 -->
18 <project name="Dive Tables" default="dist">
20   <path id="AntClassPath">
21     <fileset dir="ant" includes="*.jar" />
22   </path>
25   <taskdef name="xjc"
26            classname="com.sun.tools.xjc.XJCTask"
27            classpathref="AntClassPath" />
30   <path id="ClassPath">
31     <fileset dir="lib" includes="*.jar" />
32   </path>
35   <property name="JAR" value="dive.jar" />
36   <property name="Main-Class" value="net.ametros.dive.Main" />
39   <target name="autogen">
40     <mkdir dir="gensrc"/>
41     <xjc schema="xsd/dives.xsd"
42          destdir="gensrc"
43          package="net.ametros.dive.data">
44       <produces dir="gensrc/net/ametros/dive/data" includes="*.java" />
45     </xjc>
46   </target>
49   <target name="compile" depends="autogen">
50     <mkdir dir="classes" />
52     <javac destdir="classes"
53            classpathref="ClassPath"
54            includeantruntime="false"
55            debug="true">
56       <compilerarg value="-Xlint:deprecation" />
57       <compilerarg value="-Xlint:unchecked" />
58       <src path="src" />
59       <src path="gensrc" />
60     </javac>
61   </target>
64   <target name="jar" depends="compile">
65     <manifestclasspath property="jar.classpath" jarfile="lib/dummy.jar">
66       <classpath refid="ClassPath" />
67     </manifestclasspath>
68     <jar destfile="${JAR}">
69       <manifest>
70         <attribute name="Main-Class" value="${Main-Class}" />
71         <attribute name="Class-Path" value="${jar.classpath}" />
72       </manifest>
73       <fileset dir="classes" includes="**/*" />
74       <fileset dir="xsd" includes="*.xsd" />
75       <fileset dir="templates" includes="**/*" />
76     </jar>
77   </target>
80   <target name="dist" depends="jar">
81     <mkdir dir="dist" />
82     <copy todir="dist">
83       <fileset file="${JAR}" />
84       <fileset dir="lib" includes="*.jar" />
85     </copy>
86   </target>
89   <target name="javadoc" depends="autogen">
90     <delete dir="javadoc" />
91     <javadoc destdir="javadoc"
92              failonerror="true"
93              classpathref="ClassPath"
94              doctitle="Ametros Dive Computer"
95              windowtitle="Ametros Dive Computer">
96       <fileset dir="src" includes="**/*.java" />
97       <fileset dir="gensrc" includes="**/*.java" />
98     </javadoc>
99   </target>
102   <target name="tar">
103     <delete file="dive.tar.gz" />
104     <exec executable="git" failonerror="true">
105       <arg value="archive" />
106       <arg value="--format=tar" />
107       <arg value="--prefix=dive/" />
108       <arg value="-o" />
109       <arg value="dive.tar" />
110       <arg value="master" />
111     </exec>
112     <exec executable="gzip" failonerror="true">
113       <arg value="-9" />
114       <arg value="dive.tar" />
115     </exec>
116   </target>
119   <target name="clean">
120     <delete dir="gensrc" />
121     <delete dir="classes" />
122     <delete dir="dist" />
123     <delete dir="javadoc" />
124     <delete file="${JAR}" />
125     <delete file="dive.tar" />
126     <delete file="dive.tar.gz" />
127   </target>
129 </project>