File: build.xml

package info (click to toggle)
mauve-aligner 2.4.0%2B4736-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,480 kB
  • sloc: java: 28,417; xml: 300; sh: 97; makefile: 21
file content (255 lines) | stat: -rw-r--r-- 9,201 bytes parent folder | download | duplicates (4)
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
<project name="Mauve" default="compile">
	<description>
	This buildfile tells the ant build tool how to build and package the Mauve Java 
	visualization environment.
	</description>
	
	<!-- set the release version, unless making a snapshot -->
	<target name="release_properties" unless="env.MAUVE_SNAPSHOT">
		<property name="release.version" value="2.4.0"/>
	</target>

	<!-- deployment locations for production ASAP integration -->
	<property name="deploy.asapdir" value="/srv/asap/htdocs/mauve" />
	<property name="asap.codebase" value="http://asap.ahabs.wisc.edu/asap/mauve/" />
	<!-- deployment locations for devel ASAP integration -->
	<!--
	<property name="deploy.asapdir" value="/srv/asap-devel/htdocs/mauve" />
	<property name="asap.codebase" value="http://asap.ahabs.wisc.edu/asap-devel/mauve/" />
	-->
	<!-- deployment locations for standalone releases -->
	<property name="deploy.address" value="darlini8@darlinglab.org" />
	<property name="deploy.username" value="darlini8" />
	<property name="deploy.win32.keyfile" value="C:\Documents and Settings\koadman\plonk.ppk" />
	<property name="deploy.serverdir" value="/home3/darlini8/www/mauve/downloads" />
	<property name="key.alias" value="mauve" />
	<property name="key.keystore" value="C:\Documents and Settings\koadman\My Documents\mauve-keystore" />
	
	<!-- set global properties for this build -->
	<property name="src" location="src"/>
	<property name="build" location="bin"/>
	<property name="dist"  location="dist"/>
        <property name="deblib" location="/usr/share/java" />
 	<property name="support" location="/usr/share/java"/>

	<!-- Make datestamp for update checks -->
	<tstamp>
		<format property="datestamp" pattern="yyyyMMdd" />
	</tstamp>
	
	<!-- increment the build number-->
	<buildnumber/>
	
	<!-- get any environment variables -->	
	<property environment="env" />

	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement path="${support}/ant-contrib.jar"/>
		</classpath>
	</taskdef>
	
	<target name="init">
		<!-- Create the time stamp -->
		<tstamp/>
	</target>
	
	<!-- set the timestamp if building a snapshot -->
	<target name="snapshot_properties" if="env.MAUVE_SNAPSHOT">
		<property name="release.version" value="${datestamp}"/>
	</target>

	<!-- set the version number -->
	<target name="create_properties" depends="snapshot_properties,release_properties">
		<propertyfile 
			file="${src}/version.properties"
			comment="Stores version and build information">
			<entry key="release.version" value="${release.version}"/>
			<entry key="build.number" value="${build.number}"/>
			<entry key="build.timestamp" value="${datestamp}"/>
		</propertyfile>
	</target>
	  
	<target name="compile" depends="init,create_properties" description="compile the java source">
		<!-- Create the build directory structure used by compile -->
		<mkdir dir="${build}" />
				
		<!-- Build all java source files -->
		<javac
			classpath="
				${deblib}/biojava.jar;
				${deblib}/commons-cli.jar;
				${support}/junit.jar;
				${deblib}/zeus-jscl.jar;
				${deblib}/ant.jar;
				${deblib}/dbus.jar;
				${deblib}/unix.jar"
			srcdir="${src}"
			destdir="${build}"
			target="1.6"
			source="1.6"
		>
			<compilerarg value="-Xbootclasspath/p:${env.JAVA_6_RT_PATH}"/>
		</javac>
		<mkdir dir="${build}/images"/>
		<copy todir="${build}/images">
			<fileset dir="${src}/images"/>
		</copy>
		<copy file="${src}/version.properties" todir="${build}"/>
	</target>

	<target name="rmic" depends="compile">
		<rmic base="${build}" classname="org.gel.mauve.remote.RemoteControlImpl" />
	</target>
	
	<target name="jar" depends="rmic">
		
	    <!-- Put everything in ${build} into the Mauve.jar file -->
		<delete file="Mauve.jar"/>
	    <jar jarfile="Mauve.jar">
			<fileset dir="${build}" includes="**/*" />

	    	<!-- Create a manifest file to tell java the name of the main class -->
			<manifest>
				<attribute name="Main-Class" value="org.gel.mauve.gui.Mauve"/>
				<attribute name="Built-By" value="${user.name}"/>
				<section name="common">
					<attribute name="Specification-Title" value="Mauve"/>
					<attribute name="Specification-Version" value="${version}"/>
					<attribute name="Specification-Vendor" value="Aaron E. Darling"/>
					<attribute name="Implementation-Title" value="Mauve"/>
					<attribute name="Implementation-Version" value="${version} ${TODAY}"/> 
					<attribute name="Implementation-Vendor" value="Aaron E. Darling"/>
				</section>
			</manifest>
		 </jar>
	</target>
	
	<target name="appletjar" depends="rmic">
		<delete file="mauveApplet.jar" />
		<jar jarfile="mauveApplet.jar">
			<fileset dir="${build}">
				<include name="org/gel/mauve/remote/*" />
			</fileset>
		</jar>
	</target>

	

	

	<target name="checkkeyprops" unless="key.password">
		<fail message="key.password must be set on command line, using -Dkey.password=&lt;password&gt;" />
	</target>
	
	<target name="signjars" depends="checkkeyprops,jar,appletjar">
		<signjar jar="Mauve.jar" alias="${key.alias}" storepass="${key.password}" keystore="${key.keystore}" />
		<signjar jar="mauveApplet.jar" alias="${key.alias}" storepass="${key.password}" keystore="${key.keystore}" />
	</target>
	
	<target name="testdist" depends="signjars">
		<copy todir="C:\htdocs" file="Mauve.jar" />
		<copy todir="C:\htdocs" file="mauveApplet.jar" />
		<copy todir="C:\htdocs" file="./testdata/smallAlignment.jar" />
		<copy todir="C:\htdocs" file="./jws/index.html" />
		<copy todir="C:\htdocs" file="./jws/mauve.jnlp" />
	</target>
		
	<target name="dist" depends="jar" description="generate the distribution" >
		<!-- Create the distribution directory -->
		<mkdir dir="${dist}" />
		
		<!-- Set the tarball OS name based on the build host OS -->
		<condition property="OSNAME" value="linux">
			<os name="Linux"/>
		</condition>
		<condition property="OSNAME" value="OSX">
			<os name="Mac OS X"/>
		</condition>

		<!-- Make the tarball -->
		<tar destfile="${dist}/mauve_${OSNAME}_${release.version}.tar.gz" compression="gzip">
			<!-- Copy various support files into the dist directory-->
			<tarfileset dir="." prefix="/mauve_${release.version}">
				<include name="Mauve.jar" />
				<include name="COPYING" />
				<include name="README" />
				<include name="ChangeLog.html" />
			</tarfileset>
			<tarfileset dir="linux-x64" prefix="/mauve_${release.version}/" mode="755">
				<include name="Mauve" />
			</tarfileset>
			<tarfileset dir="linux-x64" prefix="/mauve_${release.version}/linux-x64" mode="755">
				<include name="mauveAligner" />
				<include name="progressiveMauve" />
			</tarfileset>
		</tar>
	</target>

	<target name="srcdist" depends="init" description="package a source distribution">
		<tar destfile="${dist}/mauve_source_${datestamp}.tar.gz" compression="gzip">
			<!-- Copy support files into the dist directory-->
			<tarfileset dir="." prefix="/mauve-src">
				<include name="COPYING" />
				<include name="Mauve" />
				<include name="README" />
				<include name="TODO" />
				<include name="ChangeLog.html" />
				<include name="build.xml" />
				<include name="mauve.nsi" />
				<include name="mauve.dox" />
				<include name="mauve.ico" />
				<include name=".project" />
				<include name=".classpath" />
				<include name="mauve.icns" />
				<include name="Mauve Online Documentation.url" />
				<include name="Mauve.lnk" />
			</tarfileset>
			<tarfileset dir="${src}" includes="**/*" prefix="/mauve-src/src" />
		</tar>
	</target>

	<target name="run" depends="jar" description="run Mauve">
		<java jar="Mauve.jar" fork="true" />
	</target>
	
	<target name="asapResources">
		<pathconvert property="asap.resources" pathsep=" ">
			<mapper>			
		        <chainedmapper>
		    		<mapper type="flatten" />
		    		<mapper type="glob" from="*" to="&lt;jar href=&quot;*&quot; /&gt;&#13;&#10;"/>
		        </chainedmapper>
			</mapper>
		</pathconvert>
	</target>
	
	<target name="deployASAP" depends="signjars, asapResources">
		
		<echo message="Deploying mauve ASAP stuff to directory ${asap.dir}" />
		<echo message="Using codebase of ${asap.codebase}" />
		
		<!-- update and copy mauve.jnlp to dist-->
		<copy file="./jws/mauve.jnlp.template" tofile="${dist}/mauve.jnlp" overwrite="yes">
			<filterset>
				<filter token="CODEBASE" value="${asap.codebase}"/>
				<filter token="RESOURCES" value="${asap.resources}"/>
				<filter token="ARGUMENTS" value=""/>
			</filterset>
		</copy>

	</target>
	
	<!-- assumes that passwordless ssh authentication has been configured to the web server -->
	<target name="deployLinux" depends="dist">
		<exec executable="scp">
			<arg value="${dist}/mauve_linux_${release.version}.tar.gz" />
			<arg value="${deploy.address}:${deploy.serverdir}" />
		</exec>
		<echo file="${dist}/latest.linux" message="${datestamp}"/>
		<exec executable="scp">
			<arg value="${dist}/latest.linux" />
			<arg value="${deploy.address}:${deploy.serverdir}" />
		</exec>
	</target>
</project>