forked from GMOD/Apollo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
259 lines (222 loc) · 11.5 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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?xml version="1.0" encoding="utf-8" ?>
<project name="Web Apollo" default="usage" basedir=".">
<!-- Arguments to gwtc and devmode targets -->
<property name="gwt.args" value=""/>
<!-- Configure path to GWT SDK -->
<property name="gwt.sdk" location="gwt-sdk"/>
<path id="project.class.path">
<pathelement location="target/classes/gwt"/>
<pathelement location="lib/gwt"/>
<pathelement location="${gwt.sdk}/gwt-user.jar"/>
<pathelement location="${gwt.sdk}/gwt-dev.jar"/>
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar"/>
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar"/>
<!--<pathelement location="${gwt.sdk}/restygwt-1.4.jar"/>-->
<fileset dir="lib/gwt" includes="**/*.jar"/>
<!-- Add any additional non-server libs (such as JUnit) here -->
</path>
<!--<target name="libs" description="Copy libs to WEB-INF/lib">-->
<!--<mkdir dir="war/WEB-INF/lib" />-->
<!--<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />-->
<!--<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet-deps.jar" />-->
<!--<!– Add any additional server libs that need to be copied –>-->
<!--</target>-->
<target name="javac" description="Compile java source to bytecode">
<mkdir dir="target/classes/gwt"/>
<javac srcdir="src/gwt" includes="**" encoding="utf-8"
destdir="target/classes/gwt"
includeantruntime="false"
source="1.7" target="1.7" nowarn="true"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
<copy todir="target/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="gwtc" depends="javac" description="GWT compile to JavaScript (production mode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler" maxmemory="256m">
<classpath>
<pathelement location="src/gwt"/>
<path refid="project.class.path"/>
</classpath>
<arg line="-war"/>
<arg value="web-app"/>
<arg line="-style"/>
<arg value="PRETTY"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="org.bbop.apollo.gwt.Annotator"/>
</java>
</target>
<target name="devmode" depends="copy-resources,javac"
description="Run development mode (pass -Dgwt.args=-nosuperDevMode to fallback to classic DevMode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode" maxmemory="1g">
<classpath>
<pathelement location="src/gwt"/>
<path refid="project.class.path"/>
<pathelement location="${gwt.sdk}/gwt-codeserver.jar"/>
</classpath>
<arg value="-startupUrl"/>
<arg value="http://localhost:8080/apollo/annotator/"/>
<!--<arg value="/apollo/annotator/"/>-->
<arg line="-war"/>
<arg value="web-app"/>
<!-- Additional arguments like -style PRETTY, -logLevel DEBUG or -nosuperDevMode -->
<arg line="${gwt.args}"/>
<arg value="org.bbop.apollo.gwt.Annotator"/>
<arg value="org.bbop.apollo.gwt.Annotator"/>
</java>
</target>
<target name="build" depends="gwtc" description="Build this project"/>
<target name="clean" description="Cleans this project">
<delete dir="${apollo.jbrowse.directory}"/>
<exec executable="grails" failifexecutionfails="" errorproperty="">
<arg value="clean"/>
</exec>
</target>
<target name="clean-all" depends="clean" description="Cleans this project">
<delete dir="web-app/WEB-INF/deploy" failonerror="false"/>
<delete dir="web-app/annotator" failonerror="false"/>
<delete dir="target/classes/gwt" failonerror="false"/>
</target>
<property name="apollo.webapp.directory" location="web-app" relative="true" basedir="."/>
<property name="apollo.jbrowse.directory" location="${apollo.webapp.directory}/jbrowse"/>
<property name="apollo.client.directory" location="${basedir}/client/apollo" basedir="." relative="true"/>
<property name="apollo.plugin.directory" location="${apollo.jbrowse.directory}/plugins/WebApollo"/>
<property name="jbrowse.download.directory" location="jbrowse-download"/>
<property name="jbrowse.webapp.test.file" location="${apollo.jbrowse.directory}/src/dojo/dojo.js"/>
<property name="webapp.apollo.plugin.test.file" location="${apollo.plugin.directory}/js/main.js"/>
<property name="webapp.apollo.plugin.uncompressed.test.file"
location="${apollo.plugin.directory}/js/main.js.uncompressed.js"/>
<property name="scripts.directory" location="scripts"/>
<property name="jbrowse.git.test.file" location="${jbrowse.download.directory}/src/dojo/dojo.js"/>
<property name="jbrowse.github" value="https://github.com/gmod/jbrowse"/>
<property name="jbrowse.version" value="dev"/>
<property name="jbrowse.perl.dependency.test.file" value="bin/flatfile-to-json.pl"/>
<property name="jbrowse.release.version" value="1.11.6-release"/>
<available file=".git" type="dir" property="git.present"/>
<available file="${jbrowse.git.test.file}" type="file" property="jbrowse.git.present"/>
<available file="${jbrowse.webapp.test.file}" type="file" property="jbrowse.webapp.installed"/>
<available file="${webapp.apollo.plugin.test.file}" type="file" property="apollo.plugin.installed"/>
<available file="${jbrowse.perl.dependency.test.file}" type="file" property="jbrowse.perl.installed"/>
<available file="${webapp.apollo.plugin.uncompressed.test.file}" type="file" property="jbrowse.precompiled"/>
<target name="build.jbrowse" description="Build JBrowse using the build/Makefile">
<exec executable="sh" failifexecutionfails="false">
<arg value="-c"/>
<arg line="'ulimit -n 1000; cd ${jbrowse.download.directory} && make -f build/Makefile release-notest'"/>
</exec>
</target>
<target name="unoptimized" description="unoptimized" depends="git.clone,copy.apollo.plugin.jbrowse">
<copy todir="${apollo.jbrowse.directory}">
<fileset dir="${jbrowse.download.directory}">
<not>
<filename name="sample_data/**"/>
</not>
</fileset>
</copy>
<delete dir="${apollo.jbrowse.directory}/.git"/>
<echo>${jbrowse.download.directory}</echo>
</target>
<target name="release" description=""
depends="clean,git.clone,copy.apollo.plugin.jbrowse,build.jbrowse,install.jbrowse.perl">
<copy file="${jbrowse.download.directory}/JBrowse-${jbrowse.version}.zip" todir="${basedir}"/>
<exec executable="unzip" failifexecutionfails="false" errorproperty="">
<arg value="JBrowse-${jbrowse.version}.zip"/>
</exec>
<move todir="${apollo.jbrowse.directory}">
<fileset dir="JBrowse-${jbrowse.version}">
<not>
<filename name="sample_data/**"/>
</not>
</fileset>
</move>
<delete file="JBrowse-${jbrowse.version}.zip"/>
<delete dir="JBrowse-${jbrowse.version}"/>
</target>
<target name="debug" description=""
depends="clean,git.clone,copy.apollo.plugin.jbrowse,build.jbrowse">
<copy file="${jbrowse.download.directory}/JBrowse-${jbrowse.version}-dev.zip" todir="${basedir}"/>
<exec executable="unzip" failifexecutionfails="false" errorproperty="">
<arg value="JBrowse-${jbrowse.version}-dev.zip"/>
</exec>
<move todir="${apollo.jbrowse.directory}">
<fileset dir="JBrowse-${jbrowse.version}-dev"/>
</move>
<delete file="JBrowse-${jbrowse.version}-dev.zip"/>
<delete dir="JBrowse-${jbrowse.version}-dev"/>
</target>
<target name="git.clean" description="Remove all unstaged files from ${basedir}">
<exec executable="git" failifexecutionfails="false" errorproperty="">
<arg value="clean"/>
<arg value="-fdx"/>
</exec>
</target>
<target name="git.clone" description="Clone git repository." unless="jbrowse.git.present">
<exec executable="git" failifexecutionfails="false" errorproperty="">
<arg value="clone"/>
<arg value="--recursive"/>
<arg value="${jbrowse.github}"/>
<arg value="${jbrowse.download.directory}"/>
</exec>
<exec executable="git" failifexecutionfails="false" errorproperty="" dir="${jbrowse.download.directory}">
<arg value="checkout"/>
<arg value="tags/${jbrowse.release.version}"/>
</exec>
</target>
<target name="usage">
<exec executable="./apollo" failifexecutionfails="false" errorproperty=""/>
</target>
<target name="install.jbrowse.perl" description="Install jbrowse." if="jbrowse.git.present"
unless="jbrowse.perl.installed">
<exec executable="./install_jbrowse.sh" failifexecutionfails="true" failonerror="true"
errorproperty="jbrowse-fail">
<arg value="${jbrowse.download.directory}"/>
</exec>
</target>
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
<target name="setup-jbrowse" unless="jbrowse.webapp.installed">
<antcall target="git.clone"/>
<antcall target="copy.apollo.plugin.jbrowse"/>
<echo>Will be setting up jbrowse</echo>
<delete dir="${apollo.jbrowse.directory}"/>
<copy todir="${apollo.jbrowse.directory}">
<fileset dir="${jbrowse.download.directory}">
<not>
<filename name="sample_data/**"/>
</not>
</fileset>
</copy>
<antcall target="install.jbrowse.perl"/>
</target>
<target name="copy.apollo.plugin.jbrowse">
<echo>copying plugin to jbrowse git ...</echo>
<copy todir="${jbrowse.download.directory}/plugins/WebApollo" failonerror="true">
<fileset dir="${apollo.client.directory}"/>
</copy>
</target>
<target name="copy.apollo.plugin.webapp" unless="jbrowse.precompiled" if="jbrowse.webapp.installed"
description="Copy client into webapp plugin directory.">
<echo>Copying WebApollo plugin to jbrowse webapp ...</echo>
<copy todir="${apollo.jbrowse.directory}/plugins/WebApollo" failonerror="true">
<fileset dir="${apollo.client.directory}"/>
</copy>
</target>
<target name="copy-resources"
depends="copy.apollo.plugin.webapp,setup-jbrowse"
description="This is called externally by shell script.">
</target>
</project>