forked from semanticvectors/semanticvectors
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
189 lines (167 loc) · 6.64 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
<?xml version="1.0"?>
<!DOCTYPE project>
<!-- DEPRECATION WARNING. THIS ANT BUILD IS LIVING ALONGSIDE THE MAVEN BUILD AT THE MOMENT.
THE MAVEN BUILD IS THE CANONICAL ONE AND THE ANT BUILD WILL BE PHASED OUT. -->
<!--
To make external JARs (e.g. Lucene, junit) available to this build,
you can do any of the following:
* add them to the CLASSPATH environment variable
* set the environment variable SEMVEC_LIBDIR to the directory that
contains them
* create a file build.properties and specify the directory that
contains the JARs with a line "libdir=directorypath"
* create a directory with the name "lib" in the current directory
and copy or link the JAR files into that directory
-->
<project name="pitt semantic vectors" default="build-all" basedir=".">
<!-- Version number convention is that release versions are X.even_number,
development versions are X.next_odd_number. When you make a release,
you should increment the next_odd_number to the next even number,
make the release, and then increment again to next_odd_number and check
in. This way when people check out from svn, they always get the
most recent development version. -->
<property name="version" value="5.9"/>
<property file="build.properties" />
<property environment="env"/>
<condition property="envclasspath" value="${env.CLASSPATH}" else=".">
<isset property="env.CLASSPATH"/>
</condition>
<condition property="libdir" value="${env.SEMVEC_LIBDIR}">
<isset property="env.SEMVEC_LIBDIR"/>
</condition>
<condition property="libdir" value="./lib" else=".">
<available file="./lib"/>
</condition>
<property name="basedir" value="."/>
<property name="builddir" value="${basedir}/target"/>
<property name="buildclassesdir" value="${builddir}/classes"/>
<property name="distdir" value="${basedir}/dist"/>
<property name="distname" value="semanticvectors-${version}"/>
<property name="docdir" value="${basedir}/target/site/apidocs/"/>
<property name="srcdir" value="${basedir}/src/main/java"/>
<property name="testdir" value="${basedir}/src/test/java"/>
<property name="testtmpdir" value="${basedir}/tmp"/>
<property name="extdir" value="${basedir}/src-ext"/>
<property name="dist-doc.dir" value="./../javadoc/latest-stable-test"/>
<path id="compile.classpath">
<fileset dir="${libdir}">
<include name="*.jar" />
</fileset>
<pathelement location="${buildclassesdir}"/>
<pathelement path="${envclasspath}"/>
</path>
<path id="run.classpath">
<path refid="compile.classpath"/>
<pathelement location="${builddir}/${distname}.jar"/>
</path>
<target name="init">
<mkdir dir="${docdir}"/>
<mkdir dir="${builddir}"/>
<mkdir dir="${buildclassesdir}"/>
<mkdir dir="${distdir}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${srcdir}"
classpathref="compile.classpath"
destdir="${buildclassesdir}"
debug="on"
includeantruntime="false"
/>
</target>
<target name="doc" depends="init,compile">
<javadoc sourcepath="${srcdir}"
packagenames="pitt.search.semanticvectors,pitt.search.semanticvectors.vectors,pitt.search.lucene"
destdir="${docdir}"
classpathref="compile.classpath"
author="true"
use="true"
/>
</target>
<target name="jardist" depends="compile,init">
<jar destfile="${builddir}/${distname}.jar"
basedir="${buildclassesdir}"/>
</target>
<target name="tardist" depends="init">
<tar destfile="${distdir}/${distname}-src.tar">
<tarfileset dir="${basedir}"
prefix="${distname}"
preserveLeadingSlashes="true"
includes="src/pitt/,thirdparty/">
<include name="build.xml"/>
<include name="AUTHORS"/>
<include name="LICENSE"/>
</tarfileset>
</tar>
<gzip zipfile="${distdir}/${distname}-src.tar.gz"
src="${distdir}/${distname}-src.tar"/>
</target>
<target name="zipdist" depends="init">
<zip destfile="${distdir}/${distname}-src.zip">
<zipfileset dir="${basedir}"
prefix="${distname}"
includes="src/pitt/,thirdparty/">
<include name="build.xml"/>
<include name="AUTHORS"/>
<include name="LICENSE"/>
</zipfileset>
</zip>
</target>
<target name="clean" depends="init">
<delete dir="${builddir}"/>
<delete dir="${distdir}"/>
<delete dir="${testtmpdir}"/>
<delete dir="positional_index"/>
<delete dir="predication_index"/>
</target>
<!-- Compile and run tests. -->
<!-- Tests do not currently ship with standard distributions; to
compile and run tests, check out test dir from the svn repository.
You will also need to install junit (www.junit.org) -->
<target name="compile-tests" depends="compile">
<javac srcdir="${testdir}"
classpathref="compile.classpath"
destdir="${buildclassesdir}"
debug="on"
includeantruntime="false"
/>
</target>
<target name="run-unit-tests" depends="compile-tests,jardist">
<junit fork="yes" haltonfailure="yes">
<test name="pitt.search.semanticvectors.AllTests" />
<formatter type="plain" usefile="false" />
<classpath>
<path refid="run.classpath"/>
</classpath>
</junit>
</target>
<target name="run-integration-tests" depends="compile-tests,jardist">
<!-- This test configuration includes some quick and dirty filesystem
operations to make sure that the working dir starts and finishes empty. -->
<delete dir="positional_index"/>
<delete dir="predication_index"/>
<java fork="true"
classpathref="run.classpath"
classname="pitt.search.semanticvectors.integrationtests.RunTests"/>
<!--
<delete dir="${testworkingdir}"/>
<mkdir dir="${testworkingdir}"/>
-->
</target>
<!-- Just compile and run all the tests! -->
<target name="testall" depends="run-unit-tests,run-integration-tests"/>
<!-- Compile development extensions ... this is a temporary solution until
we have a good way of shipping development extensions without
introducing dependencies on any more libraries to install. -->
<target name="compile-ext" depends="compile">
<javac srcdir="${extdir}/pitt"
destdir="${buildclassesdir}"
debug="on"
classpathref="compile.classpath"
includeantruntime="false"
/>
</target>
<!-- Build all -->
<!-- Does not compile and run tests (see compile-tests target above). -->
<target name="build-all"
depends="compile, doc, jardist, tardist, zipdist"/>
</project>