-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
155 lines (128 loc) · 4.79 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
143
144
145
146
147
148
149
150
151
152
153
154
155
<?xml version="1.0"?>
<project name="jutil" basedir="." default="jar">
<property name="source.dir.name" value="source"/>
<property name="bin.dir.name" value="classes"/>
<property name="lib.dir.name" value="lib"/>
<property name="doc.dir.name" value="doc"/>
<property name="apidoc.dir.name" value="api"/>
<property name="jar.file.name" location="org.sadun.util"/>
<property name="src" location="${basedir}/${source.dir.name}"/>
<property name="bin" location="${basedir}/${bin.dir.name}"/>
<property name="lib" location="${basedir}/${lib.dir.name}"/>
<property name="doc" location="${basedir}/${doc.dir.name}"/>
<property name="apidoc" location="${doc}/${apidoc.dir.name}"/>
<property name="jar.file" location="${jar.file.name}.jar"/>
<property name="api.doc.title" value="Cristiano Sadun's Java utility classes - API documentation"/>
<!--
Note: if you're getting an error
"taskdef class org.sadun.util.ant.Pack cannot be found"
you are missing pack.jar - which must be compiled separately by
using the buildpack.xml build file (by running ant -f buildpack.xml)
-->
<taskdef name="pack"
classname="org.sadun.util.ant.Pack"
classpath="${basedir}/pack.jar"/>
<!--
Note: if you're getting an error
"taskdef class org.sadun.util.ant.Version cannot be found"
you are missing version.jar - which must be compiled separately by
using the buildversion.xml build file (by running ant -f buildversion.xml)
-->
<taskdef name="version" classname="org.sadun.util.ant.Version"
classpath="version.jar"/>
<target name="init">
<mkdir dir="${bin}"/>
</target>
<!-- version and build info -->
<target name="version">
<version packageName="org.sadun.util"
versionObjectSourcePath="${src}"
versionObjectBinaryPath="${bin}"
versionInfoPath="${basedir}\.org.sadun.util1.13.0.versionInfo"
override='true'
major="1"
minor="13"
micro="0"/>
</target>
<!-- 1.4 compile -->
<target name="compile" depends="init, version">
<javac srcdir="${src}"
destdir="${bin}"
target="1.4"
source="1.4">
<classpath id="build.classpath">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<!-- jar the result -->
<target name="jar" depends="compile">
<jar destfile="${jar.file}"
basedir="${bin}"
includes="**/*.class"
index="yes"/>
</target>
<target name="javadoc">
<javadoc sourcepath="${src}"
destdir="${apidoc}"
author="yes"
doctitle="${api.doc.title}"
packagenames="*"
source="1.4"
header="Copyright (C) 1999,2004 dr. Cristiano Sadun"
footer="Copyright (C) 1999,2004 dr. Cristiano Sadun">
<classpath>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<!-- cleanup everything but source and nongenerated docs -->
<target name="clean">
<delete file="${bundle.file}"/>
<delete file="${libs.bundle.file}"/>
<delete>
<fileset dir="${bin}">
<include name="**/*.class"/>
</fileset>
</delete>
<delete>
<fileset dir="${apidoc}">
<include name="**/*.*"/>
</fileset>
</delete>
<delete file="${jar.file}"/>
</target>
<!-- create a file with the necessary libraries in one piece -->
<target name="bundlelib">
<property name="libs.bundle.file.name" location="org.sadun.util.libs_${version}"/>
<property name="libs.bundle.file" location="${libs.bundle.file.name}.zip"/>
<delete file="${libs.bundle.file}"/>
<zip destfile="${libs.bundle.file}">
<zipfileset dir="${lib}" prefix="${lib.dir.name}">
<include name="*.jar"/>
<include name="readme.txt"/>
</zipfileset>
</zip>
</target>
<!-- create the distribution bundle -->
<target name="bundle" depends="jar, javadoc, bundlelib">
<property name="bundle.file.name" location="org.sadun.util_${version}"/>
<property name="bundle.file" location="${bundle.file.name}.zip"/>
<delete file="${bundle.file}"/>
<zip destfile="${bundle.file}">
<zipfileset dir="${basedir}" includes="readme.txt"/>
<zipfileset dir="${basedir}" includes="build.xml"/>
<zipfileset dir="${basedir}" includes="buildpack.xml"/>
<zipfileset dir="${basedir}" includes="org.sadun.util.jar"/>
<zipfileset dir="${basedir}" includes="pack.jar"/>
<zipfileset dir="${doc}" prefix="${doc.dir.name}" includes="*.html"/>
<zipfileset dir="${apidoc}" prefix="${doc.dir.name}/${apidoc.dir.name} " includes="**/*.*"/>
<zipfileset dir="${src}" prefix="${source.dir.name}" includes="**/*.java"/>
<zipfileset dir="${src}" prefix="${source.dir.name}" includes="**/package.html"/>
</zip>
</target>
</project>