2 |
26 Feb 07 |
jari |
12.17.2004 |
2 |
26 Feb 07 |
jari |
Ant Build ReadMe |
2 |
26 Feb 07 |
jari |
3 |
|
2 |
26 Feb 07 |
jari |
4 |
|
2 |
26 Feb 07 |
jari |
Contents: |
2 |
26 Feb 07 |
jari |
*Ant Script for MeV Compilation (Intro, overview) |
2 |
26 Feb 07 |
jari |
*About Using build.xml (use of the script) |
2 |
26 Feb 07 |
jari |
*Modification/Customization of build.xml (mods for feature or |
2 |
26 Feb 07 |
jari |
module development) |
2 |
26 Feb 07 |
jari |
10 |
|
2 |
26 Feb 07 |
jari |
11 |
|
2 |
26 Feb 07 |
jari |
12 |
|
2 |
26 Feb 07 |
jari |
Ant Script for MeV Compilation |
2 |
26 Feb 07 |
jari |
14 |
------------------------------ |
2 |
26 Feb 07 |
jari |
15 |
|
2 |
26 Feb 07 |
jari |
Ant is a java based tools to support the building of java projects in a |
2 |
26 Feb 07 |
jari |
controlled manner. A comprehensive description of Ant, a manual, and Ant |
2 |
26 Feb 07 |
jari |
executable and source code is available at: http://ant.apache.org. |
2 |
26 Feb 07 |
jari |
Installation instructions are also available at the above site. |
2 |
26 Feb 07 |
jari |
Installation of Ant is fairly easy and mostly involves specification |
2 |
26 Feb 07 |
jari |
or modification of environment variables as described in the installation |
2 |
26 Feb 07 |
jari |
instructions. |
2 |
26 Feb 07 |
jari |
23 |
|
2 |
26 Feb 07 |
jari |
Once installed Ant will use the build.xml file to direct MeV compilation |
2 |
26 Feb 07 |
jari |
and jar construction. Before using build.xml, you will need to update the file |
2 |
26 Feb 07 |
jari |
so that the "javac-location" property refers to a java compiler. |
2 |
26 Feb 07 |
jari |
27 |
|
2 |
26 Feb 07 |
jari |
28 |
|
2 |
26 Feb 07 |
jari |
29 |
|
2 |
26 Feb 07 |
jari |
About Using build.xml |
2 |
26 Feb 07 |
jari |
31 |
--------------------- |
2 |
26 Feb 07 |
jari |
32 |
|
2 |
26 Feb 07 |
jari |
build.xml defines Ant 'targets' that can be called to compile MeV. |
2 |
26 Feb 07 |
jari |
The building process uses multiple targets but three main targets |
2 |
26 Feb 07 |
jari |
can be specified to control the building process. These commands can |
2 |
26 Feb 07 |
jari |
be called on the command line from within the devel/ant_script directory |
2 |
26 Feb 07 |
jari |
or from within an IDE with support for Ant. |
2 |
26 Feb 07 |
jari |
38 |
|
2 |
26 Feb 07 |
jari |
>ant build-all (or just >ant, since build-all is the default target) |
2 |
26 Feb 07 |
jari |
40 |
|
2 |
26 Feb 07 |
jari |
will build the entire code base of MeV and will produce the following |
2 |
26 Feb 07 |
jari |
jar files: |
2 |
26 Feb 07 |
jari |
43 |
|
2 |
26 Feb 07 |
jari |
1.) mev-util.jar |
2 |
26 Feb 07 |
jari |
2.) mev-algorithm-support.jar |
2 |
26 Feb 07 |
jari |
3.) mev-gui-support.jar |
2 |
26 Feb 07 |
jari |
4.) mev-base.jar |
2 |
26 Feb 07 |
jari |
48 |
|
2 |
26 Feb 07 |
jari |
5.) mev-algorithm-impl.jar //algorithm module implementation jars |
2 |
26 Feb 07 |
jari |
6.) mev-algorithm-impl.jar |
2 |
26 Feb 07 |
jari |
51 |
|
2 |
26 Feb 07 |
jari |
7.) images.jar //updates jar of org.tigr.images |
2 |
26 Feb 07 |
jari |
8.) dialogHelp.jar //updates jar of mev html help pages |
2 |
26 Feb 07 |
jari |
54 |
|
2 |
26 Feb 07 |
jari |
55 |
|
2 |
26 Feb 07 |
jari |
>ant build-base |
2 |
26 Feb 07 |
jari |
57 |
|
2 |
26 Feb 07 |
jari |
will produce the six jars that support the module implementations |
2 |
26 Feb 07 |
jari |
(jars 1-4, and 7 and 8 above). These contain utilities, basic mev classes, |
2 |
26 Feb 07 |
jari |
support classes, images, and html help pages. |
2 |
26 Feb 07 |
jari |
61 |
|
2 |
26 Feb 07 |
jari |
62 |
|
2 |
26 Feb 07 |
jari |
>ant build-modules |
2 |
26 Feb 07 |
jari |
64 |
|
2 |
26 Feb 07 |
jari |
will produce the two jars that contain the module algorithm and |
2 |
26 Feb 07 |
jari |
gui implementations (jars 5 and 6 above). These jar files are the |
2 |
26 Feb 07 |
jari |
most likely to be modified when developing a new module. |
2 |
26 Feb 07 |
jari |
68 |
|
2 |
26 Feb 07 |
jari |
69 |
|
2 |
26 Feb 07 |
jari |
Note that the output of the script execution can be redireted to |
2 |
26 Feb 07 |
jari |
an output file. (e.g. >ant build-all >output_log.txt) |
2 |
26 Feb 07 |
jari |
72 |
|
2 |
26 Feb 07 |
jari |
**See mev-jar-readme.txt in devel/devel_docs to see a description |
2 |
26 Feb 07 |
jari |
of the contents of the six jar files above. |
2 |
26 Feb 07 |
jari |
75 |
|
2 |
26 Feb 07 |
jari |
76 |
|
2 |
26 Feb 07 |
jari |
77 |
|
2 |
26 Feb 07 |
jari |
Modification/Customization of build.xml |
2 |
26 Feb 07 |
jari |
79 |
--------------------------------------- |
2 |
26 Feb 07 |
jari |
80 |
|
2 |
26 Feb 07 |
jari |
To enable inclusion of new analysis modules and features in MeV it |
2 |
26 Feb 07 |
jari |
is often necessary to modify build.xml to compile and jar the new |
2 |
26 Feb 07 |
jari |
classes. Use mev-jar-readme.txt to identify which jars should |
2 |
26 Feb 07 |
jari |
contain the new classes or packages. Modifications can be broadly |
2 |
26 Feb 07 |
jari |
placed into two main categories, 1.) features and utilities, and |
2 |
26 Feb 07 |
jari |
2.) new analysis modules. |
2 |
26 Feb 07 |
jari |
87 |
|
2 |
26 Feb 07 |
jari |
88 |
|
2 |
26 Feb 07 |
jari |
1.) Feature and Utility Enhancements |
2 |
26 Feb 07 |
jari |
90 |
-------------------------------- |
2 |
26 Feb 07 |
jari |
For feature enhancements usually the mev-base and/or support jars |
2 |
26 Feb 07 |
jari |
will be the final destination of the new classes. Within the build.xml |
2 |
26 Feb 07 |
jari |
script, roughly the first third contains targets for the compilation |
2 |
26 Feb 07 |
jari |
and jar creation of utilities, gui and algorithm support, and mev |
2 |
26 Feb 07 |
jari |
package classes. Each of these targets contains a descriptive comment |
2 |
26 Feb 07 |
jari |
listing the packages included in the compilation or build. If the |
2 |
26 Feb 07 |
jari |
work is within an existing package, build.xml might not have to change |
2 |
26 Feb 07 |
jari |
to support compilation and jar creation. If the work is in a new package, |
2 |
26 Feb 07 |
jari |
the appropriate targets should include the new package. Be sure to modify |
2 |
26 Feb 07 |
jari |
a target for compilation and a target for jar creation. |
2 |
26 Feb 07 |
jari |
101 |
|
2 |
26 Feb 07 |
jari |
Here is a sample target with comment used to compile org.tigr.util. |
2 |
26 Feb 07 |
jari |
103 |
|
2 |
26 Feb 07 |
jari |
<!-- TARGET ============================================ |
2 |
26 Feb 07 |
jari |
Target Name: util |
2 |
26 Feb 07 |
jari |
Depends: init |
2 |
26 Feb 07 |
jari |
Target Description: Compiles org/tigr/util and packages below |
2 |
26 Feb 07 |
jari |
Compilation Summary: |
2 |
26 Feb 07 |
jari |
org/tigr/util |
2 |
26 Feb 07 |
jari |
org/tigr/util/awt |
2 |
26 Feb 07 |
jari |
org/tigr/util/swing |
2 |
26 Feb 07 |
jari |
112 |
--> |
2 |
26 Feb 07 |
jari |
<target name="util" depends="init"> |
2 |
26 Feb 07 |
jari |
<javac srcdir="${tigr.dir}/util" destdir="${dest.dir}"> |
2 |
26 Feb 07 |
jari |
<classpath> |
2 |
26 Feb 07 |
jari |
<pathelement location="${lib.dir}/jai_core.jar"/> |
2 |
26 Feb 07 |
jari |
<pathelement location="${lib.dir}/jai_codec.jar"/> |
2 |
26 Feb 07 |
jari |
<pathelement location="${lib.dir}/images.jar"/> |
2 |
26 Feb 07 |
jari |
</classpath> |
2 |
26 Feb 07 |
jari |
</javac> |
2 |
26 Feb 07 |
jari |
</target> |
2 |
26 Feb 07 |
jari |
122 |
|
2 |
26 Feb 07 |
jari |
Note that all packages below org.tigr.util will be compiled. Some targets |
2 |
26 Feb 07 |
jari |
set the sourcepath attribute of the javac task to "" which effectively disables |
2 |
26 Feb 07 |
jari |
directory searching for compilation. In these instances specific classes |
2 |
26 Feb 07 |
jari |
or packages to include or exclude within the srcdir will be explicitly specified. |
2 |
26 Feb 07 |
jari |
127 |
|
2 |
26 Feb 07 |
jari |
128 |
|
2 |
26 Feb 07 |
jari |
129 |
|
2 |
26 Feb 07 |
jari |
2.) New Analysis Module Development |
2 |
26 Feb 07 |
jari |
131 |
------------------------------- |
2 |
26 Feb 07 |
jari |
132 |
|
2 |
26 Feb 07 |
jari |
Most developers will be primarily concerned with the development and integration |
2 |
26 Feb 07 |
jari |
of new analysis modules. Description of the details of interface implementation |
2 |
26 Feb 07 |
jari |
to create a new module is handled elsewhere. This document will focus on |
2 |
26 Feb 07 |
jari |
compilation and jar construction of new modules. |
2 |
26 Feb 07 |
jari |
137 |
|
2 |
26 Feb 07 |
jari |
There are three required modifications to build.xml to support compilation and |
2 |
26 Feb 07 |
jari |
jar construction of the new module. |
2 |
26 Feb 07 |
jari |
140 |
|
2 |
26 Feb 07 |
jari |
1.) Create Targets for Compilation |
2 |
26 Feb 07 |
jari |
2.) Include a new module property |
2 |
26 Feb 07 |
jari |
3.) Modify the 'algorithm-modules' and 'modules-only' targets to compile |
2 |
26 Feb 07 |
jari |
the new targets created in step 1. |
2 |
26 Feb 07 |
jari |
145 |
|
2 |
26 Feb 07 |
jari |
1.) Create targets to permit compilation of the module's algorithm class or package |
2 |
26 Feb 07 |
jari |
and the corresponding gui.impl package. This pair of targets will direct compilation |
2 |
26 Feb 07 |
jari |
of the new module. Target pairs for each module are found in the lower half of build.xml. |
2 |
26 Feb 07 |
jari |
Creation of a new target pair can be easily done by using an existing target pair as |
2 |
26 Feb 07 |
jari |
a template. The last two targets in the script are generic targets that can be |
2 |
26 Feb 07 |
jari |
modified to suite the new module. Here is an example target pair for the KMC module: |
2 |
26 Feb 07 |
jari |
152 |
|
2 |
26 Feb 07 |
jari |
<target name="KMC" depends="KMC-GUI" if="KMC"> |
2 |
26 Feb 07 |
jari |
<javac sourcepath="" srcdir="${alg.impl.dir}" destdir="${dest.dir}"> |
2 |
26 Feb 07 |
jari |
<classpath refid="module.build.class.path"/> |
2 |
26 Feb 07 |
jari |
<include name="KMC.java"/> |
2 |
26 Feb 07 |
jari |
</javac> |
2 |
26 Feb 07 |
jari |
<propertyfile file="${alg.properties.file}"> |
2 |
26 Feb 07 |
jari |
<entry key="KMC" value="org.tigr.microarray.mev.cluster.algorithm.impl.KMC"/> |
2 |
26 Feb 07 |
jari |
</propertyfile> |
2 |
26 Feb 07 |
jari |
</target> |
2 |
26 Feb 07 |
jari |
162 |
|
2 |
26 Feb 07 |
jari |
<target name="KMC-GUI"> |
2 |
26 Feb 07 |
jari |
<javac srcdir="${gui.impl.dir}/kmc" destdir="${dest.dir}"> |
2 |
26 Feb 07 |
jari |
<classpath refid="module.build.class.path"/> |
2 |
26 Feb 07 |
jari |
</javac> |
2 |
26 Feb 07 |
jari |
<propertyfile file="${gui.properties.file}"> |
2 |
26 Feb 07 |
jari |
<entry key="gui.names" value="KMC:" operation="+"/> |
2 |
26 Feb 07 |
jari |
<entry key="KMC.name" value="KMC"/> |
2 |
26 Feb 07 |
jari |
<entry key="KMC.class" value="org.tigr.microarray.mev.cluster.gui.impl.kmc.KMCGUI"/> |
2 |
26 Feb 07 |
jari |
<entry key="KMC.smallIcon" value="analysis16.gif"/> |
2 |
26 Feb 07 |
jari |
<entry key="KMC.largeIcon" value="kmc_button.gif"/> |
2 |
26 Feb 07 |
jari |
<entry key="KMC.tooltip" value="k-Means/Medians Clustering"/> |
2 |
26 Feb 07 |
jari |
</propertyfile> |
2 |
26 Feb 07 |
jari |
</target> |
2 |
26 Feb 07 |
jari |
176 |
|
2 |
26 Feb 07 |
jari |
Note that the first target compiles the algorithm while the second target shown above |
2 |
26 Feb 07 |
jari |
compiles the supporting gui implementation package. Note that the first target has the |
2 |
26 Feb 07 |
jari |
corresponding gui target in the depends attribute and the target execution (first |
2 |
26 Feb 07 |
jari |
target) has a conditional that controls execution of the target. This 'if' attribute |
2 |
26 Feb 07 |
jari |
is evaluated based on the inclusion of the target in the module properties list |
2 |
26 Feb 07 |
jari |
in step 2. Most of the changes to make to these targets involve changing package names, |
2 |
26 Feb 07 |
jari |
file paths, and property files entries. Note that in addition to compilation each module |
2 |
26 Feb 07 |
jari |
has associated properties that are entered into a 'factory.properties' file. These |
2 |
26 Feb 07 |
jari |
properties specify algorithm names, gui and algoirthm class names, button icons, and tool tips. |
2 |
26 Feb 07 |
jari |
186 |
|
2 |
26 Feb 07 |
jari |
187 |
|
2 |
26 Feb 07 |
jari |
2.) Modify the module selection properties to include the new target. Near the top |
2 |
26 Feb 07 |
jari |
of the script there are elements that list the algorithm targets to include in the build. |
2 |
26 Feb 07 |
jari |
Here is a section of this list as an example: |
2 |
26 Feb 07 |
jari |
191 |
|
2 |
26 Feb 07 |
jari |
<property name="HCL" value="y"/> |
2 |
26 Feb 07 |
jari |
<property name="ST" value="y"/> |
2 |
26 Feb 07 |
jari |
<property name="SOTA" value="y"/> |
2 |
26 Feb 07 |
jari |
<!-- <property name="RN" value="y"/> excluded from the build using comment --> |
2 |
26 Feb 07 |
jari |
<property name="KMC" value="y"/> |
2 |
26 Feb 07 |
jari |
197 |
|
2 |
26 Feb 07 |
jari |
A new property with the new module's target name should be included in this list. |
2 |
26 Feb 07 |
jari |
Any module that is commented out will be excluded from the compilation and will be |
2 |
26 Feb 07 |
jari |
absent in the MeV distribution. |
2 |
26 Feb 07 |
jari |
201 |
|
2 |
26 Feb 07 |
jari |
202 |
|
2 |
26 Feb 07 |
jari |
3.) Modify the 'algorithm-modules' target and the 'modules-only' target to include |
2 |
26 Feb 07 |
jari |
a dependency on the new module's compilation targets from step 1. These two targets |
2 |
26 Feb 07 |
jari |
are near the beginning of the script and each has a 'depends' attribute. One target |
2 |
26 Feb 07 |
jari |
is for compilation of only the modules while the other target is for base and |
2 |
26 Feb 07 |
jari |
module compilation. In both cases the depends attribute contains a list of target |
2 |
26 Feb 07 |
jari |
names in the order that they will appear in the MeV interface. To modify this, |
2 |
26 Feb 07 |
jari |
simply insert the target name of the new algorithm compilation target created in step 1. |
2 |
26 Feb 07 |
jari |
The list is comma delimited and inclusion of the new target name will place the target |
2 |
26 Feb 07 |
jari |
in the target execution tree. |
2 |
26 Feb 07 |
jari |
212 |
|
2 |
26 Feb 07 |
jari |
Here is the algorithm-modules target, one of the two targets to modify in step three above. |
2 |
26 Feb 07 |
jari |
Note the algorithm list in the depends attribute should be modified to include the new module. |
2 |
26 Feb 07 |
jari |
215 |
|
2 |
26 Feb 07 |
jari |
<target name="algorithm-modules" depends="build-base,HCL,ST,SOTA,RN,KMC,KMCS,CAST,QTC,GSH,SOM,FOM,PTM,TTEST,SAM,OWA,TFA,SVM,KNNC,DAM,GDM,PCA,TRN,EASE"> |
2 |
26 Feb 07 |
jari |
</target> |
2 |
26 Feb 07 |
jari |
218 |
|
2 |
26 Feb 07 |
jari |
219 |
|
2 |
26 Feb 07 |
jari |
220 |
|
2 |
26 Feb 07 |
jari |
221 |
|
2 |
26 Feb 07 |
jari |
222 |
|
2 |
26 Feb 07 |
jari |
223 |
|
2 |
26 Feb 07 |
jari |
224 |
|
2 |
26 Feb 07 |
jari |
225 |
|
2 |
26 Feb 07 |
jari |
226 |
|
2 |
26 Feb 07 |
jari |
227 |
|
2 |
26 Feb 07 |
jari |
228 |
|
2 |
26 Feb 07 |
jari |
229 |
|
2 |
26 Feb 07 |
jari |
230 |
|
2 |
26 Feb 07 |
jari |
231 |
|