source: trunk/build.xml @ 4451

Last change on this file since 4451 was 4451, checked in by olle, 11 years ago

Outermost Ant build file build.xml updated in version data to prepare for development of Proteios SE 2.19.0.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Date
File size: 12.4 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 $Id: build.xml 4451 2013-03-15 10:29:00Z olle $
4
5  Copyright (C) 2006, 2007 Fredrik Levander, Gregory Vincic, Olle Mansson
6
7  Files are copyright by their respective authors. The contributions to
8  files where copyright is not explicitly stated can be traced with the
9  source code revision system.
10
11  This file is part of Proteios.
12  Available at http://www.proteios.org/
13
14  Proteios is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18
19  Proteios is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  GNU General Public License for more details.
23
24  You should have received a copy of the GNU General Public License
25  along with this program; if not, write to the Free Software
26  Foundation, Inc., 59 Temple Place - Suite 330,
27  Boston, MA  02111-1307, USA.
28-->
29<project name="Proteios"
30         default="package"
31         basedir=".">
32  <description>Build file for Proteios</description>
33  <!-- ======== Properties ======= -->
34  <property file="build.properties" />
35  <property name="MAJOR_VERSION" value="2"/>
36  <property name="MINOR_VERSION" value="19"/>
37  <property name="MICRO_VERSION" value="0"/>
38  <property name="VERSION_MARKER" value="dev"/>
39  <property name="RELEASE" value="1"/>
40
41  <property name="name"
42            value="ProteiosSE" />
43  <property name="package"
44            value="${name}" />
45  <property name="my.plugin"
46            value="MyPlugin" />
47
48  <condition property="version"
49            value="${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}"
50            else="${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}-${VERSION_MARKER}">
51      <equals arg1="${VERSION_MARKER}" arg2="" />
52  </condition>
53
54  <property name="dist-root"
55            location="dist" />
56
57  <property name="dist"
58            location="${dist-root}/${name}-${version}" />
59  <property name="release.dir"
60            location="Release" />
61  <path id="classpath">
62    <fileset dir="api/external">
63      <include name="**/*.jar" />
64    </fileset>
65  </path>
66  <path id="core.classpath">
67    <fileset dir="api/external">
68      <include name="**/*.jar" />
69    </fileset>
70    <fileset dir="api/core/dist">
71      <include name="**/*.jar" />
72    </fileset>
73  </path>
74  <property environment="env" />
75  <!-- ======== Task Definitions ======= -->
76  <path id="svnant.classpath">
77    <fileset dir="api/external/svn">
78      <include name="svnant.jar" />
79      <include name="svnClientAdapter.jar" />
80      <include name="svnjavahl.jar" />
81    </fileset>
82  </path>
83  <typedef resource="org/tigris/subversion/svnant/svnantlib.xml"
84           classpathref="svnant.classpath" />
85  <macrodef name="subcall">
86    <attribute name="target"
87               default="dist-jar" />
88    <sequential>
89      <ant dir="api/core"
90           target="@{target}"
91           inheritAll="false" />
92      <ant dir="plugin"
93           target="@{target}"
94           inheritAll="false" />
95      <ant dir="api/waf"
96           target="@{target}"
97           inheritAll="false" />
98      <ant dir="client/ftpd"
99           target="@{target}"
100           inheritAll="false" />
101      <ant dir="client/servlet"
102           target="@{target}"
103           inheritAll="false" />
104    </sequential>
105  </macrodef>
106
107  <!-- ======== Targets ======= -->
108
109  <target name="web"
110          description="Updates local index.html ready for release">
111    <property name="filename"
112              value="${package}-${version}" />
113    <copy todir="${release.dir}/htdocs">
114      <fileset dir="htdocs">
115        <include name="**" />
116      </fileset>
117    </copy>
118    <checksum file="${release.dir}/${filename}.zip" property="md5_zip"/>
119    <checksum file="${release.dir}/${filename}.tar.gz" property="md5_gz"/>
120    <checksum file="${release.dir}/${filename}-1.x86_64.rpm" property="md5_rpm"/>
121    <checksum file="${release.dir}/${filename}-1.i386.rpm"
122property="md5_386_rpm"/>
123    <replace file="${release.dir}/htdocs/index.html" token="_RELEASE_"
124value="${RELEASE}"/>
125
126    <replace file="${release.dir}/htdocs/index.html" token="_VERSION_"
127value="${version}"/>
128    <replace file="${release.dir}/htdocs/index.html" token="_MD5_ZIP_"
129value="${md5_zip}"/>
130    <replace file="${release.dir}/htdocs/index.html" token="_MD5_GZ_"
131value="${md5_gz}"/>
132    <replace file="${release.dir}/htdocs/index.html" token="_MD5_RPM_386_" value="${md5_386_rpm}"/>
133    <replace file="${release.dir}/htdocs/index.html" token="_MD5_RPM_"
134value="${md5_rpm}"/>
135
136  </target>
137  <!-- ======================== -->
138  <target name="package"
139          description="Same as 'ant clean compile hibernate dist-jar'"
140          >
141<!--    <antcall target="clean"/> -->
142    <ant dir="api/core"
143         target="set-version"
144         inheritAll="true" />
145    <antcall target="compile"/>
146    <antcall target="hibernate"/>
147    <antcall target="dist-jar"/>
148    <ant dir="api/core"
149         target="unset-version"
150         inheritAll="false" />
151  </target>
152  <!-- ======================== -->
153  <target name="dist-jar">
154    <mkdir dir="${dist}" />
155    <subcall target="dist-jar" />
156    <mkdir dir="${dist}/www/WEB-INF/classes" />
157    <!-- Copy all files needed to create a package -->
158    <copy file="api/core/dist/Replace.jar"
159          todir="${dist}" />
160    <copy file="api/core/dist/inp2var.jar"
161          todir="${dist}" />
162    <copy file="api/core/dist/GetHostName.jar"
163          todir="${dist}" />
164    <copy todir="${dist}">
165      <fileset dir="misc/install">
166        <include name="*" />
167      </fileset>
168    </copy>
169    <chmod file="${dist}/install"
170           perm="a+x" />
171    <copy todir="${dist}/www/WEB-INF/">
172      <fileset dir="client/servlet/conf">
173        <include name="web.xml*" />
174      </fileset>
175    </copy>
176    <chmod file="${dist}/www/WEB-INF/init.sh"
177           perm="a+x" />
178    <chmod file="${dist}/www/WEB-INF/update.sh"
179           perm="a+x" />
180    <copy todir="${dist}/www/WEB-INF/lib">
181      <fileset dir="api/external">
182        <include name="*.jar" />
183        <exclude name="servletapi-2.3.jar" />
184        <exclude name="jsp-api.jar" />
185        <exclude name="catalina.jar" />
186        <exclude name="catalina-optional.jar" />
187      </fileset>
188      <fileset dir="api/external">
189        <include name="jai" />
190      </fileset>
191    </copy>
192    <copy todir="${dist}/www/WEB-INF/classes"
193          includeEmptyDirs="false">
194      <fileset dir="api/core/build">
195        <include name="**" />
196        <exclude name="**/*.class" />
197        <exclude name="**/*.hbm.xml" />
198        <exclude name="**/hibernate-properties-PlateMappingData.xml" />
199      </fileset>
200      <fileset dir="api/core/conf">
201        <include name="**" />
202      </fileset>
203      <fileset dir="client/ftpd/conf">
204        <include name="**" />
205      </fileset>
206      <fileset dir="client/servlet/build">
207        <include name="**" />
208        <exclude name="**/*.class" />
209      </fileset>
210      <fileset dir="client/servlet/conf">
211        <include name="log4j.properties*" />
212        <include name="proteios.config*" />
213        <include name="mascot.properties*" />
214        <include name="mascot_default_ms_ms_ions_search.xml" />
215        <include name="mascot_default_sequence_query.xml" />
216        <include name="mascot_default_peptide_mass_fingerprint.xml" />
217        <include name="msinspect.properties*" />
218        <include name="omssa.properties*" />
219        <include name="omssa_default_iontrap.xml" />
220        <include name="omssa_default_etd.xml" />
221        <include name="openms.properties*" />
222        <include name="pike.properties*" />
223        <include name="xtandem.properties*" />
224        <include name="xtandem_default_input.xml" />
225      </fileset>
226      <fileset dir="plugin/conf">
227        <include name="**" />
228      </fileset>
229    </copy>
230    <copy todir="${dist}/www">
231      <fileset dir="client/servlet/www">
232        <exclude name="**/static/img/orig/**" />
233      </fileset>
234      <fileset dir="client/servlet/www/static/img">
235        <include name="favicon.ico" />
236      </fileset>
237    </copy>
238    <copy todir="${dist}">
239      <fileset dir="client/ftpd">
240        <include name="proteios_ftp_server*" />
241      </fileset>
242    </copy>
243    <mkdir dir="${dist}/licenses" />
244    <copy todir="${dist}/licenses">
245      <fileset dir="doc/licenses" />
246    </copy>
247    <copy todir="${dist}">
248      <fileset dir=".">
249        <include name="credits.txt" />
250      </fileset>
251    </copy>
252    <chmod file="${dist}/*.sh"
253           perm="ugo+rx" />
254    <copy file="api/core/dist/proteios_core.jar"
255          todir="${dist}/www/WEB-INF/lib" />
256    <copy file="api/waf/dist/proteios_waf.jar"
257          todir="${dist}/www/WEB-INF/lib" />
258    <copy file="client/ftpd/dist/proteios_ftpserver.jar"
259          todir="${dist}/www/WEB-INF/lib" />
260    <copy file="client/servlet/dist/proteios_client.jar"
261          todir="${dist}/www/WEB-INF/lib" />
262    <copy file="plugin/dist/proteios_plugins.jar"
263          todir="${dist}/www/WEB-INF/lib" />
264  </target>
265  <!-- ======================== -->
266  <target name="hibernate"
267          description="Just forwards to cores hibernate target">
268    <ant dir="api/core"
269         target="hibernate"
270         inheritAll="false" />
271  </target>
272  <!-- ======================== -->
273  <target name="hibernate-dev"
274          description="Just forwards to cores hibernate-dev target">
275    <ant dir="api/core"
276         target="hibernate-dev"
277         inheritAll="false" />
278  </target>
279  <!-- ======================== -->
280  <target name="compile"
281          description="Compiles proteios and all related packages">
282    <subcall target="compile" />
283  </target>
284
285  <!-- ======================== -->
286  <target name="dev">
287    <subcall target="dev" />
288  </target>
289  <!-- ======================== -->
290  <target name="clean-dev">
291    <property environment="env"/>
292    <delete dir="${env.CATALINA_BASE}/webapps/proteios/WEB-INF/classes/org"/>
293    <delete dir="${env.CATALINA_BASE}/webapps/proteios/WEB-INF/classes/se"/>
294    <delete>
295      <fileset dir="${env.CATALINA_BASE}/webapps/proteios/WEB-INF/lib">
296        <include name="proteios*.jar"/>
297      </fileset>
298    </delete>
299  </target>
300  <!-- ======================== -->
301  <target name="clean">
302    <delete dir="${dist}" />
303    <delete dir="${release.dir}" />
304    <subcall target="clean" />
305  </target>
306  <!-- ======================== -->
307  <target name="doc"
308          description="Copy required documentation">
309    <subcall target="doc" />
310  </target>
311  <!-- ======================== -->
312  <target name="test"
313          description="Tests all sub projects">
314    <subcall target="test" />
315  </target>
316  <!-- ======================== -->
317  <target name="testData"
318          description="Checks if test data has been downloaded">
319    <available property="skipDownload"
320               file="testData" />
321  </target>
322  <!-- ======================== -->
323  <target name="download-testData"
324          depends="testData"
325          if="${skipDownload}"
326          description="Downloads test data">
327    <get src="http://www.proteios.org/trac/downloads/testData.zip"
328         dest="./testData.zip" />
329    <unzip dest="."
330           src="testData.zip"></unzip>
331  </target>
332  <!-- ======================== -->
333  <target name="archive"
334          description="Creates compressed packages suitable for release.">
335    <property name="filename"
336              value="${package}-${version}" />
337    <delete dir="${release.dir}" />
338    <mkdir dir="${release.dir}" />
339    <zip destfile="${release.dir}/${filename}.zip"
340         basedir="${dist-root}" />
341    <checksum file="${release.dir}/${filename}.zip" />
342    <tar tarfile="${release.dir}/${filename}.tar"
343         longfile="gnu">
344      <tarfileset
345            dir="${dist-root}"
346        mode="755"
347        >
348        <include name="**/*.sh" />
349      </tarfileset>
350      <tarfileset
351            dir="${dist-root}"
352        >
353        <exclude name="**/*.sh" />
354      </tarfileset>
355    </tar>
356    <gzip zipfile="${release.dir}/${filename}.tar.gz"
357          src="${release.dir}/${filename}.tar" />
358    <checksum file="${release.dir}/${filename}.tar.gz" />
359    <delete file="${release.dir}/${filename}.tar" />
360  </target>
361  <!-- ======================== -->
362  <target name="svn.revision"
363          description="Get the current revision number in the subversion and put the value into the proteios.build property; replaced by constant expression in source distributions">
364    <svn>
365      <status path="."
366              lastChangedRevisionProperty="proteios.build" />
367    </svn>
368    <echo message="Build #${proteios.build}" />
369  </target>
370
371 
372</project>
Note: See TracBrowser for help on using the repository browser.