forked from MahaMaabar/DisCVR
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
142 lines (120 loc) · 4.85 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
<?xml version="1.0"?>
<project name="Ant-Test" default="main" basedir=".">
<!-- Sets variables which can later be used. -->
<!-- The value of a property is accessed via ${} -->
<property name="src.dir" location="src" />
<property name="bin.dir" location="bin" />
<property name="build.dir" location="build" />
<property name="classes.dir" location="${build.dir}/classes" />
<property name="classes.lib.dir" location="${classes.dir}/lib" />
<property name="classes.res.dir" location="${classes.dir}/resources" />
<property name="dist.dir" location="dist" />
<property name="dist.lib.dir" location="${dist.dir}/lib" />
<property name="lib.dir" location="${basedir}/lib" />
<property name="res.dir" location="/resources" />
<property name="customisedDB.dir" location="${basedir}/customisedDB" />
<property name="dist.customisedDB.dir" location="${dist.dir}/customisedDB" />
<path id="classpath.path">
<pathelement location="${classes.dir}"/>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="resources">
<include name="**"/>
</fileset>
<!--fileset dir="images">
<include name="**"/>
</fileset-->
<!--pathelement location="../lib/httpunit.jar"/>
<pathelement location="../lib/Tidy.jar"/>
<pathelement location="../lib/xerces.jar"/-->
</path>
<!-- Deletes the existing build, docs and dist directory -->
<target name="clean">
<delete dir="${classes.dir}" />
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<!-- Creates the build, and dist directory-->
<target name="makedir">
<mkdir dir="${build.dir}" />
<mkdir dir="${classes.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${classes.lib.dir}" />
<mkdir dir="${classes.res.dir}" />
<mkdir dir="${dist.lib.dir}" />
<mkdir dir="${dist.customisedDB.dir}" />
</target>
<!-- Compiles the java code -->
<target name="compile" depends="clean, makedir">
<javac srcdir="${src.dir}" destdir="${classes.dir}"
deprecation="on" debug="on">
<classpath><path refid="classpath.path"/></classpath>
</javac>
</target>
<target name="copy-dependencies" >
<copy todir="${build.dir}">
<fileset dir="${src.dir}"
includes="**"
excludes="**/*.java"/>
</copy>
</target>
<target name="copy-lib" >
<copy todir="${classes.lib.dir}">
<fileset dir="${lib.dir}"
includes="**"/>
</copy>
</target>
<target name="copy-res" >
<copy todir="${classes.res.dir}">
<fileset dir="${res.dir}"
includes="**"/>
</copy>
</target>
<target name="copy-externalLibraries" >
<copy todir="${dist.lib.dir}">
<fileset dir="${lib.dir}"
includes="**"/>
</copy>
</target>
<!--set permission on a folder -->
<target name="set-perms" >
<chmod file="${dist.lib.dir}/**" perm="775" type="both"/>
<chmod file="${dist.customisedDB.dir}/**" perm="775" type="both"/>
<!--chmod perm="ou+rx">
<fileset dir="${dist.dir}/{lib.dir}" >
</fileset>
</chmod-->
</target>
<!--Creates the deployable jar file -->
<target name="jar" depends="compile, copy-lib, copy-res, copy-externalLibraries, set-perms">
<jar destfile="${dist.dir}/DisCVR_CL.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="model.SampleClassification" />
</manifest>
<!-- Add the JFreeChart jars-->
<zipfileset src="${basedir}/lib/jfreechart-1.0.19.jar"/>
<zipfileset src="${basedir}/lib/jcommon-1.0.23.jar"/>
<zipfileset src="${basedir}/lib/kanalyze.jar" />
<zipfileset src="${basedir}/lib/java-getopt-1.0.14.jar" />
<!--zipfileset dir="${basedir}/resources" prefix="resources" includes="**"/-->
</jar>
</target>
<target name="gui-jar" depends="compile, copy-lib, copy-res, copy-externalLibraries, set-perms">
<!--jar destfile="${classes.dir}/DisCVR.jar" basedir="${classes.dir}"-->
<jar destfile="${dist.dir}/DisCVR.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="gui.DisCVRApp" />
</manifest>
<!-- Add the JFreeChart jars-->
<zipfileset src="${basedir}/lib/jfreechart-1.0.19.jar"/>
<zipfileset src="${basedir}/lib/jcommon-1.0.23.jar"/>
<zipfileset src="${basedir}/lib/kanalyze.jar" />
<zipfileset src="${basedir}/lib/java-getopt-1.0.14.jar" />
<!--zipfileset dir="${basedir}/resources" prefix="resources" includes="**"/-->
</jar>
</target>
<target name="main" depends="compile, copy-lib, copy-res, gui-jar, jar">
<description>Main target</description>
</target>
</project>