#!/bin/sh

# Copyright (c) 2000 BEA Systems, Inc. All Rights Reserved.

# Adjust these variables to match your environment
JAVA_HOME=${JAVA_HOME:-"/usr/lib/java"}
WL_HOME=${WL_HOME:-"/weblogic"}
MYSERVER="$WL_HOME/myserver"

# UNIX or DOS conventions
if [ -w /dev/null ]
then
  MYCLASSPATH="$JAVA_HOME/lib/classes.zip:$WL_HOME/classes:$WL_HOME/lib/weblogicaux.jar:$MYSERVER/clientclasses"
else
  MYCLASSPATH="$JAVA_HOME/lib/classes.zip;$WL_HOME/classes;$WL_HOME/lib/weblogicaux.jar;$MYSERVER/clientclasses"
fi

# Create the build directory, and copy the deployment descriptors into it
mkdir -p build build/META-INF
cp -f ejb-jar.xml weblogic-ejb-jar.xml build/META-INF

# Compile ejb classes into the build directory (jar preparation)
javac -d build -classpath $MYCLASSPATH Account.java AccountHome.java ProcessingErrorException.java AccountBean.java

# Make a standard ejb jar file, including XML deployment descriptors
(cd build; jar cv0f std_ejb_extensions_finderEnumeration.jar META-INF examples)

# Run ejbc to create the deployable jar file
java -classpath $MYCLASSPATH \
   -Dweblogic.home=$WL_HOME weblogic.ejbc \
    -compiler javac build/std_ejb_extensions_finderEnumeration.jar \
    $MYSERVER/ejb_extensions_finderEnumeration.jar

# Compile ejb interfaces & client app into the clientclasses directory
javac -d $MYSERVER/clientclasses -classpath $MYCLASSPATH Account.java AccountHome.java ProcessingErrorException.java Client.java

