-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
53 lines (43 loc) · 1.84 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0"?>
<project name="THViewer" basedir="." default="all">
<property name="src.dir" value="src" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="dist.dir" value="${build.dir}/dist" />
<property name="commons.jar" value="commons-io-1.4.jar" />
<property name="main-class" value="thv.th.Main" />
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${classes.dir}" />
<mkdir dir="${dist.dir}" />
</target>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="build" depends="init">
<fail message="You need to provide apache commons io (${commons.jar}) in this directory.">
<condition>
<not>
<available classname="org.apache.commons.io.EndianUtils" classpath="${commons.jar}" />
</not>
</condition>
</fail>
<javac classpath="${commons.jar}" debug="true" debuglevel="lines" srcdir="${src.dir}" destdir="${classes.dir}" />
</target>
<target name="dist" depends="build">
<jar destfile="${dist.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}" />
<attribute name="Class-Path" value="${commons.jar}" />
</manifest>
</jar>
<copy file="FileList.xml" todir="${dist.dir}" />
<copy file="LICENSE" todir="${dist.dir}" />
<copy file="README" todir="${dist.dir}" />
<copy file="${commons.jar}" todir="${dist.dir}" />
</target>
<target name="run" depends="dist">
<java jar="${dist.dir}/${ant.project.name}.jar" fork="true" />
</target>
<target name="all" depends="dist" />
</project>