source: extensions/net.sf.basedb.meludi/trunk/build.xml @ 5863

Last change on this file since 5863 was 5863, checked in by olle, 23 months ago

Refs #1029. Updates due to version number change to "1.6.0b8".

  1. Version number changed to "1.6.0b8":
    a. Outermost Ant XML build file build.xml in / updated.
    b. Extensions XML configuration file extensions.xml in META-INF/ updated.
    c. Javascript file meludi-2.js in resources/ updated.
    d. Javascript file meludi_quarter_month_report_generator.js in resources/reports/ updated.
    e. Javascript file samplereportgenerator.js in resources/reports/ updated.
    f. Java class/file Meludi.java in src/net/sf/basedb/meludi/ updated.
File size: 8.4 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project 
3  name="MeLuDi" 
4  default="build" 
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="meludi" />
12  <property name="title" value="MeLuDI" />
13  <property name="version" value="1.6.0b8" />
14  <property name="src" location="src" description="Location of source files" />
15  <property name="build" location="build" description="Location of compiled files" />
16  <property name="dist" location="dist" description="Directory where distribution should be created" />
17  <property name="jar.name" value="${name}.jar" description="Name of JAR file with the extensions." />
18  <property name="tar.prefix" value="${name}-${version}" description="Prefix of .tar.gz file for download." />
19  <property name="tar.name" value="${tar.prefix}.tar.gz" description="Full name of .tar.gz file for download." />
20  <property name="javac.arg" value="-Xlint:unchecked" />
21  <property name="javac.release" value="11" />
22  <property name="javac.encoding" value="UTF-8" />
23  <property name="depend.base-version" 
24    value="3.15.0" 
25    description="The BASE version that this project depends on."
26  />
27  <property name="depend.jars" 
28    value="http://base.thep.lu.se/chrome/site/files/base/jars/${depend.base-version}" 
29    description="The location of the BASE core JARs that this project depends on."
30  />
31
32  <!-- set up classpath for compiling -->
33  <path id="classpath">
34    <fileset dir="lib">
35      <include name="**/*.jar" />
36    </fileset>
37    <fileset dir="META-INF/lib">
38      <include name="**/*.jar" />
39    </fileset>
40  </path>
41
42  <target name="init">
43    <mkdir dir="${build}" />
44    <mkdir dir="${dist}" />
45  </target>
46   
47  <target name="clean">
48    <delete failonerror="false" includeemptydirs="true">
49      <fileset dir="${build}" defaultexcludes="no" />
50      <fileset dir="${dist}" defaultexcludes="no" />
51      <fileset file="${jar.name}" />
52      <fileset file="${tar.name}" />
53    </delete>
54  </target>
55 
56  <target 
57    name="dist" 
58    depends="clean,build"
59    >
60    <copy todir="${dist}">
61      <fileset dir="." includes="README,LICENSE,meludi-ogs-hosts.xml,config/*" />
62      <fileset file="${jar.name}" />
63    </copy>
64  </target>
65 
66  <target
67    name="package"
68    depends="dist"
69    description="Create binary distribution package"
70    >
71    <tar
72      destfile="${tar.name}"
73      longfile="gnu"
74      compression="gzip"
75      >
76      <tarfileset
77        dir="${dist}"
78        mode="755"
79        prefix="${tar.prefix}"
80        preserveLeadingSlashes="true"
81        >
82        <include name="**/*.sh" />
83      </tarfileset>
84      <tarfileset
85        dir="${dist}"
86        prefix="${tar.prefix}"
87        preserveLeadingSlashes="true"
88        >
89        <exclude name="**/*.sh" />
90      </tarfileset>
91    </tar>
92  </target>
93 
94  <target 
95    name="install"
96    depends="build"
97    >
98    <fail unless="base.plugins" message="base.plugins is not set to the path of BASE plug-ins directory." />
99    <copy todir="${base.plugins}">
100      <fileset file="${jar.name}" />
101    </copy>
102    <echo>Copied '${jar.name}' to '${base.plugins}'.</echo>
103  </target>
104
105 
106  <target 
107    name="build"
108    depends="init,checkjar"
109    description="Compiles the plugin and put in jar"
110    >
111    <mkdir dir="${build}" />
112    <javac 
113      encoding="${javac.encoding}" 
114      srcdir="${src}" 
115      destdir="${build}" 
116      debug="true" 
117      includeantruntime="false"
118      classpathref="classpath"
119      release="${javac.release}"
120      >
121      <compilerarg value="${javac.arg}" />
122    </javac>
123    <jar 
124      jarfile="${jar.name}" 
125      manifest="META-INF/MANIFEST.MF"
126      >
127      <fileset dir="${build}" />
128      <fileset dir="." includes="META-INF/**" />
129      <fileset dir="." includes="resources/**" />
130    </jar>
131  </target>
132 
133  <target 
134    name="checkjar"
135    description="Checks that required BASE JAR files exists"
136    >
137    <available classname="net.sf.basedb.core.Application" 
138      classpathref="classpath" property="base-core" />
139    <available classname="net.sf.basedb.clients.web.Base" 
140      classpathref="classpath" property="base-web" />
141    <available classname="net.sf.basedb.info.BioAssaySetInfo" 
142      classpathref="classpath" property="base-webservice" />
143    <fail unless="base-core" message="Can't find base-core-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
144    <fail unless="base-web" message="Can't find base-webclient-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
145<!--
146    <fail unless="base-webservice" message="Can't find base-webservices-client-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
147-->
148    <echo>Found all requried BASE core JAR files.</echo>
149  </target>
150 
151  <target 
152    name="download-lib"
153    description="Download required BASE core jar files"
154    >
155    <echo>
156-------------------------------------------------------   
157NOTE! You may specifiy a different download location by
158creating the file './build.properties' and
159setting 'depend.jars' to the URL to download from.
160-------------------------------------------------------
161    </echo>
162    <download-lib file="base-core-${depend.base-version}.jar" />
163    <download-lib file="base-webclient-${depend.base-version}.jar" />
164<!--
165    <download-lib file="base-webservices-client-${depend.base-version}.jar" />
166-->
167  </target>
168 
169  <macrodef name="download-lib" description="Download BASE core JAR files">
170    <attribute name="file" />
171    <sequential>
172      <get 
173        dest="lib/compile/@{file}" 
174        src="${depend.jars}/@{file}" 
175        usetimestamp="true" 
176        verbose="true"
177        ignoreerrors="true"
178      />
179    </sequential>
180  </macrodef> 
181 
182  <target name="update-title">
183    <echo>Setting title to: ${title}</echo>
184   
185    <echo>Meludi.java</echo>
186    <replaceregexp 
187      file="${src}/net/sf/basedb/meludi/Meludi.java"
188      match="public static final String TITLE = &#34;.*&#34;;"
189      replace="public static final String TITLE = &#34;${title}&#34;;"
190      encoding="UTF-8"
191    />
192   
193    <echo>meludi-2.js</echo>
194    <replaceregexp 
195      file="resources/meludi-2.js"
196      match="meludi.TITLE = '.*';"
197      replace="meludi.TITLE = '${title}';"
198      encoding="UTF-8"
199    />
200
201    <echo>samplereport.js</echo>
202    <replaceregexp 
203      file="resources/reports/samplereportgenerator.js"
204      match="report.TITLE = '.*';"
205      replace="report.TITLE = '${title}';"
206      encoding="UTF-8"
207    />
208
209    <echo>meludi_quarter_month_report.js</echo>
210    <replaceregexp 
211      file="resources/reports/meludi_quarter_month_report_generator.js"
212      match="report.TITLE = '.*';"
213      replace="report.TITLE = '${title}';"
214      encoding="UTF-8"
215    />
216
217    <echo>extraction_protocol.js</echo>
218    <replaceregexp 
219      file="resources/sampleproc/extraction_protocol.js"
220      match="ep.TITLE = '.*';"
221      replace="ep.TITLE = '${title}';"
222      encoding="UTF-8"
223    />
224
225    <echo>Don't forget to commit the changes to the subversion repository!</echo>
226  </target>
227
228  <target name="update-version">
229    <echo>Setting version to: ${version}</echo>
230   
231    <echo>Meludi.java</echo>
232    <replaceregexp 
233      file="${src}/net/sf/basedb/meludi/Meludi.java"
234      match="public static final String VERSION = &#34;.*&#34;;"
235      replace="public static final String VERSION = &#34;${version}&#34;;"
236      encoding="UTF-8"
237    />
238   
239    <echo>meludi-2.js</echo>
240    <replaceregexp 
241      file="resources/meludi-2.js"
242      match="meludi.VERSION = '.*';"
243      replace="meludi.VERSION = '${version}';"
244      encoding="UTF-8"
245    />
246
247    <echo>samplereport.js</echo>
248    <replaceregexp 
249      file="resources/reports/samplereportgenerator.js"
250      match="report.VERSION = '.*';"
251      replace="report.VERSION = '${version}';"
252      encoding="UTF-8"
253    />
254
255    <echo>meludi_quarter_month_report.js</echo>
256    <replaceregexp 
257      file="resources/reports/meludi_quarter_month_report_generator.js"
258      match="report.VERSION = '.*';"
259      replace="report.VERSION = '${version}';"
260      encoding="UTF-8"
261    />
262
263    <echo>extensions.xml</echo>
264    <replaceregexp 
265      file="META-INF/extensions.xml"
266      match="&lt;version&gt;.*&lt;/version&gt;"
267      replace="&lt;version&gt;${version}&lt;/version&gt;"
268      encoding="UTF-8"
269    />
270    <replaceregexp 
271      file="META-INF/extensions.xml"
272      match="&lt;min-base-version&gt;.*&lt;/min-base-version&gt;"
273      replace="&lt;min-base-version&gt;${depend.base-version}&lt;/min-base-version&gt;"
274      encoding="UTF-8"
275    />
276
277    <echo>Don't forget to commit the changes to the subversion repository!</echo>
278  </target>
279
280</project>
Note: See TracBrowser for help on using the repository browser.