-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
executable file
·291 lines (234 loc) · 9.23 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!--
/*
* $Id: build.xml,v 1.10 2006/06/08 19:46:01 juanca Exp $
*
* Copyright (c) 1999-2006 Juancarlo Añez
* All rights reserved.
*
* $Id: build.xml,v 1.10 2006/06/08 19:46:01 juanca Exp $
*
* For usage rights please see the LICENSE.* files that
* come bundled with legal distributions of this resource.
*
* Fore more information please email Juancarlo Añez at:
*/
-->
<!-- ANT
This is an Ant script for building the JRCS library.
Ant is the Jakarta project's build tool.
You can get a copy of Ant from:
http://jakarta.apache.org/ant/
You'll need to also download the optional Ant tasks if you'll be
running JavaCC or the JUnit tests (more information below).
-->
<!-- Jakarta ORO
The Jakarta ORO Regexp library is used for RCS keyword management.
You can get a copy of Jakarta ORO from:
http://jakarta.apache.org/oro/
A copy of Jakarta ORO is included in the full distribution of this
library.
-->
<!-- JavaCC
The RCS parser is constructed using the JavaCC compiler compiler.
You can get a copy of JavaCC from:
http://www.metamata.com/javacc/
JavaCC is not distributable, so you must get a copy of it yourself
if you intend to use it.
Keep in mind that, as distributed, this library does not require
JavaCC to be compiled because all the JavaCC generated .java files
are included.
If you decide to use JavaCC, please adjust the "javacc.lib.dir"
property as needed. You'll also need to download the set of optional
tasks for Ant.
-->
<!-- JUnit
The library tests are written for the JUnit Testing Framework.
For distributions and documentation see:
http://www.junit.org/
You'll need to place a copy of junit.jar in Ant's lib directory
to run the tests.
-->
<project name="RCS archive parsing and manipulation in Java." default="test" basedir=".">
<!-- Allow any user specific values to override the defaults -->
<property file="${user.home}/build.properties" />
<!-- Allow user defaults for this project -->
<property file="build.properties" />
<property name="app.name" value="jrcs" />
<property name="version" value="//\\" />
<property name="src.dir" value="src" />
<property name="java.dir" value="${src.dir}/java" />
<property name="tests.dir" value="${src.dir}/test" />
<property name="lib.dir" value="lib" />
<property name="doc.dir" value="doc" />
<property name="javadoc" value="${doc.dir}/api" />
<property name="target.dir" value="bin" />
<property name="dist.dir" value="dist" />
<property name="classes" value="ant_classes" />
<property name="test.classes" value="test-classes" />
<property name="javacc.lib.dir" value="${javacc.home}/bin/lib" />
<!-- <property name="build.compiler" value="jikes" /> -->
<!-- <property name="build.compiler" value="classic"/> -->
<property name="rcs.jar" value="${target.dir}/org.suigeneris.jrcs.rcs-${version}.jar" />
<property name="diff.jar" value="${target.dir}/org.suigeneris.jrcs.diff-${version}.jar" />
<property name="tests.jar" value="${target.dir}/org.suigeneris.jrcs.tests-${version}.jar" />
<property name="junit.jar" value="${lib.dir}/junit-3.8.jar" />
<property name="libs" value="${diff.jar};${rcs.jar};${tests.jar};${junit.jar}" />
<property name="java.source" value="1.4" />
<property name="java.target" value="1.4" />
<available file="${javacc.lib.dir}/JavaCC.zip" property="javacc.present" />
<patternset id="non.java.sources">
<include name="**/*.*" />
<exclude name="**/*.java" />
</patternset>
<patternset id="compact">
<include name="${target.dir}/*.jar" />
<include name="${doc.dir}/**/*" />
<include name="LICENSE*" />
<include name="*.html" />
<include name="*.txt" />
<include name="*.xml" />
<include name="*.properties" />
<include name="*.css" />
<exclude name="**/TEST-*" />
</patternset>
<patternset id="full">
<patternset refid="compact" />
<include name="${src.dir}/**/*" />
<include name="${tests.dir}/**/*" />
</patternset>
<target name="prepare">
<mkdir dir="${classes}" />
<mkdir dir="${test.classes}" />
<mkdir dir="${target.dir}" />
<mkdir dir="${dist.dir}" />
<copy todir="${classes}">
<fileset dir="${java.dir}">
<patternset refid="non.java.sources" />
</fileset>
</copy>
<copy todir="${test.classes}">
<fileset dir="${tests.dir}">
<patternset refid="non.java.sources" />
</fileset>
</copy>
</target>
<target name="tidy">
<delete dir="${classes}" />
</target>
<target name="clean" depends="tidy">
<delete dir="${javadoc}" />
<delete dir="${dist.dir}" />
<delete dir="${target.dir}" />
<delete dir="${test.classes}" />
<delete file="${diff.jar}" />
<delete file="${rcs.jar}" />
<delete file="${tests.jar}" />
</target>
<target name="diff" depends="prepare">
<javac srcdir="${java.dir}" destdir="${classes}" classpath="${libs}" debug="on" optimize="on" deprecation="on" source="${java.source}" target="${java.target}">
<include name="**/jrcs/diff/**/*.java" />
<include name="**/jrcs/util/**/*.java" />
<exclude name="**/*Test*.class" />
</javac>
<jar jarfile="${diff.jar}" basedir="${classes}">
<include name="org/suigeneris/jrcs/diff/**" />
<include name="org/suigeneris/jrcs/util/**" />
<exclude name="**/*Test*.class" />
</jar>
</target>
<target name="parser" if="javacc.present" >
<javacc target="${java.dir}/org/suigeneris/jrcs/rcs/parse/ArchiveParser.jj"
outputdirectory="${java.dir}/org/suigeneris/jrcs/rcs/parse"
javacchome="${javacc.lib.dir}"
optimizetokenmanager="true" />
<echo message="parser built" />
</target>
<target name="rcs" depends="prepare,diff,parser">
<javac srcdir="${java.dir}" destdir="${classes}" classpath="${libs};classes" debug="on" optimize="on" deprecation="on" source="${java.source}" target="${java.target}">
<include name="**/jrcs/rcs/**/*.java" />
<exclude name="**/*Test*.class" />
</javac>
<jar jarfile="${rcs.jar}" basedir="${classes}">
<include name="org/suigeneris/jrcs/rcs/**" />
<exclude name="**/*Test*.class" />
</jar>
</target>
<target name="tests" depends="prepare,diff,rcs">
<javac srcdir="${tests.dir}" destdir="${test.classes}" classpath="${libs};${classes}" debug="on" optimize="on" deprecation="on" source="${java.source}" target="${java.target}">
<include name="**/*.java" />
</javac>
<jar jarfile="${tests.jar}" basedir="${test.classes}">
<include name="**/*" />
</jar>
</target>
<target name="libs" depends="diff,rcs">
</target>
<target name="test" depends="tests">
<junit printsummary="yes" haltonerror="true">
<classpath>
<pathelement path="${libs}" />
<pathelement location="${libs}/*.jar" />
</classpath>
<formatter type="plain" />
<test name="org.suigeneris.jrcs.AllTests" haltonfailure="yes" todir="${target.dir}">
<!-- <formatter type="plain" usefile="no" /> -->
</test>
</junit>
</target>
<target name="javadoc" depends="libs">
<mkdir dir="${javadoc}" />
<javadoc
packagenames="org.suigeneris.jrcs.*"
sourcepath="${java.dir}"
destdir="${javadoc}"
classpath="${libs};classes"
author="true"
version="true"
private="yes"
overview="${java.dir}/org/suigeneris/jrcs/overview.html"
windowtitle="${app.name} API"
doctitle="${app.name}"
bottom="Copyright © 1999-2006 Juancarlo Añez, Caracas, Venezuela.<br>
Some rights reserved<br>.
<a href='http://www.suigeneris.org/jrcs'>http://www.suigeneris.org/jrcs</a>">
</javadoc>
</target>
<target name="all" depends="prepare,libs,test,javadoc" />
<target name="compact.dist" depends="all">
<property name="tarfile" value="${dist.dir}/jrcs-${version}.tar" />
<delete file="${tarfile}" />
<tar tarfile="${tarfile}" basedir="${basedir}">
<patternset refid="compact" />
</tar>
<delete file="${tarfile}.gz" />
<gzip zipfile="${tarfile}.gz" src="${tarfile}" />
<delete file="${tarfile}" />
<property name="zipfile" value="${dist.dir}/jrcs-${version}.zip" />
<zip zipfile="${zipfile}" basedir="." update="false">
<patternset refid="compact" />
</zip>
</target>
<target name="full.dist" depends="all">
<mkdir dir="${dist.dir}" />
<property name="full.tarfile" value="${dist.dir}/jrcs-full-${version}.tar" />
<property name="full.zipfile" value="${dist.dir}/jrcs-full-${version}.zip" />
<delete file="${full.tarfile}" />
<tar tarfile="${full.tarfile}" basedir="${basedir}">
<include name="${src.dir}/**/*" />
<include name="${target.dir}/*" />
<include name="${doc.dir}/**/*" />
</tar>
<delete file="${full.tarfile}.gz" />
<gzip zipfile="${full.tarfile}.gz" src="${full.tarfile}" />
<delete file="${full.tarfile}" />
<zip zipfile="${full.zipfile}" basedir="${basedir}" update="false">
<patternset refid="full" />
</zip>
</target>
<target name="dist" depends="compact.dist,full.dist" />
<target name="changelog">
<cvschangelog destfile="changelog.xml" />
</target>
</project>