forked from molgenis/molgenis_apps-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_xqtl_zip.xml
192 lines (169 loc) · 9.5 KB
/
build_xqtl_zip.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="build_xqtl_zip" default="create_zip" basedir=".">
<description>
Build a runnable ZIP (after extracting) with a standalone xQTL application.
</description>
<!-- Import xQTL script for paths -->
<import file="build_xqtl.xml" />
<!-- Path of Molgenis libs -->
<property name="mlibs" value="${molgenis.dir}/lib/"/>
<!-- Path of application libs -->
<property name="alibs" value="WebContent/WEB-INF/lib/"/>
<!-- Path of all unjarred and build content, to be ZIPed at the end -->
<property name="zipme" value="${build.molgenis_apps.dir}/zipme"/>
<!-- Path of dist folder where the resulting ZIP will be put -->
<property name="dist" value="dist"/>
<!-- Delete content of zipme dir -->
<target name="clean" description="Delete stuff">
<!-- create dir if it doesn't exist -->
<mkdir dir="${zipme}"/>
<!-- remove content -->
<delete includeemptydirs="true">
<fileset dir="${zipme}" includes="**/*" />
</delete>
</target>
<target name="unjar" description="Unjar all Molgenis and application jars">
<!-- Molgenis jars -->
<unjar src="${mlibs}hibernate/hibernate-jpa-2.0-api-1.0.0.Final.jar" dest="${zipme}" overwrite="false"/> <!-- JPA common -->
<unjar src="${mlibs}hibernate/hibernate3.jar" dest="${zipme}" overwrite="false"/> <!-- JPA common -->
<unjar src="${mlibs}hibernate/hibernate-search-3.4.1.Final.jar" dest="${zipme}" overwrite="false"/> <!-- JPA search-->
<unjar src="${mlibs}hibernate-validator-4.1.0.Final/validation-api-1.0.0.GA.jar" dest="${zipme}" overwrite="false"/> <!-- JPA validation-->
<unjar src="${mlibs}lucene-core-3.0.2.jar" dest="${zipme}" overwrite="false"/> <!-- JPA search -->
<unjar src="${mlibs}gridgain/spring-2.5.6.jar" dest="${zipme}" overwrite="false"/> <!-- Spring framework -->
<unjar src="${mlibs}ganymed-ssh2-build250.jar" dest="${zipme}" overwrite="false"/> <!-- SSH utils -->
<unjar src="${mlibs}ant-1.8.1.jar" dest="${zipme}" overwrite="false"/> <!-- ProjectHelper Molgenis.java -->
<unjar src="${mlibs}ant-apache-log4j.jar" dest="${zipme}" overwrite="false"/> <!-- Log4jListener Molgenis.java -->
<unjar src="${mlibs}commons-dbcp-1.2.1.jar" dest="${zipme}" overwrite="false"/> <!-- BasicDataSource -->
<unjar src="${mlibs}commons-fileupload-1.1.jar" dest="${zipme}" overwrite="false"/> <!-- HttpServletRequestTuple files -->
<unjar src="${mlibs}commons-io-2.4.jar" dest="${zipme}" overwrite="false"/> <!-- File I/O helpers -->
<unjar src="${mlibs}cxf-bundle-minimal-2.5.2.jar" dest="${zipme}" overwrite="false"/> <!-- CXFNonSpringJaxrsServlet -->
<unjar src="${mlibs}freemarker.jar" dest="${zipme}" overwrite="false"/> <!-- Template processing -->
<unjar src="${mlibs}jxl.jar" dest="${zipme}" overwrite="false"/> <!-- Excel import/export -->
<unjar src="${mlibs}log4j-1.2.15.jar" dest="${zipme}" overwrite="false"/> <!-- org.apache.log4j.Logger -->
<unjar src="${mlibs}mail.jar" dest="${zipme}" overwrite="false"/> <!-- Email utils -->
<unjar src="${mlibs}tar.jar" dest="${zipme}" overwrite="false"/> <!-- TarGz utils -->
<unjar src="${mlibs}testng-5.14.10.jar" dest="${zipme}" overwrite="false"/> <!-- TestNG -->
<unjar src="${mlibs}jsr311-api-1.1.1.jar" dest="${zipme}" overwrite="false"/> <!-- Rest API JSON -->
<unjar src="${mlibs}selenium-server-standalone-2.25.0.jar" dest="${zipme}" overwrite="false" /> <!-- Selenium webtests -->
<unjar src="${mlibs}hsqldb.jar" dest="${zipme}" overwrite="false"/> <!-- RUNTIME ??: HyperSQL database-->
<unjar src="${mlibs}commons-pool-1.5.2.jar" dest="${zipme}" overwrite="false"/> <!-- RUNTIME FrontController only??: GenericObjectPool -->
<unjar src="${mlibs}wsdl4j-1.6.2.jar" dest="${zipme}" overwrite="false"/><!-- RUNTIME AbstractServlet only??: WSDL Locator -->
<unjar src="${mlibs}quartz-1.6.0.jar" dest="${zipme}" overwrite="false"/><!-- Scheduling -->
<unjar src="${mlibs}gson-2.2.1.jar" dest="${zipme}" overwrite="false"/><!-- GSON for XrefService-->
<unjar src="${mlibs}tjws-1.99.jar" dest="${zipme}" overwrite="false"/><!-- Webserver -->
<unjar src="${mlibs}apache-poi-3.8.2/poi-3.8-20120326.jar" dest="${zipme}" overwrite="false"/><!-- Webserver -->
<unjar src="${mlibs}commons-email-1.2.jar" dest="${zipme}" overwrite="false"/><!-- Email service -->
<unjar src="${mlibs}apache-poi-3.8.2/poi-ooxml-3.8-20120326.jar" dest="${zipme}" overwrite="false"/><!-- Apache POI for big Excel (JQGrid impl.) -->
<unjar src="${mlibs}commons-lang3-3.1.jar" dest="${zipme}" overwrite="false"/><!-- Apache Lang for StringUtils (JQGrid impl.) -->
<unjar src="${mlibs}findbugs-2.0.1/lib/annotations.jar" dest="${zipme}" overwrite="false"/><!-- Findbugs -->
<unjar src="${mlibs}opencsv-2.3.jar" dest="${zipme}" overwrite="false"/><!-- OpenCSV -->
<!-- Application jars -->
<unjar src="${mlibs}mindterm.jar" dest="${zipme}" overwrite="false" /> <!-- xQTL: Mindterm SSH -->
<unjar src="${alibs}commons-math.jar" dest="${zipme}" overwrite="false" /> <!-- xQTL: Report builder statistics -->
<unjar src="${mlibs}simplecaptcha-1.2.1.jar" dest="${zipme}" overwrite="false" /> <!-- Auth captcha service -->
<unjar src="${alibs}JOpenId.jar" dest="${zipme}" overwrite="false" /> <!-- Auth OpenID login -->
</target>
<!-- Compile Molgenis on the unjarred content in zipme -->
<target name="compile_molgenis" description="Compile MOLGENIS on unjarred classes">
<!-- Run javac on molgenis, using the unjarred content as classpath -->
<javac srcdir="${molgenis.dir}/src" destdir="${zipme}" includeantruntime="false" debug="true" debuglevel="lines,vars,source">
<classpath path="{zipme}" />
</javac>
<!-- Copy the res folder to the build dir so it can be found by MolgenisResourceCopyGen -->
<copy todir="${zipme}/org/molgenis/framework/ui/res" verbose="true">
<fileset dir="${molgenis.dir}/src/org/molgenis/framework/ui/res" includes="**/*.*" />
</copy>
<!-- Copy all Freemarker templates anywhere in MOLGENIS too -->
<copy todir="${zipme}" verbose="true">
<fileset dir="${molgenis.dir}/src" includes="**/*.ftl" />
</copy>
</target>
<!-- Generate app on the unjarred content in zipme -->
<target name="generate_app" description="Generate the application">
<java classname="org.molgenis.Molgenis" fork="yes" failonerror="true">
<arg value="${app_properties}" />
<classpath path="${zipme}" />
</java>
</target>
<target name="compile_datatypes" description="Compile generated datatypes">
<javac srcdir="generated/java/org" excludes="**/*Decorator.java" destdir="${zipme}" includeantruntime="false" debug="true" debuglevel="lines,vars,source">
<classpath path="${zipme}" />
</javac>
</target>
<target name="compile_app" description="Compile application">
<pathconvert targetos="unix" property="app_src" refid="app.class.path" />
<javac srcdir="${app_src}:generated/java" destdir="${zipme}" includeantruntime="false" debug="true" debuglevel="lines,vars,source">
<classpath path="${zipme}" />
</javac>
</target>
<target name="compile_other" description="Compile other generated">
<javac srcdir="generated/java/app" destdir="${zipme}" includeantruntime="false" debug="true" debuglevel="lines,vars,source">
<classpath path="${zipme}" />
</javac>
</target>
<target name="copy_resources">
<pathconvert pathsep="/**/*," refid="app.class.path" property="app_fileset_pattern">
<regexpmapper from=".*/(.*/.*)" to="\1" />
</pathconvert>
<fileset dir="." id="app_fileset" includes="${app_fileset_pattern}/**/*">
<exclude name="**/*.java" />
</fileset>
<copy todir="${zipme}" verbose="true">
<fileset refid="app_fileset" />
<mapper type="regexp" from="^[-_a-zA-Z0-9]*/[-_a-zA-Z0-9]*/(.*)" to="\1" />
</copy>
<copy todir="${zipme}" verbose="true">
<fileset dir="generated/sql" includes="**/*.sql" />
</copy>
</target>
<target name="build">
<antcall target="clean" />
<antcall target="unjar" />
<antcall target="compile_molgenis" />
<antcall target="generate_app" />
<antcall target="compile_datatypes" />
<antcall target="compile_app" />
<antcall target="compile_other" />
<antcall target="copy_resources" />
</target>
<target name="package" description="Package the distribution into a ZIP">
<mkdir dir="${dist}" />
<!-- copy resources to ZIP specific locations -->
<copy todir="${zipme}/WebContent">
<fileset dir="WebContent">
<exclude name="META-INF/**" />
<exclude name="WEB-INF/**" />
<exclude name="animaldb/**" />
<exclude name="designgg/**" />
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="${zipme}/publicdata/xqtl">
<fileset dir="publicdata/xqtl">
<include name="**/*.*" />
</fileset>
</copy>
<!-- Windows/Unix startup scripts-->
<echo file="${zipme}/run.sh">java -Xmx512m boot/RunStandalone</echo>
<echo file="${zipme}/run.bat">java -Xmx512m boot/RunStandalone</echo>
<zip destfile="${dist}/xqtl_workbench.zip" basedir="${zipme}" update="false" />
</target>
<target name="create_zip">
<antcall target="download-jars" />
<antcall target="build" />
<antcall target="package" />
</target>
<!-- Unzip and run webtest -->
<target name="webtest" description="Start the Selenium test on unzipped app">
<unzip src="${dist}/xqtl_workbench.zip" dest="${dist}/xqtl_unzipped" />
<testng haltOnFailure="true">
<classfileset dir="${dist}/xqtl_unzipped" includes="**/XqtlSeleniumTest.class"/>
<classpath path="${dist}/xqtl_unzipped" />
</testng>
</target>
<!-- Wrapper to make the ZIP and run the webtest -->
<target name="create_zip_webtest">
<antcall target="create_zip" />
<antcall target="webtest" />
</target>
</project>