build.xml
6.34 KB
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
<!-- $Id: build.xml 138 2013-09-10 10:02:43Z wyldfire $ -->
<!-- Copyright (C) 2007 Ryan McDonald -->
<project default="compile" basedir=".">
<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="init">
<tstamp/>
<property name="Name" value="MSTParser"/>
<property name="name" value="mstparser"/>
<property name="year" value="2013"/>
<property name="version" value="0.5.1"/>
<echo message="----------- ${Name} ${version} [${year}] ------------"/>
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="on"/>
<property name="src.dir" value="./src/main/java"/>
<property name="lib.dir" value="./lib"/>
<property name="packages" value="mstparser.*"/>
<property name="build.dir" value="./output"/>
<property name="build.dest" value="./output/classes"/>
<property name="build.javadocs" value="./docs/api"/>
<filter token="year" value="${year}"/>
<filter token="version" value="${version}"/>
<filter token="date" value="${TODAY}"/>
<filter token="log" value="true"/>
<filter token="verbose" value="true"/>
<path id="build.classpath">
<fileset dir="${lib.dir}/">
<include name="*.jar"/>
</fileset>
</path>
</target>
<!-- =================================================================== -->
<!-- Help on usage -->
<!-- =================================================================== -->
<target name="usage">
<echo message=""/>
<echo message=""/>
<echo message="MST Parser build file"/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=" Available targets are:"/>
<echo message=""/>
<echo message=" package --> generates the mstparser.jar file"/>
<echo message=" compile --> compiles the source code (default)"/>
<echo message=" javadoc --> generates the API documentation"/>
<echo message=" clean --> cleans up the compilation directory"/>
<echo message=""/>
<echo message=" See the comments inside the build.xml file for more details."/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=""/>
</target>
<!-- =================================================================== -->
<!-- Prepares the build directories -->
<!-- =================================================================== -->
<target name="prepare" depends="init">
<!-- create directories -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dest}"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile"
depends="prepare"
description="compiles the source code (default)">
<javac srcdir="${src.dir}"
destdir="${build.dest}"
debug="${debug}"
deprecation="${deprecation}"
classpathref="build.classpath"
optimize="${optimize}">
<!-- <compilerarg line="-Xlint:unchecked"/> -->
</javac>
</target>
<!-- =================================================================== -->
<!-- Creates the class package -->
<!-- =================================================================== -->
<target name="package"
depends="compile"
description="generates the mstparser.jar file">
<jar jarfile="${build.dir}/${name}.jar">
<fileset dir="${build.dest}" includes="**"/>
</jar>
</target>
<!-- =================================================================== -->
<!-- Creates the release file -->
<!-- =================================================================== -->
<target name="release" depends="clean,cleandocs">
<tar tarfile="${name}-${version}-src.tar"
basedir="../"
includes="${name}/**"
excludes="**/CVS **/*forest testbed/my*" />
<gzip src="${name}-${version}-src.tar"
zipfile="../${name}-${version}-src.tgz" />
<delete file="${name}-${version}-src.tar" />
</target>
<!-- =================================================================== -->
<!-- Creates the homepage -->
<!-- =================================================================== -->
<target name="homepage"
depends="init,javadoc"
description="generates the API documentation">
<tar tarfile="${name}-homepage.tar"
basedir="./docs/"
includes="**"
excludes="**/CVS" />
<gzip src="${name}-homepage.tar"
zipfile="${build.dir}/${name}-homepage.tgz" />
<delete file="${name}-homepage.tar" />
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadoc" depends="prepare">
<mkdir dir="${build.javadocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${src.dir}"
destdir="${build.javadocs}"
author="true"
version="true"
use="true"
splitindex="true"
noindex="false"
windowtitle="${name}"
doctitle="The ${Name} API v${version}"
bottom="Copyright © ${year} Ryan McDonald and Jason Baldridge. All Rights Reserved."
/>
</target>
<!-- =================================================================== -->
<!-- Cleans targets -->
<!-- =================================================================== -->
<target name="clean"
depends="init"
description="cleans up the directory">
<delete dir="${build.dir}"/>
<delete file="${lib.dir}/${name}.jar" />
</target>
<target name="cleandocs" depends="init" description="cleans up the API docs directory">
<delete dir="${build.javadocs}"/>
</target>
</project>
<!-- End of file -->