forked from Ensembl/ensj-healthcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
242 lines (197 loc) · 7.34 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
<?xml version="1.0"?>
<!--
Ant build file for the EnsEBML HealthCheck tool.
-->
<project name="healthchecks" default="jar" basedir=".">
<property file = "buildfiles/build.configurable_testrunner.properties" />
<import file = "buildfiles/build.configurable_testrunner.xml" />
<property name="web.dir" location="${user.home}/public_html" />
<property name="web.javadoc.dir" location="${web.dir}/javadoc" />
<property name="web.mirror.dir" location="${doc}/external_web_pages" />
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<fileset dir="lib">
<include name="**/testng*.jar"/>
</fileset>
</classpath>
</taskdef>
<!-- ################################################################################## -->
<!-- Targets -->
<target name="init">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the directory structure -->
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
<mkdir dir="${test.class.dir}"/>
</target>
<!-- ################################################################################## -->
<target name="compile" depends="init" description="Compile the source ">
<javac srcdir="${src}" destdir="${build}" excludes="**/*Test.*" debug="true" debugLevel="lines,vars,source" includeantruntime="false">
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
<echo>Run "ant jar" so the compiled classes are used by the command line scripts.</echo>
</target>
<target name="compile-tests" depends="compile" description="Compile the test cases ">
<javac srcdir="${test.java.dir}" destdir="${test.class.dir}" debug="true" debugLevel="lines,vars,source" includeantruntime="false">
<classpath>
<dirset dir="${build}"/>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="test" depends="compile-tests" description="Run testng unit tests">
<path id="test-cp">
<pathelement location="${build}"/>
<pathelement location="${test.class.dir}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<echo level="info" message="See '${test.report.dir}/index.html' for test report information"/>
<echo level="info" message="If tests are not working try increasing verbosity of testng"/>
<testng classpathref="test-cp" outputdir="${test.report.dir}" verbose="1">
<classfileset dir="${test.class.dir}" includes="**/*Test.class"/>
</testng>
</target>
<target name="tests">
<antcall target="test"/>
</target>
<target
name = "eg_gui"
description = "Starts up the EG Gui for the healthchecks."
depends = "jar"
>
<java
classname = "org.ensembl.healthcheck.eg_gui.GuiStarter"
fork = "true"
failonerror = "true"
maxmemory = "1500m"
>
<arg line="
-Djava.util.logging.config.file=config/logger/logging.properties
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
" />
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
<pathelement path="build/"/>
<pathelement path="./target/dist/ensj-healthcheck.jar"/>
</classpath>
</java>
</target>
<!-- ################################################################################## -->
<target name="build-test-library" depends="compile">
<java classname="org.ensembl.healthcheck.BuildTestLibrary">
<arg value="${web.mirror.dir}/testlist_template.html" />
<classpath>
<pathelement path="${build}" />
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</java>
</target>
<!-- ################################################################################## -->
<target name="copy-resources" description="Copy images etc into appropriate directories">
<copy todir="${build}/org/ensembl/healthcheck/gui">
<fileset dir="${images}">
<include name="*.gif" />
<include name="*.png" />
<include name="*.jpg" />
</fileset>
</copy>
</target>
<!-- ################################################################################## -->
<target name="jar" depends="compile, copy-resources" description="generate ensj-healthcheck.jar">
<jar jarfile="${dist}/${name}.jar">
<fileset dir="${build}/" />
<fileset dir="${src}">
<include name="**/*.txt" />
</fileset>
</jar>
</target>
<!-- ################################################################################## -->
<!-- ################################################################################## -->
<target name="clean" description="Clean up">
<delete dir="${doc}/javadoc" />
<delete dir="${dist}" />
<delete dir="${build}" />
<delete dir="${test.class.dir}"/>
<delete dir="${test.report.dir}"/>
<delete>
<fileset dir=".">
<include name="**/*.class" />
</fileset>
</delete>
</target>
<!-- ################################################################################## -->
<target name="javadoc">
<javadoc destdir="${doc}/javadoc" author="true" version="true" use="true" windowtitle="EnsEMBL HealthCheck" doctitle="EnsEMBL HealthCheck">
<packageset dir="${src}" defaultexcludes="yes">
<include name="org/ensembl/healthcheck/**" />
<exclude name="org/ensembl/healthcheck/test/**" />
</packageset>
</javadoc>
</target>
<target name="javadoc-tar" depends="javadoc">
<tar tarfile="${dist}/${name}-javadoc.tar.gz" basedir="${doc}/javadoc" compression="gzip" />
</target>
<target name="javadoc-zip" depends="javadoc">
<zip destfile="${doc}/javadoc/${name}.zip" basedir="${doc}/javadoc" includes="**/*.html" excludes="**/*.zip" />
</target>
<target name="javadoc-web" depends="javadoc">
<copy todir="${web.javadoc.dir}">
<fileset dir="${doc}/javadoc">
<include name="**/*.html" />
</fileset>
</copy>
</target>
<!-- ################################################################################## -->
<!-- Execution targets to replace old run-*.sh -->
<!-- Runs the command-line healthchecks -->
<target name="run" description="Runs the command-line healthchecks" depends="jar">
<java classname="org.ensembl.healthcheck.TextTestRunner" fork="true" failonerror="true" maxmemory="1500m">
<arg line="${args}" />
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</java>
</target>
<!-- Check for matching database names -->
<target name="run-database-name-matcher" description="Check for matching database names" depends="jar">
<java classname="org.ensembl.healthcheck.DatabaseNameMatcher" fork="true" failonerror="true">
<arg line="${args}" />
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</java>
</target>
<!-- List all tests in a group -->
<target name="run-list-all-tests" description="List all tests in a group" depends="jar">
<java classname="org.ensembl.healthcheck.ListAllTests" fork="true" failonerror="true">
<arg line="${args}" />
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</java>
</target>
<!-- ################################################################################## -->
</project>