-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
214 lines (192 loc) · 8.16 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
<?xml version = "1.0" encoding = "utf-8"?>
<project name="ICD Utilities" default="dist" basedir=".">
<property environment="env"/>
<property name="protege.home" value="${env.PROTEGE_HOME}"/>
<property file="local.properties"/>
<property name="src" location="./src"/>
<property name="export.src" location="./export/src"/>
<property name="build" location="./build"/>
<property name="classes" location="${build}/classes"/>
<property name="plugins" location="${build}/plugins"/>
<property name="lib" location="./lib"/>
<property name="export.lib" location="./export/lib"/>
<property name="plugin_dist" value="edu.stanford.bmir.icd.misc"/>
<property name="pluginName" value="icd"/>
<property name="owl.path" value="edu.stanford.smi.protegex.owl"/>
<property name="protege.lib" location="${protege.home}/protege.jar"/>
<property name="protege.owl.lib" location="${protege.home}/plugins/${owl.path}/protege-owl.jar"/>
<property name="bio.refs.lib"
location="${protege.home}/plugins/edu.stanford.bmir.protegex.bp.ref/bioportalReference.jar"/>
<property name="lucene.lib"
location="${protege.home}/plugins/edu.stanford.smi.protegex.query.lucene/luceneQueryPlugin.jar"/>
<property name="lucene2.lib"
location="${protege.home}/plugins/edu.stanford.smi.protegex.query.lucene/lucene-core.jar"/>
<!--
# ********** Finding Protege Libraries. *************
-->
<target name="checkProtegeLibs">
<echo message="Using Protege Home = ${protege.home} to find protege jars"/>
<condition property="libs.found">
<and>
<available file="${protege.lib}" type="file"/>
<available file="${protege.owl.lib}" type="file"/>
<available file="${lucene.lib}" type="file"/>
<available file="${lucene2.lib}" type="file"/>
</and>
</condition>
<path id="project.classpath">
<pathelement location="${protege.lib}"/>
<pathelement location="${protege.owl.lib}"/>
<pathelement location="${lucene.lib}"/>
<pathelement location="${lucene2.lib}"/>
<fileset dir="${lib}"/>
<fileset dir="${export.lib}"/>
</path>
</target>
<target name="checkProtegeLibsAndReport" depends="checkProtegeLibs"
unless="libs.found">
<echo message="Missing protege libraries. You need to set "/>
<echo message="the PROTEGE_HOME environment variable to a"/>
<echo message="protege installation directory where the"/>
<echo message="appropriate plugins have been installed."/>
<echo message="Alternatively set the jar libs in local.properties (protege.lib=...)"/>
<echo message="Use the -v option to ant to see what jars are missing."/>
<fail message="missing protege libraries"/>
</target>
<!--
# ********** Finding Protege Libraries Done. *************
-->
<target name="init">
<tstamp>
<format property="build.time" pattern="MM/dd/yyyy hh:mm aa"/>
</tstamp>
<mkdir dir="${build}"/>
<mkdir dir="${classes}"/>
<mkdir dir="${plugins}"/>
<mkdir dir="${plugins}/${plugin_dist}"/>
</target>
<target name="compile" depends="init, checkProtegeLibsAndReport">
<javac srcdir="${src}"
destdir="${classes}"
debug="on"
includeAntRuntime="false">
<classpath refid="project.classpath"/>
</javac>
<javac srcdir="${export.src}"
destdir="${classes}"
debug="on"
includeAntRuntime="false">
<classpath refid="project.classpath"/>
</javac>
<copy todir="${classes}">
<fileset dir="${src}">
<include name="**/*"/>
<exclude name="**/*.java"/>
<exclude name="**/MANIFEST.MF"/>
<exclude name="**/manifest.mf"/>
</fileset>
</copy>
</target>
<target name="jar" depends="compile">
<copy tofile="${build}/manifest.mf"
file="src/META-INF/MANIFEST.MF" overwrite="true"/>
<manifest file="${build}/manifest.mf"
mode="update">
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${build.time}"/>
</manifest>
<jar jarfile="${plugins}/${plugin_dist}/${pluginName}.jar"
basedir="${classes}"
manifest="${build}/manifest.mf"/>
<copy todir="${plugins}/${plugin_dist}">
<fileset dir="${lib}" excludes="junit*.jar"/>
<fileset dir="${export.lib}" excludes="junit*.jar"/>
</copy>
<copy todir="${plugins}/${plugin_dist}" file="plugin.properties"/>
</target>
<target name="dist" depends="jar">
<copy todir="${plugins}/${plugin_dist}"
file="export/excel/template.xls"
overwrite="true"/>
<copy todir="${plugins}/${plugin_dist}"
file="export/resources/export_script.py"
overwrite="true"/>
<zip basedir="${plugins}"
includes="${plugin_dist}/**"
destfile="${build}/${pluginName}.zip"/>
</target>
<target name="update" depends="jar">
<fail message="set the protege.home variable to do an install">
<condition>
<not>
<isset property="protege.home"/>
</not>
</condition>
</fail>
<copy file="${plugins}/${plugin_dist}/${pluginName}.jar"
todir="${protege.home}/plugins/${plugin_dist}"/>
<copy file="./plugin.properties"
todir="${plugins}/${plugin_dist}"/>
</target>
<target name="install" depends="dist">
<fail message="set the protege.home variable to do an install">
<condition>
<not>
<isset property="protege.home"/>
</not>
</condition>
</fail>
<unzip src="${build}/${pluginName}.zip"
dest="${protege.home}/plugins"
overwrite="true"/>
</target>
<!-- Run targets -->
<target name="debug" depends="install">
<java fork="true" dir="${protege.home}"
classname="edu.stanford.smi.protege.Application">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8100,server=y,suspend=y"/>
<classpath>
<pathelement path="${protege.home}/protege.jar"/>
<pathelement path="${protege.home}/looks-2.1.3.jar"/>
<pathelement path="${protege.home}/unicode_panel.jar"/>
<fileset dir="./dbdrivers"/>
</classpath>
</java>
</target>
<target name="run" depends="install">
<java fork="true" dir="${protege.home}"
classname="edu.stanford.smi.protege.Application">
<classpath>
<pathelement path="${protege.home}/protege.jar"/>
<pathelement path="${protege.home}/looks-2.1.3.jar"/>
<pathelement path="${protege.home}/unicode_panel.jar"/>
<fileset dir="./dbdrivers"/>
</classpath>
</java>
</target>
<target name="SplitSpreadSheet" depends="jar">
<java fork="true"
classname="edu.stanford.bmir.icd.spreadsheet.Splitter">
<classpath>
<fileset dir="./lib"/>
</classpath>
</java>
</target>
<target name="InsertLabelsFromTermIds" depends="jar">
<java fork="true"
classname="edu.stanford.bmir.icd.bioportal.InsertLabelsFromTerms">
<classpath>
<pathelement location="${protege.lib}"/>
<fileset dir="${protege.home}/plugins/${owl.path}"/>
<fileset dir="${protege.home}/plugins/edu.stanford.bmir.protegex.bp.ref"/>
<fileset dir="./lib"/>
<pathelement location="${classes}"/>
</classpath>
<jvmarg value="-Xmx900M"/>
</java>
</target>
<target name="clean">
<delete dir="${build}"/>
</target>
</project>