-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
150 lines (134 loc) · 6.87 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
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- del.icio.us Java API -->
<!-- ======================================================================= -->
<project name="delicious" default="compile" basedir=".">
<property name="name" value="delicious"/>
<property name="version" value="1.16"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="etc.dir" value="${basedir}/etc"/>
<property name="classes.dir" value="${basedir}/classes"/>
<property name="compile.dir" value="${basedir}/compile"/>
<property name="manifest.dir" value="${compile.dir}/META-INF"/>
<property name="javadoc.home" value="${basedir}/api"/>
<property name="distribution.dir" value="${basedir}/distribution"/>
<property name="delicious.jar" value="${distribution.dir}/${name}-${version}.jar"/>
<property name="source.zip" value="${distribution.dir}/${name}-${version}-source.zip"/>
<property name="javadocs.zip" value="${distribution.dir}/${name}-${version}-javadocs.zip"/>
<property name="bundle-with-dependencies.zip" value="${distribution.dir}/${name}-${version}-with-dependencies.zip"/>
<!-- =================================================================== -->
<!-- Classpath for compiling -->
<!-- =================================================================== -->
<path id="build.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- =================================================================== -->
<!-- Classpath for running -->
<!-- =================================================================== -->
<path id="run.classpath">
<path refid="build.classpath"/>
</path>
<!-- =================================================================== -->
<!-- Sourcepath for Javadoc -->
<!-- =================================================================== -->
<path id="javadoc.sourcepath">
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
</path>
<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean" description="Removes generated files">
<delete dir="${compile.dir}"/>
<delete dir="${classes.dir}"/>
<delete dir="${distribution.dir}"/>
<delete dir="${javadoc.home}"/>
</target>
<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare" description="Prepare the directories">
<tstamp/>
<mkdir dir="${distribution.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="prepare" description="Compiles the class files">
<mkdir dir="${compile.dir}"/>
<mkdir dir="${manifest.dir}"/>
<copy todir="${manifest.dir}">
<fileset dir="${etc.dir}">
<include name="**/*.tld"/>
</fileset>
</copy>
<javac source="1.4"
target="1.4"
srcdir="${src.dir}"
destdir="${compile.dir}"
debug="on"
deprecation="on"
optimize="on">
<classpath refid="build.classpath"/>
</javac>
<jar jarfile="${delicious.jar}" basedir="${compile.dir}" />
<delete dir="${compile.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Create the javadoc -->
<!-- =================================================================== -->
<target name="javadoc" depends="prepare" description="Generate javadocs for the source code">
<delete dir="${javadoc.home}"/>
<mkdir dir="${javadoc.home}"/>
<javadoc packagenames="*"
destdir="${javadoc.home}"
windowtitle="${name} ${version} API"
doctitle="${name} ${version} API">
<fileset dir="${src.dir}" defaultexcludes="yes">
<include name="**/*.java"/>
</fileset>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Create a source distribution -->
<!-- =================================================================== -->
<target name="create-source-distribution" depends="clean, prepare" description="Creates the source distribution">
<tstamp/>
<zip zipfile="${source.zip}">
<zipfileset dir="${basedir}">
<!-- Base files -->
<include name="build.xml"/>
<include name="changelog.txt"/>
<include name="LICENSE"/>
<!-- Source directories -->
<include name="src/**"/>
<include name="test/**"/>
<!-- Library directory -->
<include name="lib/"/>
</zipfileset>
</zip>
</target>
<!-- =================================================================== -->
<!-- Create a distribution with dependencies included -->
<!-- =================================================================== -->
<target name="create-bundle-with-dependencies" depends="clean, compile" description="Creates a distribution with the JAR file and required libraries">
<zip zipfile="${bundle-with-dependencies.zip}">
<zipfileset file="${delicious.jar}"/>
<zipfileset dir="${lib.dir}">
<include name="**/*.jar"/>
<exclude name="**/junit*.jar"/>
<exclude name="**/servlet*.jar"/>
</zipfileset>
</zip>
</target>
<!-- =================================================================== -->
<!-- Creates a ZIP of the javadocs for the website -->
<!-- =================================================================== -->
<target name="create-javadocs-archive" depends="javadoc" description="Creates a ZIP of the javadocs">
<zip zipfile="${javadocs.zip}" basedir="${javadoc.home}"/>
</target>
</project>