source: plugins/base2/net.sf.basedb.illumina/trunk/build.xml @ 1385

Last change on this file since 1385 was 1385, checked in by Martin Svensson, 10 years ago

References #311 The Illumina plugin package can now be build with base3-jars and install in BASE3.0

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 6.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!-- $Id: build.xml 1385 2011-09-02 13:39:29Z martin $ -->
4
5<project 
6  name="IlluminaPlugins" 
7  default="dist" 
8  basedir=".">
9
10  <!--create this file if you need to override values from properties below -->
11  <property file="build.properties" />
12
13 
14  <!-- variables used -->
15  <property name="name" value="illumina-plugins" />
16  <property name="version" value="1.7pre" />
17  <property name="minbaseversion" value="3.0" 
18    description="Minimal BASE version required by the plug-ins" />
19  <property name="src" location="src" description="Location of source files" />
20  <property name="build" location="build" description="Location of compiled files" />
21  <property name="dist" location="dist" description="Directory where distribution should be created" />
22  <property name="package" location="package" description="Directory where packaged distribution files are created"/>
23  <property name="javac.arg" value="-Xlint:unchecked" />
24  <property name="javac.source" value="1.6" />
25  <property name="javac.target" value="1.6" />
26  <property name="javac.encoding" value="UTF-8" />
27  <property name="depend.jars" 
28    value="http://base2.thep.lu.se/base/jars/" 
29    description="The location of the BASE core JARs that we depend on"
30  />
31
32  <!-- set up classpath for compiling -->
33  <path id="classpath">
34    <fileset dir="lib">
35      <include name="**/*.jar" />
36    </fileset>
37  </path>
38
39  <target name="init">
40    <mkdir dir="${build}" />
41    <mkdir dir="${dist}" />
42  </target>
43   
44  <target name="clean">
45    <delete failonerror="false" includeemptydirs="true">
46      <fileset dir="${build}" defaultexcludes="no" />
47      <fileset dir="${dist}" defaultexcludes="no" />
48      <fileset dir="${package}" defaultexcludes="no" />
49    </delete>
50  </target>
51 
52  <target 
53    name="dist" 
54    depends="clean,build"
55    >
56    <copy todir="${dist}">
57      <fileset dir="." includes="README*,LICENSE,INSTALL" />
58      <fileset dir="." includes="config/*" />
59      <fileset dir="." includes="contrib/*" />
60    </copy>
61  </target>
62 
63  <target
64    name="package"
65    depends="dist"
66    description="Create binary distribution package"
67    >
68    <property name="tar.prefix" value="${name}-${version}" />
69    <mkdir dir="${package}" />
70    <tar
71      destfile="${package}/${tar.prefix}.tar.gz"
72      longfile="gnu"
73      compression="gzip"
74      >
75      <tarfileset
76        dir="${dist}"
77        mode="755"
78        prefix="${tar.prefix}"
79        preserveLeadingSlashes="true"
80        >
81        <include name="**/*.sh" />
82      </tarfileset>
83      <tarfileset
84        dir="${dist}"
85        prefix="${tar.prefix}"
86        preserveLeadingSlashes="true"
87        >
88        <exclude name="**/*.sh" />
89      </tarfileset>
90    </tar>
91  </target>
92 
93  <target 
94    name="build"
95    depends="init,checkjar"
96    description="Compiles the plugin and put in jar"
97    >
98    <property name="jar" value="${name}.jar" />
99    <property name="jar.extensions" value="illumina-extensions.jar" />
100    <mkdir dir="${build}" />
101    <javac 
102      encoding="${javac.encoding}" 
103      srcdir="${src}" 
104      destdir="${build}" 
105      debug="true" 
106      classpathref="classpath"
107      source="${javac.source}"
108      target="${javac.target}"
109      includeantruntime="false"
110      >
111      <compilerarg value="${javac.arg}" />
112    </javac>
113    <copy todir="${build}">
114      <fileset dir="." includes="META-INF/*"/>
115    </copy>   
116    <jar 
117      jarfile="${dist}/${jar}" 
118      basedir="${build}"
119      >
120    </jar>     
121  </target>
122 
123  <target name="update-version">
124    <echo>Setting version to: ${version}</echo>
125   
126    <echo>Illumina.java</echo>
127    <replaceregexp 
128      file="${src}/net/sf/basedb/illumina/Illumina.java"
129      match="public static final String VERSION = &#34;.*&#34;;"
130      replace="public static final String VERSION = &#34;${version}&#34;;"
131      encoding="UTF-8"
132    />
133   
134    <echo>extensions.xml</echo>
135    <replaceregexp 
136      file="META-INF/extensions.xml"
137      match="&lt;version&gt;.*&lt;/version&gt;"
138      replace="&lt;version&gt;${version}&lt;/version&gt;"
139      encoding="UTF-8"
140    />
141       
142    <echo>Don't forget to commit the changes to the subversion repository!</echo>
143  </target>
144 
145  <target 
146    name="checkjar"
147    description="Checks that the base-core-3.0.0.jar, base-webclient-3.0.0.jar, base-coreplugins-3.0.0.jar and base-webclient-3.0.0.jar exists."
148    >
149    <available classname="net.sf.basedb.core.Application" 
150      classpathref="classpath" property="base3core" />
151    <available classname="net.sf.basedb.plugins.ReporterFlatFileImporter" 
152      classpathref="classpath" property="base3coreplugins" />
153    <available classname="net.sf.basedb.ws.client.SessionClient"
154      classpathref="classpath" property="base3wsclient" />
155    <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" 
156      classpathref="classpath" property="base3web" />
157    <fail unless="base3core" message="Can't find base-core-3.0.0.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
158    <fail unless="base3coreplugins" message="Can't find base-coreplugins-3.0.0.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
159    <fail unless="base3wsclient" message="Can't find base-webservices-client-3.0.0.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
160    <fail unless="base3web" message="Can't find base-webclient-3.0.0.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
161    <echo>Found base-core-3.0.0.jar, base-coreplugins-3.0.0.jar, base-webservices-client-3.0.0.jar and base-webclient-3.0.0.jar.</echo>
162  </target>
163
164    <target 
165    name="download-lib"
166    description="Download base-webclient-3.0.0.jar, base-core-3.0.0.jar, base-coreplugins-3.0.0.jar and base-webservices-client-3.0.0.jar"
167    >
168    <echo>
169-------------------------------------------------------   
170NOTE! You may specify a different download location by
171creating the file './build.properties' and
172setting 'depend.jars' to the URL to download from.
173-------------------------------------------------------
174    </echo>
175    <download-lib file="base-core-3.0.0.jar" />
176    <download-lib file="base-coreplugins-3.0.0.jar" />
177    <download-lib file="base-webservices-client-3.0.0.jar" />
178    <download-lib file="base-webclient-3.0.0.jar" />
179  </target>
180 
181  <macrodef name="download-lib" description="Download BASE core JAR files">
182    <attribute name="file" />
183    <sequential>
184      <get 
185        dest="lib/compile/@{file}" 
186        src="${depend.jars}/@{file}" 
187        usetimestamp="true" 
188        verbose="true"
189        ignoreerrors="true"
190      />
191    </sequential>
192  </macrodef> 
193
194</project>
Note: See TracBrowser for help on using the repository browser.