#!/bin/sh

#
# Main build script for the MOA projects
#
# Author: Paul Ivancsics
# Version: $Id: build.sh,v 1.13 2003/05/07 18:52:02 peck Exp $
#


PROJECTS=$1
ALLPROJECTS="common spss.server id.server"

shift
TARGETS=$*

if [ -z "$JAVA_HOME" ]; then 
  echo "error: JAVA_HOME not defined";
  exit;
fi

if [ -z "$PROJECTS" ] || [ "$PROJECTS" = "all" ]; then
  PROJECTS=$ALLPROJECTS;
elif ! [ "$PROJECTS" = "common" ]; then
  PROJECTS="common $PROJECTS";
fi

echo
echo "BUILDING PROJECT(S): $PROJECTS"
echo "BUILDING TARGET(S) : $TARGETS"

for PROJ in $PROJECTS; do 
  sh ./runAnt.sh $PROJ $TARGETS;
done