source: extensions/net.sf.basedb.mev/tags/1.0/build.xml

Last change on this file was 695, checked in by Nicklas Nordborg, 15 years ago

Preparing release 1.0

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project 
3  name="MevLauncher" 
4  default="jar" 
5  basedir=".">
6
7  <!--create this file if you need to override values from properties below -->
8  <property file="build.properties" />
9 
10  <!-- variables used -->
11  <property name="name" value="mev-launcher" />
12  <property name="version" value="1.0" />
13  <property name="src" location="src" description="Location of source files" />
14  <property name="build" location="build" description="Location of compiled files" />
15  <property name="jar.name" value="${name}.jar" 
16    description="Name of JAR file with the extensions." />
17  <property name="tar.prefix" value="${name}-${version}" 
18    description="Prefix of .tar.gz file for download." />
19  <property name="tar.name" value="${tar.prefix}.tar.gz" 
20    description="Full name of .tar.gz file for download." />
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="ISO-8859-1" />
25  <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.7.0" />
26
27  <!-- set up classpath for compiling -->
28  <path id="classpath">
29    <fileset dir="lib">
30      <include name="**/*.jar" />
31    </fileset>
32  </path>
33
34  <target name="init">
35    <mkdir dir="${build}" />
36  </target>
37   
38  <target name="clean">
39    <delete failonerror="false" includeemptydirs="true">
40      <fileset dir="${build}" defaultexcludes="no" />
41      <fileset file="${jar.name}" />
42      <fileset file="${tar.name}" />
43    </delete>
44  </target>
45 
46  <target
47    name="package"
48    depends="clean,jar"
49    description="Clean and create binary distribution package"
50    >
51    <tar
52      destfile="${tar.name}"
53      longfile="gnu"
54      compression="gzip"
55      >
56      <tarfileset
57        dir="."
58        prefix="${tar.prefix}"
59        preserveLeadingSlashes="true"
60        includes="${jar.name},README,LICENSE"
61        >
62      </tarfileset>
63    </tar>
64  </target> 
65 
66  <target 
67    name="jar"
68    depends="build"
69    description="Creates the extension JAR file"
70    >
71    <jar 
72      jarfile="${jar.name}" 
73      >
74      <fileset dir="${build}" />
75      <fileset dir="." includes="META-INF/**" />
76      <fileset dir="." includes="resources/**" />
77    </jar>
78  </target>
79 
80  <target 
81    name="build"
82    depends="init,checkjar"
83    description="Compiles the plugin and put in jar"
84    >
85    <mkdir dir="${build}" />
86    <javac 
87      encoding="${javac.encoding}" 
88      srcdir="${src}" 
89      destdir="${build}" 
90      debug="true" 
91      classpathref="classpath"
92      source="${javac.source}"
93      target="${javac.target}"
94      >
95      <compilerarg value="${javac.arg}" />
96    </javac>
97  </target>
98 
99  <target 
100    name="checkjar"
101    description="Checks that the BASE2Core.jar, BASE2Webclient.jar and BASE2CorePlugins.jar exists."
102    >
103    <available classname="net.sf.basedb.core.Application" 
104      classpathref="classpath" property="base2core" />
105    <available classname="net.sf.basedb.plugins.BioAssaySetExporter" 
106      classpathref="classpath" property="base2plugins" />
107    <available classname="net.sf.basedb.clients.web.extensions.toolbar.FixedButtonFactory" 
108      classpathref="classpath" property="base2web" />
109    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
110    <fail unless="base2plugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
111    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
112    <echo>Found BASE2Core.jar, BASE2CorePlugins.jar and BASE2Webclient.jar.</echo>
113  </target>
114 
115  <target 
116    name="download-lib"
117    description="Download BASE2Core.jar, BASE2Webclient.jar and BASE2CorePlugins.jar."
118    >
119    <echo>
120-------------------------------------------------------   
121NOTE! You may specifiy a different download location by
122creating the file './build.properties' and
123setting 'depend.jars' to the URL to download from.
124-------------------------------------------------------
125    </echo>
126    <download-lib file="BASE2Core.jar" />
127    <download-lib file="BASE2CorePlugins.jar" />
128    <download-lib file="BASE2Webclient.jar" />
129  </target>
130 
131  <macrodef name="download-lib" description="Download BASE core JAR files">
132    <attribute name="file" />
133    <sequential>
134      <get 
135        dest="lib/compile/@{file}" 
136        src="${depend.jars}/@{file}" 
137        usetimestamp="true" 
138        verbose="true"
139        ignoreerrors="true"
140      />
141    </sequential>
142  </macrodef>
143</project>
Note: See TracBrowser for help on using the repository browser.