forked from ontologyportal/sigmakee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
158 lines (136 loc) · 5.95 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
<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}"/>
<property name="sigma.home" value="${env.SIGMA_HOME}"/>
<property name="sigma.install.downloads" value="${sigma.home}/downloads"/>
<property name="kbs.home" value="${sigma.home}/KBs" />
<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="dist.war" value="sigma.war"/>
<property name="javadoc.home" value="doc/api"/>
<property name="build.javadoc" value="${build.home}/${javadoc.home}"/>
<echo message="CATALINA_HOME is set to = ${env.CATALINA_HOME}"/>
<echo message="SIGMA_HOME is set to = ${env.SIGMA_HOME}"/>
<echo message="SIGMA_SRC is set to = ${env.SIGMA_SRC}"/>
<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>
</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" includeantruntime="false" classpathref="compile.classpath">
<src refid="core.sourcepath"/>
</javac>
<copy todir="${build.lib}">
<fileset dir="${basedir}/lib" />
</copy>
</target>
<target name="web_deploy" depends="compile" description="deploy code to sigma.war">
<!-- 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" />
</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>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${build.classes}"/> <!-- avoid problems with package name changes by deleting everything -->
</delete>
</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>
<jar destfile="${build.home}/sigmakee.jar">
<fileset dir="${deploy.classes}"/>
</jar>
</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 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">
<tstamp>
<format property="TODAY_US" pattern="yyyy-MM-dd HH:mm:ss:sss zzz" locale="en,US"/>
</tstamp>
<echo>the system date/time is ${TODAY_US}</echo>
</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">
<fileset dir="${kbs.home}/WordNetMappings" />
</copy>
<!-- 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">
<fileset dir="${sigma.install.downloads}/WordNet-3.0/dict" />
</copy>
</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/delphi"/>
<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>