| 1 |
Prototype Plugin |
| 2 |
|
| 3 |
The goal is to develop a framework for external developers to develop modules |
| 4 |
that augment the functionality of BEAST. The developer would be able to produce |
| 5 |
a small jar for users to download. Then referencing the plugin's objects in a |
| 6 |
BEAST XML input would be sufficient to use the plugin -- BEAST itself should not |
| 7 |
need to be recompiled. |
| 8 |
|
| 9 |
== Creating a stub == |
| 10 |
If you have python installed, then you can run generate_stub.py for example: |
| 11 |
|
| 12 |
$ python generate_stub.py -x elname -p beastplugin.test -c testPlugin |
| 13 |
|
| 14 |
To generate the stub for beastplugin.test.testPlugin that provides a parser for |
| 15 |
the <elname /> xml elements in BEAST's input. |
| 16 |
|
| 17 |
|
| 18 |
== Configuring your build env == |
| 19 |
To use ant, you will need to create a beast_sdk.properties file that defines |
| 20 |
the beast.root for your machine. You can copy beast_sdk.properties.in to |
| 21 |
beast_sdk.properties and then edit that file. The value for boost.root will |
| 22 |
the path on your filesystem where you checked out: |
| 23 |
http://beast-mcmc.googlecode.com/svn/trunk |
| 24 |
|
| 25 |
(Shell commands in this document will use BEAST_ROOT to refer to this path, but |
| 26 |
you do not need to modify your shell's environment to build a plugin -- this is |
| 27 |
just a convention for these instructions). |
| 28 |
|
| 29 |
== Building beast.jar == |
| 30 |
To build a plugin the beast.jar must be up-to-date. |
| 31 |
|
| 32 |
$ cd ${BEAST_ROOT} |
| 33 |
$ ant -f build_BEAST_MCMC.xml build_jar_all_BEAST_NoJUnitTest |
| 34 |
|
| 35 |
You should then have the file: |
| 36 |
${BEAST_ROOT}/build/dist/beast.jar |
| 37 |
|
| 38 |
|
| 39 |
== Building the plugin == |
| 40 |
|
| 41 |
$ ant build |
| 42 |
|
| 43 |
== Installing the plugin == |
| 44 |
This target copies the jar for the plugin into $BEAST_ROOT/plugins |
| 45 |
|
| 46 |
$ ant install |
| 47 |
|
| 48 |
== Testing the installed plugin == |
| 49 |
This target checks that plugin integrates with BEAST. |
| 50 |
|
| 51 |
Note: that for Beast to find the plugin when you invoke it from an external |
| 52 |
directory. This target uses a -Dbeast.plugins.dir=${beast.root}/plugins argument |
| 53 |
to java so that the plugins directory will be found |
| 54 |
|
| 55 |
$ ant test-install |
| 56 |
|
| 57 |
This will create a use the XML instance document in your plugin's example |
| 58 |
directory to test that the plug in is being used. Note that the simple Plugin |
| 59 |
Template used to generate your stub has a parser that creates an HKY model as |
| 60 |
your plugin's object. As you write your Plugin, you'll modify the code |
| 61 |
(obviously), but you will also need to update the example xml document if you |
| 62 |
want the test-install target to work. |