source: extensions/net.sf.basedb.genepattern/trunk/build.xml @ 1090

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

Fixes #216: Setup source code repository for GenePattern? integration

  • 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<project 
3  name="GenePattern" 
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="gp-integration" />
12  <property name="version" value="1.0pre" />
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="UTF-8" />
25  <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.12.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    <copy todir="${build}">
72      <fileset dir="." includes="META-INF/*" />
73    </copy>
74    <!--replace token="%%plugins.jar%%" value="${jar.name}" file="${build}/META-INF/base-plugins.xml" /-->
75    <jar 
76      jarfile="${jar.name}" 
77      >
78      <fileset dir="${build}" />
79      <fileset dir="." includes="resources/**" />
80    </jar>
81  </target>
82 
83  <target 
84    name="build"
85    depends="init,checkjar"
86    description="Compiles the plugin and put in jar"
87    >
88    <mkdir dir="${build}" />
89    <javac 
90      encoding="${javac.encoding}" 
91      srcdir="${src}" 
92      destdir="${build}" 
93      debug="true" 
94      classpathref="classpath"
95      source="${javac.source}"
96      target="${javac.target}"
97      >
98      <compilerarg value="${javac.arg}" />
99    </javac>
100  </target>
101 
102  <target 
103    name="checkjar"
104    description="Checks that the BASE2Core.jar, BASE2Webclient.jar, BASE2CorePlugins.jar and BASE2WSClient.jar exists."
105    >
106    <available classname="net.sf.basedb.util.export.spotdata.AbstractBioAssaySetExporter" 
107      classpathref="classpath" property="base2core" />
108    <available classname="net.sf.basedb.plugins.util.Parameters" 
109      classpathref="classpath" property="base2plugins" />
110    <available classname="net.sf.basedb.clients.web.extensions.toolbar.FixedButtonFactory" 
111      classpathref="classpath" property="base2web" />
112    <available classname="net.sf.basedb.info.BioAssaySetInfo" 
113      classpathref="classpath" property="base2webservice" />
114    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
115    <fail unless="base2plugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
116    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
117    <fail unless="base2webservice" message="Can't find BASE2WSClient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
118    <echo>Found BASE2Core.jar, BASE2CorePlugins.jar, BASE2Webclient.jar and BASE2WSClient.jar.</echo>
119  </target>
120 
121  <target 
122    name="download-lib"
123    description="Download BASE2Core.jar, BASE2Webclient.jar, BASE2CorePlugins.jar and BASE2WSClient.jar"
124    >
125    <echo>
126-------------------------------------------------------   
127NOTE! You may specifiy a different download location by
128creating the file './build.properties' and
129setting 'depend.jars' to the URL to download from.
130-------------------------------------------------------
131    </echo>
132    <download-lib file="BASE2Core.jar" />
133    <download-lib file="BASE2CorePlugins.jar" />
134    <download-lib file="BASE2Webclient.jar" />
135    <download-lib file="BASE2WSClient.jar" />
136  </target>
137 
138  <macrodef name="download-lib" description="Download BASE core JAR files">
139    <attribute name="file" />
140    <sequential>
141      <get 
142        dest="lib/compile/@{file}" 
143        src="${depend.jars}/@{file}" 
144        usetimestamp="true" 
145        verbose="true"
146        ignoreerrors="true"
147      />
148    </sequential>
149  </macrodef>
150</project>
Note: See TracBrowser for help on using the repository browser.