-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
96 lines (82 loc) · 3.15 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
<?xml version="1.0"?>
<project name="IJA project Warehouse" default="run">
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="build"/>
<property name="dest.dir" value="dest"/>
<property name="src.dir" value="src"/>
<property name="doc.dir" value="doc"/>
<property name="data.dir" value="data"/>
<property name="jar.name" value="ija-app.jar"/>
<property name="warehouse.data" value="${data.dir}/warehouse.json"/>
<property name="goods.data" value="${data.dir}/goods.json"/>
<property name="orders.data" value="${data.dir}/orders.json"/>
<property name="download.script" value="${lib.dir}/get-libs.sh"/>
<path id="lib.compile.path">
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<path id="lib.runtime.path">
<fileset dir="${dest.dir}" includes="${jar.name}"/>
</path>
<target name="run">
<java classname="ija.project.warehouse.WarehouseSimulation" fork="true" failonerror="yes" classpathref="lib.runtime.path">
<arg value="${warehouse.data}"/>
<arg value="${goods.data}"/>
<arg value="${orders.data}"/>
<arg value="--debug"/>
</java>
</target>
<target name="doc" depends="clean-doc">
<javadoc sourcepath="${src.dir}" destdir="${doc.dir}">
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<target name="compile" depends="create-build, create-dest, clean, download-libs">
<javac srcdir="${src.dir}" destdir="${build.dir}" debug="true" debuglevel="lines,vars,source" includeantruntime="false" classpathref="lib.compile.path">
<compilerarg line="-Xlint:unchecked"/>
</javac>
<jar destfile="${dest.dir}/${jar.name}" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="ija.project.warehouse.WarehouseSimulation"/>
</manifest>
<zipfileset src="${lib.dir}/json-simple-1.1.jar" includes="**/*.java **/*.class"/>
</jar>
</target>
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="${build.dir}" includes="**/*"/>
<fileset dir="${dest.dir}" includes="**/*"/>
</delete>
</target>
<target name="clean-doc">
<delete includeemptydirs="true">
<fileset dir="${doc.dir}">
<include name="**/*"/>
<exclude name="architektura.pdf"/>
</fileset>
</delete>
</target>
<target name="download-libs" depends="check-json-simple" unless="${json-simple.exists}">
<exec executable="/bin/sh">
<arg value="${download.script}"/>
</exec>
</target>
<target name="create-build" depends="check-build-dir" unless="${build-dir.exists}">
<mkdir dir="${build.dir}"/>
</target>
<target name="create-dest" depends="check-dest-dir" unless="${dest-dir.exists}">
<mkdir dir="${dest.dir}"/>
</target>
<target name="check-json-simple">
<available property="json-simple.exists" file="${lib.dir}/json-simple-1.1.jar"/>
</target>
<target name="check-build-dir">
<available property="build-dir.exists" file="${build.dir}"/>
</target>
<target name="check-dest-dir">
<available property="dest-dir.exists" file="${dest.dir}"/>
</target>
</project>