-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelease.xml
253 lines (217 loc) · 11.6 KB
/
release.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
<?xml version="1.0"?>
<project name="goby-release" basedir="." default="release">
<import file="${basedir}/buildsupport/build.xml"/>
<property file="${config}/release.properties"/>
<property name="use-git" value="true"/>
<!-- the default revision uses the current date and time -->
<property name="defaultrevision" value="stable"/>
<tstamp>
<format property="exportdate" pattern="yyyyMMddHHmmss"/>
</tstamp>
<target name="init" depends="getrevision, gettag">
<property name="exportdir" value="tmp-${tag}"/>
<property name="releasedir" value="release-goby_${tag}"/>
<property name="label" value="${tag}"/>
<mkdir dir="${releasedir}"/>
<property name="srcfile" value="${releasedir}/goby_${tag}-src.zip"/>
<property name="cpp-srcfile" value="${releasedir}/goby_${tag}-cpp.zip"/>
<property name="depsfile" value="${releasedir}/goby_${tag}-deps.zip"/>
<property name="apidocfile" value="${releasedir}/goby_${tag}-apidoc.zip"/>
<property name="datafile" value="${releasedir}/goby_${tag}-data.zip"/>
<property name="gobyfile" value="${releasedir}/goby_${tag}-goby.zip"/>
<property name="srcUrl" value="https://${svnhost}/public/svn/campagnelab/goby/branches/2.0RC2"/>
<property name="tagUrl" value="https://${svnhost}/public/svn/campagnelab/goby/tags/${tag}"/>
</target>
<target name="getrevision" unless="revision" description="Get the SVN revision/Git branch to use for the release">
<input message="Enter a revision for the build:"
addproperty="revision"
defaultvalue="${defaultrevision}"/>
<echo level="debug" message="revision is ${revision}"/>
</target>
<target name="gettag" unless="tag" description="Get the tag to use for the release">
<!-- the default tag uses the current date and time -->
<property name="defaulttag" value="goby_${exportdate}"/>
<input message="Enter a tag for the build:"
addproperty="tag"
defaultvalue="${defaulttag}"/>
<echo level="debug" message="tag is ${tag}"/>
</target>
<target name="tag" depends="tag-git,tag-svn" description="Tag the current trunk release in SVN"/>
<target name="tag-git" if="use-git" depends="init" unless="nocopy"
description="Tag the current trunk release in SVN">
<echo level="info" message="Tagging current directory with ${tag}"/>
<git command="tag">
<args>
<arg value="${tag}"/>
</args>
</git>
</target>
<target name="tag-svn" depends="init" unless="nocopy" description="Tag the current trunk release in SVN"
if="use-svn">
<echo level="info" message="Tagging current directory with ${tag}"/>
<svn>
<copy message="${tag}" srcUrl="${srcUrl}"
destUrl="${tagUrl}" revision="${revision}"/>
</svn>
</target>
<target name="export" depends="export-git,export-svn" unless="noexport"
description="Export a tagged version of the source code"/>
<target name="export-git" if="use-git" depends="init" unless="noexport"
description="Export a tagged version of the source code">
<available property="exportdirexists" file="${exportdir}" type="dir"/>
<fail if="exportdirexists" message="${basedir}/${exportdir} already exists."/>
<mkdir dir="${exportdir}/${tag}"/>
<echo level="info" message="Exporting using tag: ${tag}"/>
<!-- Now copy the modules -->
<copy todir="${exportdir}/${tag}/buildsupport">
<fileset dir="buildsupport" includes="**/*"/>
<fileset dir="buildsupport" excludes=".git"/>
</copy>
<copy todir="${exportdir}/${tag}/testsupport">
<fileset dir="testsupport" includes="**/*"/>
<fileset dir="testsupport" excludes=".git"/>
</copy>
<!-- get the tagged version from git -->
<git-export revision="${revision}" destinationDirectory="${exportdir}/${tag}"/>
<!-- Create a "version" file which contains the release number -->
<writeln file="${exportdir}/${tag}/VERSION.txt" message="${tag}" append="false"/>
</target>
<target name="export-svn" if="use-svn" depends="init" unless="noexport"
description="Export a tagged version of the source code">
<available property="exportdirexists" file="${exportdir}" type="dir"/>
<fail if="exportdirexists" message="${basedir}/${exportdir} already exists."/>
<mkdir dir="${exportdir}"/>
<echo level="info" message="Exporting using tag: ${tag}"/>
<!-- get the tagged version from svn -->
<svn>
<export srcUrl="${tagUrl}" destPath="${exportdir}/${tag}"/>
</svn>
<!-- Remove any files that should not be included in the formal release -->
<!-- NOTE: These files should probably be on a branch or something -->
<delete dir="${exportdir}/${tag}">
<include name="src/org/campagnelab/goby/algorithmic/data/AnnotationRPKM.java"/>
<include name="src/org/campagnelab/goby/modes/AggregatePeaks*"/>
<include name="src/org/campagnelab/goby/modes/AnnotationPenaltyMode*"/>
<include name="src/org/campagnelab/goby/modes/CountsArchiveToUnionPeaksAnnotationMode*"/>
</delete>
<!-- Create a "version" file which contains the release number -->
<writeln file="${exportdir}/${tag}/VERSION.txt" message="${tag}" append="false"/>
</target>
<target name="release" description="Tag and release build"
depends="tag-git, source, cpp-source, jar, data, dependencies, javadocs, goby">
<!-- make links to the release files to match what the web server expects -->
<symlink link="${releasedir}/goby-cpp.zip" resource="goby_${tag}-cpp.zip"/>
<symlink link="${releasedir}/goby-src.zip" resource="goby_${tag}-src.zip"/>
<symlink link="${releasedir}/goby-deps.zip" resource="goby_${tag}-deps.zip"/>
<symlink link="${releasedir}/goby-apidoc.zip" resource="goby_${tag}-apidoc.zip"/>
<symlink link="${releasedir}/goby-data.zip" resource="goby_${tag}-data.zip"/>
<symlink link="${releasedir}/goby.zip" resource="goby_${tag}-goby.zip"/>
<!-- copy the changes and version info files to the release directory -->
<copy todir="${releasedir}">
<fileset dir="${exportdir}/${tag}">
<include name="CHANGES.txt"/>
<include name="VERSION.txt"/>
</fileset>
</copy>
<!-- bundle everything up so it can be easily transferred to the release site -->
<!-- Ant tar task doesn't seem to handle softlinks properly but just makes duplicate copies :-(
<tar destfile="release-${tag}.tgz" compression="gzip">
<tarfileset dir="">
<include name="${releasedir}/**"/>
</tarfileset>
</tar>
-->
<shellscript shell="bash" dir="${basedir}">
tar zcvf release-goby_${tag}.tgz ${releasedir}
</shellscript>
<!-- copy the zip to the web folder -->
<!-- todo -->
<!-- notify webmaster about new file -->
<!-- todo -->
<!-- delete the temp files to clean up -->
<!--<delete dir="${exportdir}"/>-->
</target>
<target name="source" depends="export" description="Assemble a source code release">
<zip destfile="${srcfile}" comment="Goby version: ${tag}">
<!-- don't include all the libraries and data -->
<fileset dir="${exportdir}">
<exclude name="${tag}/lib/**"/>
<exclude name="${tag}/data/**"/>
<exclude name="${tag}/scripts/pbs/**"/>
<exclude name="${tag}/scripts/sge/**"/>
<exclude name="${tag}/scripts/swift/**"/>
<exclude name="${tag}/scripts/util/**"/>
</fileset>
</zip>
</target>
<target name="cpp-source" depends="export" description="Assemble a cpp source code release">
<zip destfile="${cpp-srcfile}" comment="Goby version: ${tag}">
<!-- don't include all the libraries and data -->
<fileset dir="${exportdir}">
<include name="${tag}/cpp/**"/>
</fileset>
</zip>
</target>
<target name="data" depends="export" description="Assemble a data release">
<zip destfile="${datafile}" comment="Goby version: ${tag}">
<fileset dir="${exportdir}">
<include name="${tag}/data/**"/>
</fileset>
</zip>
</target>
<target name="dependencies" depends="export" description="Assemble dependency release">
<zip destfile="${depsfile}" comment="Goby version: ${tag}">
<fileset dir="${exportdir}">
<include name="${tag}/lib/**"/>
</fileset>
</zip>
</target>
<target name="javadocs">
<!-- run the java docs -->
<ant target="javadocs" dir="${exportdir}/${tag}">
<property name="classes" location="${exportdir}/${tag}/classes"/>
<property name="config" location="${exportdir}/${tag}/config"/>
<property name="javadocs" location="${exportdir}/${tag}/javadocs"/>
<property name="lib" location="${exportdir}/${tag}/lib"/>
<property name="logs" location="${exportdir}/${tag}/logs"/>
<property name="src" location="${exportdir}/${tag}/src"/>
</ant>
<!-- zip the api documentation for the website -->
<zip destfile="${apidocfile}" basedir="${exportdir}" includes="${tag}/javadocs/**"
comment="Goby version: ${tag}"/>
</target>
<target name="jar" depends="export" description="create and package the jar files">
<ant target="jar" dir="${exportdir}/${tag}" inheritall="false" usenativebasedir="true" antfile="build.xml">
<property name="buildstamp" value="${exportdate}"/>
<property name="classes" location="${exportdir}/${tag}/classes"/>
<property name="config" location="${exportdir}/${tag}/config"/>
<property name="lib" location="${exportdir}/${tag}/lib"/>
<property name="logs" location="${exportdir}/${tag}/logs"/>
<property name="src" location="${exportdir}/${tag}/src"/>
</ant>
<!-- note: the copy is important, the bdval target will look for it -->
<copy file="${exportdir}/${tag}/goby.jar" todir="${releasedir}"/>
<move file="${exportdir}/${tag}/goby-api.jar" todir="${releasedir}"/>
</target>
<target name="goby" description="Create the binary distribtion for Goby">
<chmod file="${exportdir}/${tag}/goby" perm="+x"/>
<zip destfile="${gobyfile}" comment="Goby version: ${tag}">
<fileset dir="${exportdir}">
<include name="${tag}/README-Goby.txt"/>
<include name="${tag}/CHANGES.txt"/>
<include name="${tag}/VERSION.txt"/>
<include name="${tag}/COPYING"/>
<include name="${tag}/GPL3.license"/>
<include name="${tag}/LGPL3.license"/>
<include name="${tag}/data/**"/>
<include name="${tag}/goby.jar"/>
<include name="${tag}/goby-io.jar"/>
<include name="${tag}/goby-io-api.jar"/>
<include name="${tag}/goby-spi.jar"/>
<include name="${tag}/config/**"/>
<include name="${tag}/scripts/distrib/**"/>
<include name="${tag}/goby"/>
</fileset>
</zip>
</target>
</project>