forked from ontologyportal/sigmakee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
319 lines (288 loc) · 14.4 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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<project name="Sigma" default="all" basedir=".">
<target name="init">
<property name="app.name" value="sigma"/>
<property name="build.home" value="build"/>
<property name="build.classes" value="${build.home}/classes"/>
<property name="build.lib" value="${build.home}/lib"/>
<property environment="env"/>
<property name="tomcat.home" value="${env.CATALINA_HOME}"/>
<echo message="CATALINA_HOME is set to = ${env.CATALINA_HOME}"/>
<property name="sigma.home" value="${env.SIGMA_HOME}"/>
<property name="sigma.install.downloads" value="${sigma.home}/downloads"/>
<echo message="SIGMA_HOME is set to = ${env.SIGMA_HOME}"/>
<property name="kbs.home" value="${basedir}/../KBs" />
<echo message="KBs_HOME is set to = ${kbs.home}" />
<echo>Java Version via Ant: ${ant.java.version}</echo>
<echo>Java Version System Prop: ${java.version}</echo>
<property name="dist.home" value="${tomcat.home}/webapps"/>
<property name="deploy.home" value="${tomcat.home}/webapps/${app.name}"/>
<property name="deploy.classes" value="${deploy.home}/WEB-INF/classes"/>
<property name="deploy.lib" value="${deploy.home}/WEB-INF/lib"/>
<property name="deploy.jars" value="${deploy.home}/WEB-INF/lib"/>
<property name="dist.war" value="sigma.war"/>
<property name="javadoc.home" value="doc/api"/>
<property name="build.javadoc" value="${build.home}/${javadoc.home}"/>
<property name="debian.folder" value="native-installers/debian"/>
</target>
<target name="compile" depends="init" description="Compile the project and place in ${build.classes}.">
<mkdir dir="${build.classes}"/>
<javac destdir="${build.classes}" debug="on" optimize="on" deprecation="on" classpathref="compile.classpath">
<!-- classpath refid="core.classpath"/ -->
<src refid="core.sourcepath"/>
</javac>
<copy todir="${build.lib}">
<fileset dir="${basedir}/lib" />
</copy>
</target>
<target name="web_deploy" depends="compile,compile" description="Create the deploy structure and add the contents.">
<!-- Make the root. -->
<mkdir dir="${deploy.home}"/>
<!-- Delete the old code -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${deploy.home}"/>
<fileset dir="${tomcat.home}/work/Catalina/localhost/${app.name}"/>
</delete>
<!-- Copy all the *.jsp, *.xsl, *.html, pixmaps, etc. -->
<copy todir="${deploy.home}">
<fileset dir="web/jsp"/>
</copy>
<copy todir="${deploy.home}">
<fileset file="web/simple.css"/>
</copy>
<copy todir="${deploy.home}/pixmaps">
<fileset dir="web/pixmaps"/>
</copy>
<copy todir="${deploy.home}/lib">
<fileset file="${basedir}/lib/*.jar" />
<!-- fileset file="${basedir}/lib/IDV.jar" />
<fileset file="${basedir}/lib/antlr-2.7.5.jar" />
<fileset file="${basedir}/lib/mail.jar" />
<fileset file="${basedir}/lib/guava-15.0.jar" />
<fileset file="${basedir}/lib/junit-4.12.jar" />
<fileset file="${basedir}/lib/java-json.jar" />
<fileset file="${basedir}/lib/json-simple-1.1.1.jar" />
<fileset file="${basedir}/lib/TptpParser.jar" />
<fileset file="${basedir}/lib/owlapi-distribution-3.4.5.jar" />
<fileset file="${basedir}/lib/ClientHttpRequest.jar" / -->
</copy>
<!-- Create WEB-INF/classes/ and copy all the loose classes to it. -->
<mkdir dir="${deploy.classes}"/>
<copy todir="${deploy.classes}">
<fileset dir="${build.classes}"/>
</copy>
<!-- Create WEB-INF/lib/ and copy over the needed jar files. -->
<mkdir dir="${deploy.lib}"/>
<copy todir="${deploy.lib}">
<fileset dir="${basedir}/lib" />
</copy>
</target>
<target name="dist" depends="web_deploy" description="Create the *.war file and place in ${build.home}.">
<war warfile="${dist.home}/${dist.war}" webxml="web.xml">
<fileset dir="web/jsp"/>
<fileset file="web/simple.css"/>
<zipfileset dir="web/pixmaps" prefix="pixmaps"/>
<lib dir="${deploy.lib}"/>
<classes dir="${deploy.classes}"/>
</war>
</target>
<target name="api_doc" depends="init" description="Build the JavaDocs and place in ${build.javadoc}.">
<delete dir="${build.javadoc}"/>
<mkdir dir="${build.javadoc}"/>
<javadoc sourcepath="src/java" destdir="${build.javadoc}" author="true" version="true" use="true" windowtitle="Sigma API Specification" splitindex="true" packagenames="com.articulate.sigma.*">
<classpath refid="javadoc.classpath"/>
<classpath refid="compile.classpath"/>
<doctitle>Sigma API Specification</doctitle>
<header><![CDATA[<b>Sigma API Specification</b>]]></header>
<group title="Sigma" packages="com.articulate.sigma.*"/>
<group title="Sigma NLP" packages="com.articulate.sigma.nlp.*"/>
<group title="Sigma Semantic Rewriting" packages="com.articulate.sigma.semRewrite.*"/>
<group title="Sigma Date Number Units processing" packages="com.articulate.sigma.semRewrite.datesandnumber.*"/>
<group title="Sigma TPTPWorld" packages="TPTPWorld.*"/>
<group title="Sigma TPTP Parser" packages="tptp_parser.*"/>
</javadoc>
</target>
<!-- target name="all" depends="dist, api_doc" -->
<target name="all" depends="dist">
</target>
<taskdef name="deb" classname="com.googlecode.ant_deb_task.Deb" classpath="lib/ant/ant-deb-0.0.1.jar"/>
<taskdef name="aptrepo" classname="com.codemarvels.ant.aptrepotask.AptRepoTask" >
<classpath>
<fileset dir="lib/ant/apt-repo" >
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<target name="createDEB" depends="compile" description="Create the *.deb file and place in ${debian.folder}/output.">
<!-- clean up any existing files in temp-->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${debian.folder}/temp/sigmawebapp"/>
<fileset file="${debian.folder}/temp/sigma.war"/>
</delete>
<!-- create staging folder -->
<mkdir dir="${debian.folder}/temp/sigmawebapp"/>
<!-- Copy all the *.jsp, *.xsl, *.html, pixmaps, etc. -->
<copy todir="${debian.folder}/temp/sigmawebapp">
<fileset dir="web/jsp"/>
</copy>
<copy todir="${debian.folder}/temp/sigmawebapp">
<fileset file="web/simple.css"/>
</copy>
<copy todir="${debian.folder}/temp/sigmawebapp/pixmaps">
<fileset dir="web/pixmaps"/>
</copy>
<copy todir="${debian.folder}/temp/sigmawebapp/lib">
<fileset file="${basedir}/lib/*.jar" />
<!-- fileset file="${basedir}/lib/IDV.jar" />
<fileset file="${basedir}/lib/antlr-2.7.5.jar" />
<fileset file="${basedir}/lib/mail.jar" />
<fileset file="${basedir}/lib/guava-15.0.jar" />
<fileset file="${basedir}/lib/junit-4.12.jar" />
<fileset file="${basedir}/lib/java-json.jar" />
<fileset file="${basedir}/lib/json-simple-1.1.1.jar" />
<fileset file="${basedir}/lib/TptpParser.jar" />
<fileset file="${basedir}/lib/cos-multipart.jar" />
<fileset file="${basedir}/lib/owlapi-distribution-3.4.5.jar" / -->
</copy>
<!-- Create WEB-INF/classes/ and copy all the loose classes to it. -->
<mkdir dir="${debian.folder}/temp/sigmawebapp/WEB-INF/classes"/>
<copy todir="${debian.folder}/temp/sigmawebapp/WEB-INF/classes">
<fileset dir="${build.classes}"/>
</copy>
<!-- Create WEB-INF/lib/ and copy over the needed jar files. -->
<mkdir dir="${debian.folder}/temp/sigmawebapp/WEB-INF/lib"/>
<copy todir="${debian.folder}/temp/sigmawebapp/WEB-INF/lib">
<fileset dir="${basedir}/lib" />
</copy>
<!-- Create .WAR file. -->
<war warfile="${debian.folder}/temp/${dist.war}" webxml="web.xml">
<fileset dir="web/jsp"/>
<fileset file="web/simple.css"/>
<zipfileset dir="web/pixmaps" prefix="pixmaps"/>
<lib dir="${debian.folder}/temp/sigmawebapp/lib"/>
<classes dir="${debian.folder}/temp/sigmawebapp/WEB-INF/classes"/>
</war>
<!-- clean and create a package folder from template -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${debian.folder}/temp/package"/>
</delete>
<mkdir dir="${debian.folder}/temp/package"/>
<copy todir="${debian.folder}/temp/package">
<fileset dir="${debian.folder}/dependencies/files" />
</copy>
<!-- Copy .WAR file to staging webapps -->
<copy todir="${debian.folder}/temp/package/var/lib/tomcat7/webapps">
<fileset file="${debian.folder}/temp/${dist.war}" />
</copy>
<!-- Create KBs folder-->
<mkdir dir="${debian.folder}/temp/package/usr/share/sigma/KBs"/>
<!-- Copy KBs from the parallel project KBs -->
<copy todir="${debian.folder}/temp/package/usr/share/sigma/KBs">
<fileset dir="../KBs" />
</copy>
<!-- Create .deb package-->
<deb package="sigma"
todir="${debian.folder}/temp"
section="utils"
depends="tomcat7"
architecture="amd64"
priority="optional" postinst="${debian.folder}/dependencies/files/DEBIAN/postinst">
<version upstream="1.0"/>
<maintainer name="Adam Pease" email="Adam.Pease@ipsoft.com"/>
<description>Sigma 1.0
Sigma knowledge engineering system is an system for developing,
viewing and debugging theories in first order logic.
It works with Knowledge Interchange Format (KIF) and
is optimized for the Suggested Upper Merged Ontology (SUMO).
For details vist http://www.adampease.org/OP/
</description>
<tarfileset dir="${debian.folder}/temp/package">
</tarfileset>
</deb>
<mkdir dir="${debian.folder}/temp/repository"/>
<move todir="${debian.folder}/temp/repository">
<fileset dir="${debian.folder}/temp">
<include name="*.deb"/>
</fileset>
</move>
<aptrepo repoDir="${debian.folder}/temp/repository"/>
</target>
<target name="uploadRepository" depends="createDEB" >
<input message="SourceForge Username :" addproperty="sfusername"></input>
<input message="SourceForge Password :" addproperty="sfpassword" ></input>
<scp remoteTodir="${sfusername}@web.sourceforge.net:/home/project-web/sigmakee/htdocs/"
verbose="true"
password="${sfpassword}"
trust="true" >
<fileset dir="native-installers/debian/temp/repository"></fileset>
</scp>
</target>
<target name="install" depends="init">
<fail message="SIGMA_HOME needs to be set" unless="env.SIGMA_HOME" />
<copy todir="${sigma.home}/KBs">
<fileset dir="${kbs.home}" />
</copy>
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/Translations/language.txt" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/WordNetMappings/FirstNames.csv" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/WordNetMappings/sentiment.csv" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/WordNetMappings/stopwords.txt" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/WordNetMappings/wordFrequencies.txt" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/WordNetMappings/WordNetMappings30-noun.txt" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/WordNetMappings/WordNetMappings30-verb.txt" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/WordNetMappings/WordNetMappings30-adj.txt" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${kbs.home}/WordNetMappings/WordNetMappings30-adv.txt" />
<!-- copy wordnet -->
<untar dest="${sigma.install.downloads}" compression="gzip">
<url url="http://wordnetcode.princeton.edu/3.0/WordNet-3.0.tar.gz" />
</untar>
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/adj.exc" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/adv.exc" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/noun.exc" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/verb.exc" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/index.adj" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/index.adv" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/index.noun" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/index.sense" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/index.verb" />
<copy todir="${sigma.home}/KBs/WordNetMappings" file="${sigma.install.downloads}/WordNet-3.0/dict/cntlist" />
<get dest="${sigma.install.downloads}" src="http://nlp.stanford.edu/software/stanford-ner-2015-01-29.zip" usetimestamp="true" />
<unzip dest="${sigma.home}" src="${sigma.install.downloads}/stanford-ner-2015-01-29.zip" >
<patternset>
<include name="**/classifiers/english.muc.7class.distsim.crf.ser.gz" />
</patternset>
<mapper type="flatten"/>
</unzip>
<get dest="${sigma.install.downloads}" src="http://nlp.stanford.edu/software/stanford-corenlp-full-2015-01-29.zip" usetimestamp="true" />
<unzip dest="${sigma.install.downloads}" src="${sigma.install.downloads}/stanford-corenlp-full-2015-01-29.zip" >
<patternset>
<include name="**/stanford-corenlp-3.5.1-models.jar" />
</patternset>
<mapper type="flatten"/>
</unzip>
<unzip dest="${sigma.home}" src="${sigma.install.downloads}/stanford-corenlp-3.5.1-models.jar" >
<patternset>
<include name="edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz" />
</patternset>
<mapper type="flatten"/>
</unzip>
<!-- get dest="${sigma.install.downloads}" src="http://wwwlehre.dhbw-stuttgart.de/~sschulz/WORK/E_DOWNLOAD/V_1.8/E.tgz" usetimestamp="true" /-->
</target>
<path id="javadoc.classpath">
<pathelement path="classes:${basedir}/lib/cos.jar:"/>
</path>
<path id="core.sourcepath">
<pathelement path="src/java/com/articulate/sigma"/>
<pathelement path="src/java/com/articulate/sigma/nlp"/>
<pathelement path="src/java/com/articulate/sigma/semRewrite"/>
<pathelement path="src/java/com/articulate/sigma/semRewrite/datesandnumber"/>
<pathelement path="test/corpus/java/com/articulate/sigma"/>
<pathelement path="test/unit/java/com/articulate/sigma"/>
<pathelement path="test/integration/java/com/articulate/sigma"/>
<pathelement path="src/java/TPTPWorld"/>
<pathelement path="src/java/tptp_parser"/>
</path>
<path id="compile.classpath">
<fileset dir="${basedir}/lib">
<include name="*.jar"/>
</fileset>
</path>
</project>