-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.xml
128 lines (88 loc) · 3.89 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
<project name="jarbundler" default="jar" basedir=".">
<property name="version" value="3.4.0-SNAPSHOT"/>
<property name="description" value="ANT task for creating macOS application bundles"/>
<!-- File names -->
<property name="jarbundler.jar" value="${ant.project.name}-${version}.jar" />
<property name="release.zip" value="${ant.project.name}.zip" />
<property name="release.tar" value="${ant.project.name}.tar" />
<!-- Needs to reference this in order to compile -->
<!-- This path works only for OS X, Windows, and Linux must redefine -->
<property name="ant.jar" value="/Developer/Java/Ant/lib/ant.jar" />
<target name="compile" description="Compile the classes">
<mkdir dir="classes"/>
<javac srcdir="core/src" destdir="classes" source="1.6" target="1.6"
classpath="${ant.jar}" deprecation="yes" includeAntRuntime="yes"/>
</target>
<target name="jar" depends="compile" description="Create JAR file">
<mkdir dir="build"/>
<tstamp/>
<jar jarfile="build/${jarbundler.jar}" basedir="classes">
<manifest>
<attribute name="Version" value="${version}"/>
<attribute name="Description" value="${description}"/>
<attribute name="Build-Date" value="${TODAY}"/>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
</target>
<target name="javadocs" depends="compile" description="Create JarBundler API">
<mkdir dir="javadoc"/>
<javadoc destdir="javadoc" classpath="${ant.jar}">
<package name="net.sourceforge.jarbundler.*"/>
<sourcepath location="src"/>
</javadoc>
</target>
<target name="release" depends="jar" description="Create zip and tar.gz files">
<ant dir="./examples" target="clean" inheritAll="false"/>
<mkdir dir="release"/>
<mkdir dir="release/dist"/>
<copy todir="release">
<fileset dir="dox"/>
</copy>
<!-- Make this file easy to find in the distribution -->
<move file="build/${jarbundler.jar}" tofile="${jarbundler.jar}"/>
<zip destfile="release/dist/${release.zip}">
<zipfileset prefix="${ant.project.name}-${version}/" dir="${basedir}" excludes="CVS">
<include name="LICENSE.TXT"/>
<include name="dox/**"/>
<include name="build.xml"/>
<include name="src/**"/>
<include name="examples/**"/>
<include name="${jarbundler.jar}"/>
</zipfileset>
</zip>
<tar destfile="release/dist/${release.tar}">
<tarfileset prefix="${ant.project.name}-${version}/" dir="${basedir}" excludes="CVS">
<include name="LICENSE.TXT"/>
<include name="dox/**"/>
<include name="build.xml"/>
<include name="src/**"/>
<include name="examples/**"/>
<include name="${jarbundler.jar}"/>
</tarfileset>
</tar>
<!-- Compress the tar -->
<gzip src="release/dist/${release.tar}" zipfile="release/dist/${release.tar}.gz"/>
<!-- Remove the intermediate tar -->
<delete quiet="true" file="release/dist/${release.tar}" />
<!-- Move the product back -->
<move file="${jarbundler.jar}" tofile="build/${jarbundler.jar}"/>
</target>
<target name="simple" depends="jar" description="Build a simple example application">
<ant dir="./examples" target="simple" inheritAll="false">
<property name="jarbundler.jar" value="${basedir}/build/${jarbundler.jar}" />
</ant>
</target>
<target name="complex" depends="jar" description="Build a complex example application">
<ant dir="./examples" target="complex" inheritAll="false">
<property name="jarbundler.jar" value="${basedir}/build/${jarbundler.jar}" />
</ant>
</target>
<target name="clean" description="Clean up">
<delete dir="classes"/>
<delete dir="build"/>
<delete dir="javadoc"/>
<delete dir="release"/>
<ant dir="examples" target="clean" inheritAll="false"/>
</target>
</project>