Anteater Updating System | print-friendly |
by Jeff Turner
Updating Anteater
Anteater 0.9.13 and above comes with a simple Ant-based system for upgrading an Anteater installation. This upgrading system can be used to:
- Install new Anteater tasks, like the Jelly task
- Install new XML schemas, in order to validate new XML types
- Get the latest Anteater patches and bugfixes
- Upgrade Anteater to the latest version
By running the 'anteater-update' script, one is presented with a list of Anteater upgrades available online:
print-updates: Name: jelly Description: Adds the ability for most Anteater tasks to have dynamically created content Installed: false Name: rng-schemas Description: Install a selection of useful Relax NG schemas Installed: false Name: xhtml-schema Description: Install XHTML Relax NG schemas Installed: false get-selection: Enter name of update to install:(jelly,rng-schemas,xhtml-schema,none)
One then selects the update to apply. The update script is downloaded from the updates repository and is run. For example:
get-selection: Enter name of update to install:(jelly,rng-schemas,xhtml-schema,none) jelly install-selection: Created dir: /home/jeff/sf/Anteater/build/anteater-0.9.13/resources/scripts/updates Getting: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/aft/Anteater/resources/ scripts/updates/jelly-install.xml?rev=HEAD&content-type=text/xml Created dir: /home/jeff/sf/Anteater/build/anteater-0.9.13/tmp choose-repos: -------------------------------------- Anteater Jelly support Installer This update allows Anteater tasks that have nested content to have it dynamically generated via a Jelly script. -------------------------------------- Please enter the URL of a Maven-style repository to download Jelly from: [http://www.ibiblio.org/maven] Using repository http://www.ibiblio.org/maven... get: -------------------------------------- Trying to fetch jars required by Jelly. From: http://www.ibiblio.org/maven To: /home/jeff/sf/Anteater/build/anteater-0.9.13/lib -------------------------------------- Getting: http://www.ibiblio.org/maven/commons-grant/jars/commons-grant-1.0-beta-4.jar Checksum matches: true Getting: http://www.ibiblio.org/maven/commons-cli/jars/commons-cli-SNAPSHOT.jar Checksum matches: true Getting: http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.1.jar Checksum matches: true .........
If this process completes successfully, one should see a message like:
Finished installing upgrade 'jelly'
Alternatively, one can just specify the update to apply from the command-line, for example anteater-update xhtml-schema, in which case the whole process typically requires no further user interaction.
Specifying a required update
A script may declare a dependency on an optional feature with the uses tag. For example, a script that needs the 'jelly' upgrade would have:
<group id="default"> .... <uses> <feature name="jelly"/> <!-- Need 'jelly' optional feature --> </uses> </group>
If a user tried to run this script on an Anteater installation lacking the 'jelly' upgrade, they would see something like this:
[~/examples]$ anteater -f jelly.xml Anteater 0.9.14 Buildfile: jelly.xml jelly: BUILD FAILED file:/home/jeff/sf/Anteater/examples/jelly.xml:19: Missing feature: Anteater feature 'jelly' not present. Please run 'anteater-update jelly' to install this feature, or just 'anteater-update' to list all features available for download. Total time: 3 seconds