-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
105 lines (92 loc) · 2.97 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
<project name="owllistener" default="compile" basedir=".">
<property name="src" location="src" />
<property name="output" location="build" />
<property name="dist" location="dist" />
<path id="logging_libs">
<pathelement location="lib/slf4j-api-1.7.5.jar" />
<pathelement location="lib/logback-core-1.0.10.jar" />
<pathelement location="lib/logback-classic-1.0.10.jar" />
</path>
<path id="testing_libs">
<pathelement location="lib/junit4.11/junit-4.11.jar" />
<pathelement location="lib/junit4.11/hamcrest-core-1.3.jar" />
</path>
<path id="apacheCSV">
<pathelement location="lib/commons-csv-1.1/commons-csv-1.1.jar" />
</path>
<path id="owllistener.classpath">
<pathelement location="${output}" />
<path refid="logging_libs" />
<path refid="apacheCSV" />
</path>
<path id="compile.classpath">
<path refid="owllistener.classpath" />
<path refid="testing_libs" />
</path>
<target name="init">
<mkdir dir="testoutput" />
<mkdir dir="${output}" />
</target>
<target name="clean">
<delete dir="${output}" />
<delete dir="dist" />
<delete dir="testoutput" />
</target>
<target name="compile" depends="init">
<javac debug="true" destdir="${output}" includeantruntime="false" target="1.7" source="1.7">
<src path="src" />
<src path="test" />
<classpath refid="compile.classpath" />
</javac>
</target>
<target name="test" depends="init,compile">
<junit fork="no" haltonfailure="true" haltonerror="true">
<classpath refid="compile.classpath" />
<batchtest fork="yes" todir="testoutput">
<fileset dir="test">
<include name="**/Test*.java" />
</fileset>
</batchtest>
<formatter type="xml" />
<formatter type="plain" usefile="false" />
</junit>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${dist}" />
<mkdir dir="${dist}/lib" />
<copy flatten="true" todir="${dist}/lib">
<path>
<path refid="owllistener.classpath" />
</path>
</copy>
<jar destfile="${dist}/owllistener.jar">
<fileset dir="${output}/" excludes="**/Test.class" />
<fileset dir="conf" />
<restrict>
<name name="**/*.class" />
<archives>
<zips>
<fileset dir="${dist}/lib" />
</zips>
</archives>
</restrict>
<manifest>
<attribute name="Main-Class" value="tw.com.owllistener.network.Run" />
</manifest>
</jar>
</target>
<target name="synology" depends="dist">
<mkdir dir="${dist}/syn" />
<tar basedir="${dist}" destfile="${dist}/syn/package.tgz" includes="owllistener.jar" compression="gzip" />
<copy file="synology/INFO" todir="${dist}/syn" />
<tar destfile="${dist}/owllistener.spk">
<tarfileset dir="synology/scripts" filemode="755" prefix="scripts">
<include name="*"/>
</tarfileset>
<tarfileset dir="${dist}/syn">
<include name="INFO"/>
<include name="package.tgz"/>
</tarfileset>
</tar>
</target>
</project>