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

Last change on this file since 1032 was 1032, checked in by Nicklas Nordborg, 14 years ago

Fixes #202: Change source files to UTF-8

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.9 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!-- $Id: build.xml 1032 2009-04-07 06:24:34Z 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.4pre" />
17  <property name="src" location="src" description="Location of source files" />
18  <property name="build" location="build" description="Location of compiled files" />
19  <property name="dist" location="dist" description="Directory where distribution should be created" />
20  <property name="package" location="package" description="Directory where packaged distribution files are created"/>
21  <property name="javac.arg" value="-Xlint:unchecked" />
22  <property name="javac.source" value="1.5" />
23  <property name="javac.target" value="1.5" />
24  <property name="javac.encoding" value="UTF-8" />
25  <property name="depend.jars" 
26    value="http://base2.thep.lu.se/base/jars/2.9.0" 
27    description="The location of the BASE core JARs that we depend on"
28  />
29
30  <!-- set up classpath for compiling -->
31  <path id="classpath">
32    <fileset dir="lib">
33      <include name="**/*.jar" />
34    </fileset>
35  </path>
36
37  <target name="init">
38    <mkdir dir="${build}" />
39    <mkdir dir="${dist}" />
40  </target>
41   
42  <target name="clean">
43    <delete failonerror="false" includeemptydirs="true">
44      <fileset dir="${build}" defaultexcludes="no" />
45      <fileset dir="${dist}" defaultexcludes="no" />
46      <fileset dir="${package}" defaultexcludes="no" />
47    </delete>
48  </target>
49 
50  <target 
51    name="dist" 
52    depends="clean,build"
53    >
54    <copy todir="${dist}">
55      <fileset dir="." includes="README*,LICENSE,INSTALL" />
56      <fileset dir="." includes="config/*" />
57      <fileset dir="." includes="contrib/*" />
58    </copy>
59  </target>
60 
61  <target
62    name="package"
63    depends="dist"
64    description="Create binary distribution package"
65    >
66    <property name="tar.prefix" value="${name}-${version}" />
67    <mkdir dir="${package}" />
68    <tar
69      destfile="${package}/${tar.prefix}.tar.gz"
70      longfile="gnu"
71      compression="gzip"
72      >
73      <tarfileset
74        dir="${dist}"
75        mode="755"
76        prefix="${tar.prefix}"
77        preserveLeadingSlashes="true"
78        >
79        <include name="**/*.sh" />
80      </tarfileset>
81      <tarfileset
82        dir="${dist}"
83        prefix="${tar.prefix}"
84        preserveLeadingSlashes="true"
85        >
86        <exclude name="**/*.sh" />
87      </tarfileset>
88    </tar>
89  </target>
90 
91  <target 
92    name="build"
93    depends="init,checkjar"
94    description="Compiles the plugin and put in jar"
95    >
96    <property name="jar" value="${name}.jar" />
97    <mkdir dir="${build}" />
98    <javac 
99      encoding="${javac.encoding}" 
100      srcdir="${src}" 
101      destdir="${build}" 
102      debug="true" 
103      classpathref="classpath"
104      source="${javac.source}"
105      target="${javac.target}"
106      >
107      <compilerarg value="${javac.arg}" />
108    </javac>
109    <copy todir="${build}">
110      <fileset dir="." includes="META-INF/*" />
111    </copy>
112    <replace token="%%plugins.jar%%" value="${jar}" file="${build}/META-INF/base-plugins.xml" />
113    <jar 
114      jarfile="${dist}/${jar}" 
115      basedir="${build}" 
116      >
117    </jar>
118  </target>
119 
120  <target 
121    name="checkjar"
122    description="Checks that the BASE2Core.jar, BASE2CorePlugins.jar and BASE2WSClient.jar exists."
123    >
124    <available classname="net.sf.basedb.core.Application" 
125      classpathref="classpath" property="base2core" />
126    <available classname="net.sf.basedb.plugins.ReporterFlatFileImporter" 
127      classpathref="classpath" property="base2coreplugins" />
128    <available classname="net.sf.basedb.ws.client.SessionClient"
129      classpathref="classpath" property="base2wsclient" />
130    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
131    <fail unless="base2coreplugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
132    <fail unless="base2wsclient" message="Can't find BASE2WSClient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
133    <echo>Found BASE2Core.jar, BASE2CorePlugins.jar, and BASE2WSClient.jar.</echo>
134  </target>
135
136    <target 
137    name="download-lib"
138    description="Download BASE2Core.jar, BASE2CorePlugins.jar and BASE2WSClient.jar."
139    >
140    <echo>
141-------------------------------------------------------   
142NOTE! You may specify a different download location by
143creating the file './build.properties' and
144setting 'depend.jars' to the URL to download from.
145-------------------------------------------------------
146    </echo>
147    <download-lib file="BASE2Core.jar" />
148    <download-lib file="BASE2CorePlugins.jar" />
149    <download-lib file="BASE2WSClient.jar" />
150  </target>
151 
152  <macrodef name="download-lib" description="Download BASE core JAR files">
153    <attribute name="file" />
154    <sequential>
155      <get 
156        dest="lib/compile/@{file}" 
157        src="${depend.jars}/@{file}" 
158        usetimestamp="true" 
159        verbose="true"
160        ignoreerrors="true"
161      />
162    </sequential>
163  </macrodef> 
164
165</project>
Note: See TracBrowser for help on using the repository browser.