-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-win32.xml
235 lines (211 loc) · 10.3 KB
/
build-win32.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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="build" name="relex">
<property name="VERSION" value="1.4"/>
<property name="REVISION" value="1.4.2"/>
<property name="DISCO_HOME" value="d:/work/disco/trunk"/>
<property name="PREFIX" value="${DISCO_HOME}/lib"/>
<property name="ALTPREFIX" value="${DISCO_HOME}/lib"/>
<property name="INSTALLDIR" value="/usr/local/share/java"/>
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.5"/>
<property name="source" value="1.5"/>
<path id="relex.classpath">
<pathelement location="bin"/>
<!-- Mandatory packages -->
<pathelement location="${PREFIX}/linkgrammar.jar"/>
<pathelement location="${PREFIX}/gnu-getopt.jar"/>
<pathelement location="${PREFIX}/jwnl.jar"/>
<pathelement location="${PREFIX}/jwnl-1.4rc2.jar"/>
<pathelement location="${PREFIX}/jwnl-1.3.3.jar"/>
<!-- Packages required by optional OpenNLP -->
<pathelement location="${PREFIX}/opennlp-tools-1.4.3.jar"/>
<pathelement location="${PREFIX}/maxent-2.5.2.jar"/>
<pathelement location="${PREFIX}/trove.jar"/>
<pathelement location="${PREFIX}/xercesImpl.jar"/>
<pathelement location="${PREFIX}/commons-logging.jar"/>
<!-- Mandatory packages -->
<pathelement location="${ALTPREFIX}/linkgrammar.jar"/>
<pathelement location="${ALTPREFIX}/gnu-getopt.jar"/>
<pathelement location="${ALTPREFIX}/jwnl.jar"/>
<pathelement location="${ALTPREFIX}/jwnl-1.4rc2.jar"/>
<pathelement location="${ALTPREFIX}/jwnl-1.3.3.jar"/>
<!-- Packages required by optional OpenNLP -->
<pathelement location="${ALTPREFIX}/opennlp-tools-1.4.3.jar"/>
<pathelement location="${ALTPREFIX}/maxent-2.5.2.jar"/>
<pathelement location="${ALTPREFIX}/trove.jar"/>
<pathelement location="${ALTPREFIX}/xercesImpl.jar"/>
<pathelement location="${ALTPREFIX}/commons-logging.jar"/>
</path>
<!-- Steps to take on initialization -->
<target name="init">
<mkdir dir="bin"/>
</target>
<!-- conditional compilation, check for OWL -->
<available classname="org.semanticweb.owl.model.OWLClass" classpathref="relex.classpath" property="OWL.present"/>
<target name="look-for-owl" unless="OWL.present">
<echo message="Will not build OWL output format; org.semanticweb.owl classes not found."/>
</target>
<!-- conditional compilation, check for OpenNLP -->
<available classname="opennlp.tools.sentdetect.SentenceDetector" classpathref="relex.classpath" property="OpenNLP.present"/>
<target name="look-for-opennlp" unless="OpenNLP.present">
<echo message="Will not build OpenNLP-based sentence detector; OpenNLP classes not found."/>
</target>
<!-- Create a java source file containing the version number by replacing @REVISION@ -->
<target name="build-version">
<echo message="Building RelEx version ${REVISION}"/>
<copy file="src/java/relex/Version.java.in"
tofile="src/java/relex/Version.java"
overwrite="yes">
<filterset>
<filter token="REVISION" value="${REVISION}"/>
</filterset>
</copy>
</target>
<target name="build-project" depends="init, build-version, look-for-owl, look-for-opennlp">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin"
source="${source}" target="${target}">
<src path="src/java"/>
<exclude name="**/OWLView.java" unless="OWL.present" />
<exclude name="**/DocSplitterOpenNLPImpl.java" unless="OpenNLP.present" />
<classpath refid="relex.classpath"/>
</javac>
</target>
<target name="build-tests" depends="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin"
source="${source}" target="${target}">
<src path="src/java_test"/>
<classpath refid="relex.classpath"/>
</javac>
</target>
<!-- misc build targets -->
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<!-- help -->
<target name="usage">
<echo message="RelEx build file (build.xml)"/>
<echo message=""/>
<echo message="Avaliable targets are:"/>
<echo message=""/>
<echo message=" build -- generate the relex.jar file (default)"/>
<echo message=" install -- install jar file in ${INSTALLDIR}"/>
<echo message=" test -- run test cases"/>
<echo message=" run -- run a demo of the parser"/>
<echo message=" dist -- create distribution (tar.gz file)"/>
<echo message=" clean -- remove temporary files created by build"/>
</target>
<target depends="usage" name="help"/>
<!-- cleanup -->
<target name="clean">
<delete dir="bin"/>
<delete dir="docs"/>
<delete file="relex-${REVISION}.jar"/>
</target>
<target name="cleanall" depends="clean"/>
<target name="realclean" depends="clean"/>
<!-- Run tests -->
<target name="test" depends="build-tests">
<java classname="relex.test.TestStanford" failonerror="true" fork="yes">
<jvmarg line="-Xmx1024m"/>
<jvmarg line="-Djava.library.path=/usr/lib:/usr/local/lib"/>
<classpath refid="relex.classpath"/>
<arg line=""/>
</java>
</target>
<!-- Build a jar file, for public consumption -->
<target name="jar" depends="build-project">
<jar basedir="bin" destfile="relex-${REVISION}.jar">
<manifest>
<attribute name="Implementation-Title" value="RelEx Semantic Relation Extractor"/>
<attribute name="Implementation-URL" value="http://opencog.org/wiki/RelEx"/>
<attribute name="Specification-Version" value="${VERSION}"/>
<attribute name="Implementation-Version" value="${REVISION}"/>
<attribute name="Main-Class" value="relex.RelationExtractor"/>
</manifest>
<fileset file="data/relex-penn-tagging-algs.txt" />
<fileset file="data/relex-semantic-algs.txt" />
<fileset file="data/relex-stanford-algs.txt" />
<fileset file="data/relex-tagging-algs.txt" />
<fileset file="data/frame/concept_vars.txt" />
<fileset file="data/frame/mapping_rules.txt" />
<fileset file="data/wordnet/file_properties.xml" />
<fileset file="data/sentence-detector/EnglishSD.bin.gz" />
</jar>
</target>
<!-- Install on user's system -->
<target name="install" depends="jar">
<mkdir dir="${INSTALLDIR}"/>
<copy file="relex-${REVISION}.jar" todir="${INSTALLDIR}"/>
<symlink link="${INSTALLDIR}/relex.jar"
resource="relex-${REVISION}.jar"
overwrite="true" failonerror="false"/>
</target>
<!-- tar file for general distribution -->
<target name="dist">
<tar destfile="r.tar">
<!-- the shell and perl scripts need to be executable -->
<tarfileset dir="." prefix="relex-${REVISION}/" excludes=".bzr*/**" mode="755">
<include name="batch-process.sh"/>
<include name="doc-splitter.sh"/>
<include name="link-grammar-server.sh"/>
<include name="opencog-server.sh"/>
<include name="parallel-relation-extractor.sh"/>
<include name="relation-extractor.sh"/>
<include name="src/perl/*.pl"/>
</tarfileset>
<tarfileset dir="." prefix="relex-${REVISION}/" excludes=".bzr*/**">
<include name="AUTHORS"/>
<include name="ChangeLog"/>
<include name="LICENSE"/>
<include name="README"/>
<include name="build.xml"/>
<include name="pom.xml"/>
<include name="test-corpus.txt"/>
<include name="data/frame/concept_vars.txt"/>
<include name="data/frame/mapping_rules.txt"/>
<include name="data/relex-penn-tagging-algs.txt"/>
<include name="data/relex-semantic-algs.txt"/>
<include name="data/relex-stanford-algs.txt"/>
<include name="data/relex-tagging-algs.txt"/>
<include name="data/sentence-detector/EnglishSD.bin.gz"/>
<include name="data/wordnet/file_properties.xml"/>
<include name="src/java/relex/anaphora/test-corpus.txt"/>
<include name="**/README"/>
<include name="**/*.java"/>
<include name="**/*.java.in"/>
</tarfileset>
</tar>
<gzip destfile="relex-${REVISION}.tar.gz" src="r.tar"/>
<delete file="r.tar"/>
</target>
<!-- make documentation -->
<target name="javadoc">
<mkdir dir="docs" />
<javadoc packagenames="relex.*"
sourcepath="src/java"
destdir="docs"
version="true"
splitindex="true"
noindex="false"
windowtitle="RelEx"
doctitle="RelEx Dependency Relation Extractor version $VERSION"
bottom="Copyright © 2005-2009 Mike Ross, Linas Vepstas and others."
/>
</target>
<!-- demo example run -->
<target name="run" depends="build-project">
<java classname="relex.RelationExtractor" failonerror="true" fork="yes">
<jvmarg line="-Xmx1024m"/>
<jvmarg line="-Djava.library.path=/usr/lib:/usr/local/lib"/>
<jvmarg line="-Drelex.pennalgpath=data/relex-penn-tagging-algs.txt"/>
<jvmarg line="-Drelex.semalgpath=data/relex-semantic-algs.txt"/>
<jvmarg line="-Drelex.sfalgpath=data/relex-stanford-algs.txt"/>
<jvmarg line="-Drelex.tagalgpath=data/relex-tagging-algs.txt"/>
<jvmarg line="-Dwordnet.configfile=data/wordnet/file_properties.xml"/>
<classpath refid="relex.classpath"/>
<arg line="-n 4 -l -t -f -s 'Alice wrote a book about dinosaurs for the University of California in Berkeley.'"/>
</java>
</target>
</project>