-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
190 lines (157 loc) · 5.3 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
<?xml version="1.0"?>
<!--
$Id: build.xml 2521 2011-02-10 20:15:13Z scott $
Copyright (C) 2007 Scott Martin
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version. The GNU Lesser General Public License is
distributed with this software in the file COPYING.
-->
<!--
Build file for Pep.
Targets:
prepare Creates destination directory for compiled classes.
document Generates Javadoc documentation for Pep source code.
compile Compiles Pep source code.
package Compiles Pep source code, creates pep.jar in the package/
directory.
release Archives the project for release.
test Runs Pep JUnit tests.
clean Deletes all files in the destination directory for classes.
-->
<project name="Pep" default="compile" basedir=".">
<property file="build.properties"/>
<description>Pep build file</description>
<path id="build.classpath">
<pathelement location="${lib.dir}/commons-cli-1.2.jar"/>
</path>
<!--
Prepare
Readies the build by creating destination directory for compilation.
-->
<target name="prepare">
<mkdir dir="${classes.dir}"/>
</target>
<!--
Document
Generates Javadoc API documentation to docs.dir.
-->
<target name="document">
<mkdir dir="${docs.dir}/api/"/>
<javadoc
packagenames="edu.osu.ling.pep.*"
sourcepath="${src.dir}"
classpathref="build.classpath"
destdir="${docs.dir}/api/"
windowtitle="${title} ${version} API Documentation"
overview="${etc.dir}/overview.html"
author="true"
version="true"
nohelp="true"
nodeprecated="true">
<doctitle><![CDATA[<h1>${title} ${version}: ${subtitle}</h1>]]></doctitle>
<header><![CDATA[${title} ${version} API Documentation]]></header>
<footer><![CDATA[${title}: ${subtitle}]]></footer>
<bottom><![CDATA[${title} API Documentation, Copyright © 2007
<a href="http://www.ling.osu.edu/~scott/">Scott Martin</a>
<p>Permission is granted to copy, distribute and/or modify this document
under the terms of the <a href="http://www.gnu.org/licenses/fdl-1.3.txt">GNU
Free Documentation License</a>, Version 1.3
or any later version published by the <a href="http://www.fsf.org/">Free
Software Foundation</a>;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the overview file.</p>]]></bottom>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
<link href="http://commons.apache.org/cli/api-release/"/>
</javadoc>
</target>
<!--
Compile
Compiles all (non-test) Pep source files.
-->
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="on"
classpathref="build.classpath"/>
</target>
<!--
Package
Creates a Java Archive containing all compiled Pep bytecode. The resulting
archive is executable because its manifest specifies the executable
class mainClass as its main class.
-->
<target name="package" depends="compile">
<mkdir dir="${package.dir}"/>
<jar jarfile="${package.dir}/${name}.jar">
<zipfileset src="${lib.dir}/commons-cli-1.2.jar" />
<metainf dir="${basedir}">
<include name="COPYING"/>
<include name="etc/grammar.xsd"/>
</metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${mainClass}"/>
</manifest>
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<exclude name="**/*Test.class"/>
<exclude name="**/*Fixture.class"/>
</fileset>
</jar>
</target>
<!--
Release
Creates an archive of the entire project, for release. The created
archive contains all source code, grammar files, test code, etc.
-->
<target name="release" depends="test,document,package">
<mkdir dir="${release.dir}"/>
<tar destfile="${release.dir}/${name}-${version}.tar.gz" longfile="gnu"
compression="gzip">
<tarfileset dir="../" mode="755">
<include name="${name}/bin/"/>
</tarfileset>
<tarfileset dir="../">
<include name="${name}/package/"/>
<include name="${name}/src/"/>
<include name="${name}/test/"/>
<include name="${name}/docs/"/>
<include name="${name}/samples/"/>
<include name="${name}/etc/*.xsd"/>
<include name="${name}/build.*"/>
<include name="${name}/README"/>
<include name="${name}/COPYING"/>
<include name="${name}/CHANGES"/>
</tarfileset>
</tar>
</target>
<!--
Test
Runs all JUnit tests in test.dir, first compiling the test source code.
-->
<target name="test" depends="compile">
<javac srcdir="${test.dir}" destdir="${classes.dir}" debug="on"/>
<junit printsummary="withOutAndErr" showoutput="true" haltonerror="true">
<classpath>
<pathelement location="${classes.dir}"/>
<pathelement path="${java.class.path}"/>
</classpath>
<batchtest>
<fileset dir="${test.dir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!--
Clean
Deletes all files beneath classes.dir.
-->
<target name="clean">
<delete>
<fileset dir="${classes.dir}">
<include name="**/*"/>
</fileset>
</delete>
</target>
</project>