-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
257 lines (212 loc) · 9.29 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
<project name="USeq" basedir="." default="main">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<property file="build.properties"/>
<property environment="env"/>
<target name="clean">
<delete dir="${release.base.dir}"/>
</target>
<target name="master-jar" description="creates the master jar file with all code" depends="clean">
<!-- Copy base class files to the build directory -->
<echo>Unpacking base classes</echo>
<copy file="Misc/JavaxComOrgInfoNetClasses.zip" todir="${release.build.dir}"/>
<copy file="log4j.properties" todir="${release.build.dir}"/>
<unzip src="${release.build.dir}/JavaxComOrgInfoNetClasses.zip" dest="${release.build.dir}"/>
<move todir="${release.build.dir}">
<fileset dir="${release.build.dir}/JavaxComOrgInfoNetClasses"/>
</move>
<delete dir="${release.build.dir}/JavaxComOrgInfoNetClasses"/>
<delete dir="${release.build.dir}/__MACOSX"/>
<delete file="${release.build.dir}/JavaxComOrgInfoNetClasses.zip"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" encoding="ISO-8859-1">
<exclude name="**/AutoNovoaligner.java"/>
<exclude name="**/SNPComparator.java"/>
<classpath>
<fileset dir="${release.build.dir}" includes="**/*jar"/>
<fileset dir="${library.jar}" includes="**/*jar"/>
</classpath>
</javac>
<!-- Copy Driver -->
<macrodef name="copy-class">
<attribute name="jarpath"/>
<sequential>
<!-- <mkdir dir="${release.build.dir}/@{jarpath}"/> -->
<copy todir="${release.build.dir}/@{jarpath}">
<fileset dir="${classes.dir}/@{jarpath}">
<include name="**/*class"/>
<include name="**/*properties"/>
</fileset>
</copy>
</sequential>
</macrodef>
<!-- Load in jar names and copy them to the build directory -->
<echo>Copying class files</echo>
<for list="${class.select}" param="jar.location">
<sequential>
<copy-class jarpath="@{jar.location}"/>
</sequential>
</for>
<!-- Build the jar -->
<mkdir dir="${release.master.jar.dir}"/>
<jar destfile="${release.master.jar.dir}/bioToolsCodeLibrary.jar" basedir="${release.build.dir}" compress="false">
<manifest>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Implementation-Vendor" value="Implementation-Vendor: University of Utah Bioinformatics Shared Resource (http://bioserver.hci.utah.edu)"/>
<attribute name="Implementation-Version" value="USeq_${version}"/>
</manifest>
</jar>
<!-- Clean up build directory -->
<delete dir="${release.build.dir}"/>
</target>
<target name="create-docs" description="Creates helpfiles for each jar" depends="clean">
<!-- Help Driver -->
<macrodef name="help-class">
<attribute name="jarname"/>
<attribute name="jarpath"/>
<sequential>
<local name="helpoutput"/>
<exec dir="${classes.dir}" executable="java" failonerror="true" outputproperty="helpoutput" logError="true">
<arg value="-cp"/>
<arg value="../LibraryJars/*:."/>
<arg value="@{jarpath}/@{jarname}"/>
</exec>
<!-- Write menus to files -->
<concat destfile="${orig.doc.dir}/cmdLnMenus.html" append="true">
<![CDATA[<a href="#]]>@{jarname}<![CDATA[">]]>@{jarname}<![CDATA[</a><br>]]>
</concat>
<concat destfile="${orig.doc.dir}/temp.html" append="true">
<![CDATA[<a name="]]>@{jarname}<![CDATA["><pre>]]>${helpoutput}<![CDATA[</pre><br><p>]]>
</concat>
</sequential>
</macrodef>
<!-- Write header to the html document -->
<concat destfile="${orig.doc.dir}/cmdLnMenus.html">
<![CDATA[<html><head><title>USeq Command Line Menus ]]>${version}<![CDATA[
</title><style type=text/css>#rt{text-align:right; color: #000000; font-weight: bold}
#grBk {background-color: #CC9966;}TD {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:12;}H1 {color: #996633; font:arial; font-size:16;}H2 {color: #996633;
font:arial; font-size:12;}BODY {color:black; background-color:white; font-family:
Verdana, Arial, Helvetica, sans-serif; font-size:12;}A:link {text-decoration: none;
color: #000000; font-weight: bold} A:visited {text-decoration: none; color: #000000;
font-weight: bold} A:hover {text-decoration: none; color: #FFCC66; font-weight: bold}
A:active {text-decoration: none; color: #000000; font-weight: bold} </style></head><body>
<H1>Command Line Menus</H1> <p>
]]>
</concat>
<concat destfile="${orig.doc.dir}/temp.html">
<![CDATA[<br><p>]]>
</concat>
<!-- Load in jar names and create menu -->
<echo>Creating menus</echo>
<for list="${jar.select}" param="jar.location">
<sequential>
<propertyregex property="jar.path" input="@{jar.location}" regexp="^(.+)/(.+)$" select="\1" override="true"/>
<propertyregex property="jar.name" input="@{jar.location}" regexp="^(.+)/(.+)$" select="\2" override="true"/>
<if>
<equals arg1="${jar.name}" arg2="GWrap_GUI_ClickMe"/>
<then>
</then>
<else>
<echo>${jar.name}</echo>
<help-class jarpath="${jar.path}" jarname="${jar.name}"/>
</else>
</if>
</sequential>
</for>
<!-- Add footer to second html file -->
<concat destfile="${orig.doc.dir}/temp.html" append="true">
<![CDATA[</body></html>]]>
</concat>
<!-- Combine two html files -->
<concat destfile="${orig.doc.dir}/cmdLnMenus.html" append="true">
<filelist dir="${orig.doc.dir}" files="temp.html"/>
</concat>
<!-- Copy existing documentation to Doc directory -->
<copy todir="${release.doc.dir}" >
<fileset dir="${orig.doc.dir}"/>
</copy>
<!-- Clean up mess -->
<delete file="${orig.doc.dir}/temp.html"/>
</target>
<target name="worker-jars" description="Creates individual jar files" depends="clean,master-jar">
<!-- Worker Jar Driver -->
<macrodef name="packaging">
<attribute name="jarname"/>
<attribute name="jarpath"/>
<sequential>
<jar destfile="${release.worker.jar.dir}/@{jarname}" compress="false">
<manifest>
<attribute name="Main-Class" value="@{jarpath}/@{jarname}"/>
<attribute name="Class-Path" value="../LibraryJars/bioToolsCodeLibrary.jar"/>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Implementation-Version" value="USeq_${version}"/>
</manifest>
</jar>
</sequential>
</macrodef>
<!-- Gui Jar Driver -->
<macrodef name="gui-packaging">
<attribute name="jarname"/>
<attribute name="jarpath"/>
<sequential>
<jar destfile="${release.base.dir}/@{jarname}.jar" compress="false">
<manifest>
<attribute name="Main-Class" value="@{jarpath}/@{jarname}"/>
<attribute name="Class-Path" value="LibraryJars/bioToolsCodeLibrary.jar"/>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Implementation-Version" value="USeq_${version}"/>
</manifest>
</jar>
</sequential>
</macrodef>
<!-- Load in jar names and call Jar Driver -->
<for list="${jar.select}" param="jar.location">
<sequential>
<propertyregex property="jar.path" input="@{jar.location}" regexp="^(.+)/(.+)$" select="\1" override="true"/>
<propertyregex property="jar.name" input="@{jar.location}" regexp="^(.+)/(.+)$" select="\2" override="true"/>
<if>
<equals arg1="${jar.name}" arg2="GWrap_GUI_ClickMe"/>
<then>
<gui-packaging jarpath="${jar.path}" jarname="${jar.name}"/>
</then>
<else>
<packaging jarpath="${jar.path}" jarname="${jar.name}"/>
</else>
</if>
</sequential>
</for>
</target>
<target name="minimal-release" depends="clean,master-jar,worker-jars">
<zip destfile="${base.dir}/USeq_${version}.minimal.zip" basedir="${base.dir}" includes="${release.name}/**"/>
</target>
<target name="build-release" depends="clean,master-jar,worker-jars,create-docs">
<zip destfile="${release.base.dir}/SourceCode.zip" basedir="${src.dir}"/>
<zip destfile="${base.dir}/USeq_${version}.zip" basedir="${base.dir}" includes="${release.name}/**"/>
</target>
<target name="mosbruger-release" depends="worker-jars">
<!-- Mosbruger Specific configurations -->
<symlink action="delete" link="/Users/timmosbruger/AppsUSeq"/>
<echo>Building Source Code</echo>
<zip destfile="${release.base.dir}/SourceCode.zip" basedir="${src.dir}"/>
<echo>Creating Symlink to the applications in home</echo>
<symlink link="/Users/timmosbruger/AppsUSeq" resource="/Users/timmosbruger/Documents/eclipse4.3/USeqGH/Releases/${release.name}/Apps/"/>
<echo>Copying applications to server</echo>
<!-- <exec executable="rsync" dir="/Users/timmosbruger/Documents/eclipse4.3/USeq/Releases/">
<arg value="-r"/>
<arg value="${release.name}"/>
<arg value="${env.moab}:/home/u0855942/tim_scripts/"/>
</exec> -->
</target>
<target name="nix-release" depends="build-release">
<!-- Nix Specific configurations -->
<symlink action="delete" link="/Users/u0028003/USeqApps"/>
<echo>Creating Symlink to the applications in home</echo>
<symlink link="/Users/u0028003/USeqApps" resource="/Users/u0028003/Code/USeq/Releases/${release.name}/Apps/"/>
<!--<echo>Copying applications to server</echo>
<exec executable="rsync" dir="/Users/u0028003/Code/USeq/Releases/${release.name}/">
<arg value="-r"/>
<arg value="."/>
<arg value="[email protected]:/home/BioApps/USeq/"/>
</exec> -->
</target>
<target name="main" depends="build-release"/>
</project>