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

Last change on this file since 1276 was 1276, checked in by Nicklas Nordborg, 11 years ago

Fixes #285: Change "source" and "target" compilation options to 1.6

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 6.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!-- $Id: build.xml 1276 2010-11-24 08:19:56Z nicklas $ -->
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="2.16" 
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/2.16.0" 
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    <replace token="%%plugins.jar%%" value="${jar}" file="${build}/META-INF/base-plugins.xml" />
117    <jar 
118      jarfile="${dist}/${jar}" 
119      basedir="${build}"
120      >
121    </jar>     
122  </target>
123 
124  <target name="update-version">
125    <echo>Setting version to: ${version}</echo>
126   
127    <echo>Illumina.java</echo>
128    <replaceregexp 
129      file="${src}/net/sf/basedb/illumina/Illumina.java"
130      match="public static final String VERSION = &#34;.*&#34;;"
131      replace="public static final String VERSION = &#34;${version}&#34;;"
132      encoding="UTF-8"
133    />
134   
135    <echo>extensions.xml</echo>
136    <replaceregexp 
137      file="META-INF/extensions.xml"
138      match="&lt;version&gt;.*&lt;/version&gt;"
139      replace="&lt;version&gt;${version}&lt;/version&gt;"
140      encoding="UTF-8"
141    />
142   
143    <echo>base-plugins.xml</echo>
144    <replaceregexp 
145      file="META-INF/base-plugins.xml"
146      match="&lt;minbaseversion&gt;.*&lt;/minbaseversion&gt;"
147      replace="&lt;minbaseversion&gt;${minbaseversion}&lt;/minbaseversion&gt;"
148      encoding="UTF-8"
149      flags="g"
150    />
151    <echo>Don't forget to commit the changes to the subversion repository!</echo>
152  </target>
153 
154  <target 
155    name="checkjar"
156    description="Checks that the BASE2Core.jar, BASE2Webclient, BASE2CorePlugins.jar and BASE2WSClient.jar exists."
157    >
158    <available classname="net.sf.basedb.core.Application" 
159      classpathref="classpath" property="base2core" />
160    <available classname="net.sf.basedb.plugins.ReporterFlatFileImporter" 
161      classpathref="classpath" property="base2coreplugins" />
162    <available classname="net.sf.basedb.ws.client.SessionClient"
163      classpathref="classpath" property="base2wsclient" />
164    <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" 
165      classpathref="classpath" property="base2web" />
166    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
167    <fail unless="base2coreplugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
168    <fail unless="base2wsclient" message="Can't find BASE2WSClient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
169    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
170    <echo>Found BASE2Core.jar, BASE2CorePlugins.jar, BASE2Webclient.jar and BASE2WSClient.jar.</echo>
171  </target>
172
173    <target 
174    name="download-lib"
175    description="Download BASE2Core.jar, BASE2CorePlugins.jar and BASE2WSClient.jar."
176    >
177    <echo>
178-------------------------------------------------------   
179NOTE! You may specify a different download location by
180creating the file './build.properties' and
181setting 'depend.jars' to the URL to download from.
182-------------------------------------------------------
183    </echo>
184    <download-lib file="BASE2Core.jar" />
185    <download-lib file="BASE2CorePlugins.jar" />
186    <download-lib file="BASE2WSClient.jar" />
187    <download-lib file="BASE2Webclient.jar" />
188  </target>
189 
190  <macrodef name="download-lib" description="Download BASE core JAR files">
191    <attribute name="file" />
192    <sequential>
193      <get 
194        dest="lib/compile/@{file}" 
195        src="${depend.jars}/@{file}" 
196        usetimestamp="true" 
197        verbose="true"
198        ignoreerrors="true"
199      />
200    </sequential>
201  </macrodef> 
202
203</project>
Note: See TracBrowser for help on using the repository browser.