This repository has been archived by the owner on Aug 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
build_wormqtl.xml
160 lines (137 loc) · 6.52 KB
/
build_wormqtl.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
<project name="wormqtl">
<!-- this name is used to name the war file -->
<property name="app_name" value="wormqtl" />
<!-- this holds all the settings for the generator -->
<property name="app_properties" value="apps/wormqtl/org/molgenis/wormqtl/wormqtl.properties"/>
<!-- this determines what handwritten modules should be loaded -->
<path id="app.class.path">
<pathelement location="apps/${app_name}" />
<pathelement location="modules/_deprecated" />
<pathelement location="apps/xqtl" />
<pathelement location="modules/datamodel" />
<pathelement location="modules/auth" />
<pathelement location="modules/file" />
<pathelement location="modules/import" />
<pathelement location="modules/webserver" />
<pathelement location="modules/settings" />
<pathelement location="modules/pheno" />
<pathelement location="modules/search" />
<pathelement location="modules/matrix" />
<pathelement location="modules/feedback" />
<pathelement location="modules/xgap" />
<pathelement location="modules/decorators/core" />
<pathelement location="modules/decorators/auth" />
<pathelement location="modules/decorators/pheno" />
<pathelement location="modules/decorators/data" />
<pathelement location="publicdata" />
</path>
<!-- import all tasks from build_common: clean, generate, compile, test, war, standalone-jar -->
<import file="build_common.xml" />
<!-- Delete HSQL database -->
<target name="deletedb" description="Delete generated and build content">
<mkdir dir="hsqldb" />
<delete includeemptydirs="true">
<fileset dir="hsqldb" includes="**/*" />
</delete>
</target>
<!-- Remove anonymous permissions, essentially creating a private version -->
<target name="makePrivate" description="Switch to private mode">
<!--java maxmemory="4g" classname="org.molgenis.wormqtl.header.MakeWormQTLPrivate" fork="yes" failonerror="true">
<arg value="${username}"/>
<arg value="${password}"/>
<classpath>
<path refid="molgenis.classpath" />
<path location="${build.molgenis.dir}" />
<path location="${build.molgenis_apps.dir}" />
</classpath>
</java-->
<copy file="apps/wormqtl/org/molgenis/wormqtl/header/HomePagePrivate.ftl" tofile="apps/wormqtl/org/molgenis/wormqtl/header/HomePage.ftl" overwrite="true"/>
</target>
<!-- Custom generate with a few extra tasks -->
<target name="generate" depends="update-eclipse">
<!-- clean generated folders -->
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${output_src}" excludes=".gitignore"/>
<fileset dir="${output_sql}" excludes=".gitignore"/>
<fileset dir="${output_ccp}" excludes=".gitignore"/>
</delete>
<mkdir dir="${output_src}" />
<mkdir dir="${output_sql}" />
<!-- check if the molgenis project is where it is to be expected, in ../molgenis/ -->
<condition property="dir.exists">
<available file="${molgenis.dir}" type="dir" />
</condition>
<!-- check if molgenis is compiled into ${build.dir}, otherwise compile now -->
<javac srcdir="${molgenis.dir}/src" destdir="${build.molgenis.dir}" nowarn="on" debug="true">
<classpath refid="molgenis.classpath" />
</javac>
<!-- Copy WormQTL specific application footer, before copy of resources to build dir -->
<copy file="apps/wormqtl/org/molgenis/wormqtl/header/WormApplicationView.ftl" tofile="../molgenis/src/org/molgenis/framework/ui/ApplicationView.ftl" overwrite="true"/>
<!-- copy resources to build dir -->
<copy todir="${build.molgenis.dir}">
<fileset dir="${molgenis.dir}/src" includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico,**/*.js,**/*.css,**/*.jpg,**/*.png,**/*.gif,**/*.ftl" />
</copy>
<!-- call the generator -->
<java classname="org.molgenis.Molgenis" fork="yes" failonerror="true">
<classpath refid="molgenis.classpath" />
<classpath refid="app.class.path" />
<arg value="${app_properties}" />
</java>
<!-- copy all ftl files from module folders-->
<!-- concat all elements of app_path together separated by /**/*, -->
<pathconvert property="app_path" refid="app.class.path" pathsep="/**/*," dirsep="/">
<map from="${basedir}/" to="" />
</pathconvert>
<echo message="copying ftl files from ${app_path} to ${build.dir}" />
<fail unless="app_path">app.class.path is not set</fail>
<copy todir="${build.molgenis_apps.dir}">
<!-- watch the trailing /**/*.ftl"-->
<fileset dir="." includes="${app_path}/**/*" excludes="**/*.java" />
<!-- cut the two leading directories from path -->
<mapper type="regexp" from="^[-_a-zA-Z0-9]*[/\\][-_a-zA-Z0-9]*[/\\](.*)" to="\1" />
<!--cutdirsmapper dirs="2"/-->
</copy>
<!-- copy sql and other resources from generate sql -->
<copy todir="${build.molgenis_apps.dir}" verbose="true">
<fileset dir="${output_sql}" includes="**/*.sql" erroronmissingdir="false"/>
<fileset dir="${output_src}" includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico" />
</copy>
<!-- copy source.R from generated to build -->
<copy todir="${build.molgenis_apps.dir}" verbose="true">
<fileset dir="${output_src}" includes="**/*.R" />
</copy>
<!-- Copy persistence.xml to rigth location if it's specified in *.properties as persistence_xml_location-->
<antcall target="copy-persistence.xml" />
<!-- Copy contact and about pages into place -->
<copy file="WebContent/clusterdemo/wormqtl/wormqtl_contact.html" tofile="WebContent/wormqtl_contact.html" overwrite="true"/>
<copy file="WebContent/clusterdemo/wormqtl/wormqtl_about.html" tofile="WebContent/wormqtl_about.html" overwrite="true"/>
<!-- Copy walkthrough document to downloadable location -->
<copy file="apps/wormqtl/org/molgenis/wormqtl/help/walkthrough.docx" tofile="WebContent/walkthrough.docx" overwrite="true"/>
<!-- block webspiders -->
<antcall target="add_robotstxt" />
</target>
<!-- Custom run with more memory -->
<target name="run" description="Start the application">
<java maxmemory="4g" classname="boot.RunStandalone" fork="yes" failonerror="true">
<classpath>
<path refid="molgenis.classpath" />
<path location="${build.molgenis.dir}" />
<path location="${build.molgenis_apps.dir}" />
</classpath>
</java>
</target>
<!--
Custom runOn with more memory
Usage: ant -f build_wormqtl.xml runOn -Dport=9000
-->
<target name="runOn" description="Start the application">
<java maxmemory="4g" classname="boot.RunStandalone" fork="yes" failonerror="true">
<arg value="${port}"/>
<classpath>
<path refid="molgenis.classpath" />
<path location="${build.molgenis.dir}" />
<path location="${build.molgenis_apps.dir}" />
</classpath>
</java>
</target>
</project>