This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
142 lines (96 loc) · 3.49 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<project name="KoLmafia" default="rejar" basedir=".">
<!-- ========================================== -->
<!-- set the global properties for this build -->
<!-- ========================================== -->
<property name="root" location="."/>
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="docs" location="${dist}/docs"/>
<property name="jarfile" location="${dist}/${ant.project.name}.jar"/>
<property name="tarfile" location="${dist}/${ant.project.name}.tar.gz"/>
<property name="main-class" value="net.sourceforge.kolmafia.KoLmafia"/>
<!-- ========================================== -->
<!-- create directories used by other targets -->
<!-- ========================================== -->
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target>
<!-- ======================= -->
<!-- clean up object files -->
<!-- ======================= -->
<target name="clean">
<delete dir="${build}"/>
<delete dir="${docs}"/>
<delete file="${jarfile}"/>
<delete file="${tarfile}"/>
</target>
<!-- ==================== -->
<!-- compile the source -->
<!-- ==================== -->
<target name="compile" depends="init">
<javac source="1.4" srcdir="${src}" destdir="${build}" classpath="${lib}/*.jar" />
<copy todir="${build}" preservelastmodified="true">
<fileset dir="${src}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy todir="${build}" preservelastmodified="true">
<fileset dir="${lib}"/>
</copy>
</target>
<!-- ============================= -->
<!-- generate the executable JAR -->
<!-- ============================= -->
<target name="jar" depends="compile">
<jar destfile="${jarfile}" basedir="${build}" update="true" index="yes">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<!-- ================================================ -->
<!-- generate the executable JAR from a clean state -->
<!-- ================================================ -->
<target name="rejar" depends="clean">
<ant target="jar"/>
</target>
<!-- =========================== -->
<!-- generate the distribution -->
<!-- =========================== -->
<target name="dist">
<ant target="rejar"/>
<tar destfile="${tarfile}" basedir="${root}" compression="gzip">
<exclude name="CVS/**"/>
<exclude name="build/**"/>
<exclude name="dist/**"/>
<exclude name="www/data/**"/>
</tar>
</target>
<!-- ==================================================== -->
<!-- runs program with all needed libraries in the path -->
<!-- ==================================================== -->
<target name="exec" depends="jar">
<java fork="true" jar="${jarfile}" dir="${dist}">
<env key="PATH" path="${lib}/:${java.library.path}"/>
<env key="Path" path="${lib}/:${java.library.path}"/>
</java>
</target>
<!-- ======================================= -->
<!-- generate the javadocs from sourcecode -->
<!-- ======================================= -->
<target name="javadoc" depends="compile">
<mkdir dir="${docs}"/>
<mkdir dir="${docs}/api"/>
<javadoc sourcepath="${src}" destdir="${docs}" packagenames="*">
<link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
<classpath>
<pathelement location="${lib}"/>
<pathelement location="${build}"/>
</classpath>
</javadoc>
</target>
</project>