forked from chms/jdotxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
102 lines (94 loc) · 3.65 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
<project name="jdotxt" default="jar" basedir=".">
<description>
another open source cross-platform GUI for todo.txt files
</description>
<!-- set global properties for this build -->
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<property name="lib.dir" location="libs"/>
<property name="build.dir" location="build"/>
<property name="build.main.dir" location="${build.dir}/main"/>
<property name="build.test.dir" location="${build.dir}/test"/>
<property name="build.test.reports.dir" location="${build.test.dir}/reports"/>
<property name="jar.dir" location="jar"/>
<property name="osx.dir" location="osx"/>
<property environment="env"/>
<fileset id="main.libs" dir="${lib.dir}">
<include name="jna-4.0.0.jar"/>
<include name="juniversalchardet-1.0.3.jar"/>
</fileset>
<fileset id="test.libs" dir="${lib.dir}">
<include name="hamcrest-core-1.3.jar"/>
<include name="junit-4.11.jar"/>
</fileset>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.main.dir}"/>
<mkdir dir="${build.test.dir}"/>
</target>
<target name="compile" depends="init" description="compile the source">
<javac encoding="UTF-8" includeantruntime="false" destdir="${build.main.dir}">
<src path="${src.dir}"/>
<classpath>
<fileset refid="main.libs"/>
</classpath>
</javac>
<copy todir="${build.main.dir}">
<fileset dir="${src.dir}" includes="**/*.png,**/*.properties,**/*.ttf"/>
</copy>
<javac encoding="UTF-8" includeantruntime="false" destdir="${build.test.dir}">
<src path="${test.dir}"/>
<classpath>
<pathelement location="${build.main.dir}"/>
<fileset refid="main.libs"/>
<fileset refid="test.libs"/>
</classpath>
</javac>
</target>
<target name="test" depends="compile" description="run unit tests">
<delete dir="${build.test.reports.dir}"/>
<mkdir dir="${build.test.reports.dir}"/>
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<pathelement location="${build.main.dir}"/>
<pathelement location="${build.test.dir}"/>
<fileset refid="main.libs"/>
<fileset refid="test.libs"/>
</classpath>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest fork="on" skipNonTests="true" todir="${build.test.reports.dir}">
<fileset dir="${build.test.dir}"/>
</batchtest>
</junit>
</target>
<target name="jar" depends="compile,test" description="generate the jar">
<mkdir dir="${jar.dir}"/>
<jar jarfile="${jar.dir}/jdotxt.jar" manifest="manifest">
<fileset dir="${build.main.dir}"/>
<zipgroupfileset refid="main.libs"/>
</jar>
</target>
<target name="osx" depends="jar">
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${lib.dir}/appbundler-1.0.jar"/>
<mkdir dir="${osx.dir}"/>
<bundleapp outputdirectory="${osx.dir}"
name="jdotxt"
displayname="jdotxt"
identifier="com.chschmid.jdotxt.Jdotxt"
shortversion="0.3.9"
applicationCategory="public.app-category.developer-tools"
mainclassname="com.chschmid.jdotxt.Jdotxt"
icon="${src.dir}/res/drawable/jdotxt.icns"
copyright="2015 Christian M. Schmid">
<classpath file="${jar.dir}/jdotxt.jar" />
</bundleapp>
</target>
<target name="clean" description="clean up">
<delete dir="${build.dir}"/>
<delete dir="${jar.dir}"/>
<delete dir="${osx.dir}"/>
</target>
</project>