Recall Sample Application
-------------------------

This is a sample application designed to demonstrate a variety of
project layout and build automation schemes.

- Derek Konigsberg <dkonigsberg@logicprobe.org>

******************************************************************************

If using Bitten (http://bitten.edgewall.org/) to automate your build process,
the following is an example build recipe:

----------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<build
    xmlns:python="http://bitten.cmlenz.net/tools/python" 
    xmlns:svn="http://bitten.cmlenz.net/tools/svn" 
    xmlns:java="http://bitten.cmlenz.net/tools/java"
    xmlns:sh="http://bitten.cmlenz.net/tools/sh">
  <step id="svn checkout" description="Checkout code from repository">
    <svn:checkout
        url="http://svn.example.com/svnroot/recall"
        path="${path}"
        revision="${revision}"/>
  </step>
  <step id="build" description="Build the application">
    <java:ant
        file="build.xml"
        target="build"
        args="-Dmodule.build=${build} -Djde450.home=/export/bitten/recall/support/JDE_450 -Djde460.home=/export/bitten/recall/support/JDE_460 -Djde500.home=/export/bitten/recall/support/JDE_500"/>
  </step>
  <step id="sign" onerror="continue" description="Sign the application">
    <java:ant
        file="build.xml"
        target="sign"
        args="-Dmodule.build=${build} -Dsigtool.password=12345678 -Djde450.home=/export/bitten/recall/support/JDE_450 -Djde460.home=/export/bitten/recall/support/JDE_460 -Djde500.home=/export/bitten/recall/support/JDE_500"/>
  </step>
  <step id="package" description="Package for distribution">
    <java:ant file="build.xml"
        target="dist"
        args="-Dmodule.build=${build} -Djde450.home=/export/bitten/recall/support/JDE_450 -Djde460.home=/export/bitten/recall/support/JDE_460 -Djde500.home=/export/bitten/recall/support/JDE_500"/>
  </step>
  <step id="post" description="Post the artifacts for download">
    <sh:exec file="/export/bitten/recall/support/post-build.sh" args="${build} ."/>
  </step>
</build>
----------------------------------------------------------------------------

And the "post-build.sh" shell script:

----------------------------------------------------------------------------
#!/usr/bin/bash
DIR=`pwd`
BUILD_NUMBER=`echo $1 | awk '{printf "%04d", $0}'`
BUILD_PATH=$2
ARTIFACTS_BASE="/export/bitten/recall/artifacts"
DATESTAMP=`date '+%Y-%m-%d'`
ARTIFACTS_DIR="$ARTIFACTS_BASE/$DATESTAMP-$BUILD_NUMBER"

# Create the output directory
if [ -a "$ARTIFACTS_DIR" ]; then
    rm -rf "$ARTIFACTS_DIR"
fi
mkdir $ARTIFACTS_DIR

# Copy the artifacts and unzip the OTA files
cp $BUILD_PATH/*.zip $ARTIFACTS_DIR
cd $ARTIFACTS_DIR
unzip recall-ota-?.?.?.zip
rm recall-ota-?.?.?.zip

# Redirect the latest symlink
cd $ARTIFACTS_BASE
if [ -a "latest" ]; then
    rm "latest"
fi
ln -s $DATESTAMP-$BUILD_NUMBER latest
cd $DIR
----------------------------------------------------------------------------
