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

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

Fixes #224: Add a "Test" button on the GenePattern? 'edit server' page

Now using Ajax to do the test which means that we don't need to 'forward' from the servlet and we only need BASE 2.12.0.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 5.7 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  <property name="genepattern.jars" value="http://genepattern.broad.mit.edu/gp/downloads" />
27
28  <!-- set up classpath for compiling -->
29  <path id="classpath">
30    <fileset dir="lib">
31      <include name="**/*.jar" />
32    </fileset>
33  </path>
34
35  <target name="init">
36    <mkdir dir="${build}" />
37  </target>
38   
39  <target name="clean">
40    <delete failonerror="false" includeemptydirs="true">
41      <fileset dir="${build}" defaultexcludes="no" />
42      <fileset file="${jar.name}" />
43      <fileset file="${tar.name}" />
44    </delete>
45  </target>
46 
47  <target
48    name="package"
49    depends="clean,jar"
50    description="Clean and create binary distribution package"
51    >
52    <tar
53      destfile="${tar.name}"
54      longfile="gnu"
55      compression="gzip"
56      >
57      <tarfileset
58        dir="."
59        prefix="${tar.prefix}"
60        preserveLeadingSlashes="true"
61        includes="${jar.name},README,LICENSE*,lib/genepattern/*"
62        excludes="lib/genepattern/GenePattern.jar,lib/genepattern/gp-modules.jar"
63        >
64      </tarfileset>
65    </tar>
66  </target> 
67 
68  <target 
69    name="jar"
70    depends="build"
71    description="Creates the extension JAR file"
72    >
73    <copy todir="${build}">
74      <fileset dir="." includes="META-INF/*" />
75    </copy>
76    <replace token="%%plugins.jar%%" value="${jar.name}" file="${build}/META-INF/base-plugins.xml" />
77    <jar 
78      jarfile="${jar.name}" 
79      manifest="${build}/META-INF/MANIFEST.MF"
80      >
81      <fileset dir="${build}" />
82      <fileset dir="." includes="resources/**" />
83    </jar>
84  </target>
85 
86  <target 
87    name="build"
88    depends="init,checkjar"
89    description="Compiles the plugin and put in jar"
90    >
91    <mkdir dir="${build}" />
92    <javac 
93      encoding="${javac.encoding}" 
94      srcdir="${src}" 
95      destdir="${build}" 
96      debug="true" 
97      classpathref="classpath"
98      source="${javac.source}"
99      target="${javac.target}"
100      >
101      <compilerarg value="${javac.arg}" />
102    </javac>
103  </target>
104 
105  <target 
106    name="checkjar"
107    description="Checks that the BASE2Core.jar, BASE2Webclient.jar, BASE2CorePlugins.jar and BASE2WSClient.jar exists."
108    >
109    <available classname="net.sf.basedb.util.export.spotdata.AbstractBioAssaySetExporter" 
110      classpathref="classpath" property="base2core" />
111    <available classname="net.sf.basedb.plugins.util.Parameters" 
112      classpathref="classpath" property="base2plugins" />
113    <available classname="net.sf.basedb.clients.web.extensions.toolbar.FixedButtonFactory" 
114      classpathref="classpath" property="base2web" />
115    <available classname="net.sf.basedb.info.BioAssaySetInfo" 
116      classpathref="classpath" property="base2webservice" />
117    <available classname="org.genepattern.client.GPClient"
118      classpathref="classpath" property="genepattern.lib" />
119    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
120    <fail unless="base2plugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
121    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
122    <fail unless="base2webservice" message="Can't find BASE2WSClient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
123    <fail unless="genepattern.lib" message="Can't find GenePattern.jar in ./lib/genepattern. Try 'ant download-lib' to download the missing file." />
124    <echo>Found all required BASE and GenePattern JAR files.</echo>
125  </target>
126 
127  <target 
128    name="download-lib"
129    description="Download BASE and GenePattern JAR files"
130    >
131    <echo>
132-------------------------------------------------------   
133NOTE! You may specifiy a different download location by
134creating the file './build.properties' and setting
135'depend.jars' and 'genepattern.jars' to the URLs to
136download from.
137-------------------------------------------------------
138    </echo>
139    <download-lib file="BASE2Core.jar" />
140    <download-lib file="BASE2CorePlugins.jar" />
141    <download-lib file="BASE2Webclient.jar" />
142    <download-lib file="BASE2WSClient.jar" />
143    <!-- We only need some files from the GenePattern.zip file -->
144    <download-lib file="GenePattern.zip" todir="${build}" from="${genepattern.jars}" />
145    <unzip dest="lib/genepattern" src="${build}/GenePattern.zip">
146      <patternset>
147        <include name="GenePattern.jar" />
148        <include name="lib/gp-modules.jar" />
149      </patternset>
150      <mapper type="flatten"/>
151    </unzip>
152  </target>
153 
154  <macrodef name="download-lib" description="Download BASE core JAR files">
155    <attribute name="file" />
156    <attribute name="todir" default="lib/compile"/>
157    <attribute name="from" default="${depend.jars}" />
158    <sequential>
159      <get 
160        dest="@{todir}/@{file}" 
161        src="@{from}/@{file}" 
162        usetimestamp="true" 
163        verbose="true"
164        ignoreerrors="true"
165      />
166    </sequential>
167  </macrodef>
168</project>
Note: See TracBrowser for help on using the repository browser.