<project name="j2ee-tutorial-examples" default="about" basedir="."> <target name="init"> <tstamp/> <property name="build" value="build" /> <property name="src" value="src" /> <property name="hello1" value="web/hello1" /> <property name="hello2" value="web/hello2" /> <property name="date" value="web/date" /> <property name="bookstore1" value="web/bookstore1" /> <property name="bookstore2" value="web/bookstore2" /> <property name="bookstore3" value="web/bookstore3" /> <property name="webejb" value="web/ejb" /> <property name="webejbpath" value="${build}/web/ejb" /> <property name="websql" value="sql" /> <property name="ejb" value="ejb" /> <property name="ejbsql" value="sql" /> <property name="connector" value="connector" /> <property name="connectorsql" value="sql" /> <property environment="myenv" /> <property name="j2eepath" value="${myenv.J2EE_HOME}/lib/j2ee.jar" /> <property name="webpath" value="${webejb}" /> <property name="connector-lib" value="${myenv.J2EE_HOME}/lib/connector" /> <property name="cloud-lib" value="${myenv.J2EE_HOME}/lib/cloudscape" /> <property name="system-lib" value="${myenv.J2EE_HOME}/lib/system" /> <property name="cloudpath" value=".:${cloud-lib}/cloudclient.jar:${cloud-lib}/RmiJdbc.jar:${system-lib}/cloudutil.jar:${system-lib}/cloudscape.jar" /> <property name="cloud-jvmargs" value="-ms16m -mx32m -Dij.connection.CloudscapeDB=jdbc:rmi://localhost:1099/jdbc:cloudscape:CloudscapeDB;create=true -Dcloudscape.system.home=${myenv.J2EE_HOME}/cloudscape" /> </target> <target name="prepare" depends="init"> <mkdir dir="${build}" /> </target> <target name="clean" depends="init"> <delete dir="${build}" /> </target> <target name="all" depends="init,ejb,web"> </target> <target name="ejb" depends="init, savingsaccount, bank, cart, checker, confirmer, converter, enroller, order, salesrep, storagebin, teller, htmlreader, warehouse, simplemessage, cmproster" > <chmod perm="go+r" type="both"> <fileset dir=".." /> </chmod> </target> <target name="savingsaccount" depends="init"> <mkdir dir="${build}/${ejb}/savingsaccount" /> <javac srcdir="${src}/${ejb}/savingsaccount" destdir="${build}/${ejb}/savingsaccount" classpath="${j2eepath}" /> </target> <target name="bank" depends="init"> <mkdir dir="${build}/${ejb}/bank" /> <javac srcdir="${src}/${ejb}/bank" destdir="${build}/${ejb}/bank" classpath="${j2eepath}" /> </target> <target name="cart" depends="init"> <mkdir dir="${build}/${ejb}/cart" /> <javac srcdir="${src}/${ejb}/cart" destdir="${build}/${ejb}/cart" classpath="${j2eepath}" /> </target> <target name="checker" depends="init"> <mkdir dir="${build}/${ejb}/checker" /> <javac srcdir="${src}/${ejb}/checker" destdir="${build}/${ejb}/checker" classpath="${j2eepath}" /> </target> <target name="confirmer" depends="init"> <mkdir dir="${build}/${ejb}/confirmer" /> <javac srcdir="${src}/${ejb}/confirmer" destdir="${build}/${ejb}/confirmer" classpath="${j2eepath}" /> </target> <target name="converter" depends="init"> <mkdir dir="${build}/${ejb}/converter" /> <javac srcdir="${src}/${ejb}/converter" destdir="${build}/${ejb}/converter" classpath="${j2eepath}" /> <copy todir="${build}/${ejb}/converter" > <fileset dir="${src}/${ejb}/converter" > <include name="**/*.jsp" /> </fileset> </copy> </target> <target name="enroller" depends="init"> <mkdir dir="${build}/${ejb}/enroller" /> <javac srcdir="${src}/${ejb}/enroller" destdir="${build}/${ejb}/enroller" classpath="${j2eepath}" /> </target> <target name="order" depends="init"> <mkdir dir="${build}/${ejb}/order" /> <javac srcdir="${src}/${ejb}/order" destdir="${build}/${ejb}/order" classpath="${j2eepath}" /> </target> <target name="salesrep" depends="init"> <mkdir dir="${build}/${ejb}/salesrep" /> <javac srcdir="${src}/${ejb}/salesrep" destdir="${build}/${ejb}/salesrep" classpath="${j2eepath}" /> </target> <target name="storagebin" depends="init"> <mkdir dir="${build}/${ejb}/storagebin" /> <javac srcdir="${src}/${ejb}/storagebin" destdir="${build}/${ejb}/storagebin" classpath="${j2eepath}" /> </target> <target name="teller" depends="init"> <mkdir dir="${build}/${ejb}/teller" /> <javac srcdir="${src}/${ejb}/teller" destdir="${build}/${ejb}/teller" classpath="${j2eepath}" /> </target> <target name="htmlreader" depends="init"> <mkdir dir="${build}/${ejb}/htmlreader" /> <javac srcdir="${src}/${ejb}/htmlreader" destdir="${build}/${ejb}/htmlreader" classpath="${j2eepath}" /> </target> <target name="warehouse" depends="init"> <mkdir dir="${build}/${ejb}/warehouse" /> <javac srcdir="${src}/${ejb}/warehouse" destdir="${build}/${ejb}/warehouse" classpath="${j2eepath}" /> </target> <target name="simplemessage" depends="init"> <mkdir dir="${build}/${ejb}/simplemessage" /> <javac srcdir="${src}/${ejb}/simplemessage" destdir="${build}/${ejb}/simplemessage" classpath="${j2eepath}" /> </target> <target name="cmproster" depends="init"> <mkdir dir="${build}/${ejb}/cmproster" /> <mkdir dir="${build}/${ejb}/cmproster/client" /> <mkdir dir="${build}/${ejb}/cmproster/roster" /> <mkdir dir="${build}/${ejb}/cmproster/team" /> <mkdir dir="${build}/${ejb}/cmproster/util" /> <javac srcdir="${src}/${ejb}/cmproster" destdir="${build}/${ejb}/cmproster" classpath="${j2eepath}" /> </target> <target name="web" depends="init, date, hello1, hello2, bookstore1, bookstore2, bookstore3" > <chmod perm="go+r" type="both"> <fileset dir=".." /> </chmod> </target> <target name="date" depends="init"> <mkdir dir="${build}/${date}" /> <copy todir="${build}/${date}" > <fileset dir="${src}/${date}" > <exclude name="**/*.java" /> <exclude name="**/*.txt" /> </fileset> </copy> <javac srcdir="${src}/${date}" destdir="${build}/${date}" classpath="${j2eepath}" /> </target> <target name="hello1" depends="init"> <mkdir dir="${build}/${hello1}" /> <copy todir="${build}/${hello1}" > <fileset dir="${src}/${hello1}" > <exclude name="**/*.java" /> <exclude name="**/*.txt" /> </fileset> </copy> <javac srcdir="${src}/${hello1}" destdir="${build}/${hello1}" classpath="${j2eepath}" /> </target> <target name="hello2" depends="init"> <mkdir dir="${build}/${hello2}" /> <copy todir="${build}/${hello2}" > <fileset dir="${src}/${hello2}" > <exclude name="**/*.java" /> <exclude name="**/*.txt" /> </fileset> </copy> </target> <target name="bookstore1" depends="init"> <mkdir dir="${build}/${bookstore1}" /> <copy todir="${build}/${bookstore1}" > <fileset dir="${src}/${bookstore1}" > <exclude name="**/*.java" /> <exclude name="**/*.txt" /> </fileset> </copy> <javac srcdir="${src}/${bookstore1}" destdir="${build}/${bookstore1}" classpath="${j2eepath}" > <include name="**/*.java" /> </javac> </target> <target name="bookstore2" depends="init,web-ejb"> <mkdir dir="${build}/${bookstore2}" /> <copy todir="${build}/${bookstore2}" > <fileset dir="${src}/${bookstore2}" > <exclude name="**/*.java" /> <exclude name="**/*.txt" /> </fileset> </copy> <javac srcdir="${src}/${bookstore2}" destdir="${build}/${bookstore2}" classpath="${j2eepath}:${webejbpath}"> <include name="**/*.java" /> </javac> <war warfile="${build}/${bookstore2}/bookstore2.war" webxml="${build}/${bookstore2}/web.xml"> <fileset dir="${build}/${bookstore2}" > <exclude name="util/**" /> <exclude name="database/**" /> <exclude name="cart/**" /> <exclude name="messages/**" /> <exclude name="web.xml" /> <exclude name="bookstore2.war" /> <exclude name="Bookstore2App.ear" /> <exclude name="ejb_temp*.jar" /> <exclude name="web_temp*.war" /> </fileset> <classes dir="${build}/${bookstore2}" > <include name="util/*.class" /> <include name="database/*.class" /> <include name="cart/*.class" /> <include name="messages/*.class" /> </classes> </war> </target> <target name="bookstore3" depends="init,web-ejb"> <mkdir dir="${build}/${bookstore3}" /> <copy todir="${build}/${bookstore3}" > <fileset dir="${src}/${bookstore3}" > <exclude name="**/*.java" /> <exclude name="**/*.txt" /> </fileset> </copy> <javac srcdir="${src}/${bookstore3}" destdir="${build}/${bookstore3}" classpath="${j2eepath}:${webejbpath}" > <include name="**/*.java" /> </javac> </target> <target name="web-ejb" depends="init"> <mkdir dir="${build}/${webejb}" /> <javac srcdir="${src}/${webejb}" destdir="${build}/${webejb}" classpath="${j2eepath}" /> </target> <target name="create-web-db" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes" > <jvmarg line="${cloud-jvmargs}" /> <arg value="${websql}/books.sql" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-bank-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes" > <jvmarg line="${cloud-jvmargs}" /> <arg value="${ejbsql}/bank.sql" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-enroller-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes" > <jvmarg line="${cloud-jvmargs}" /> <arg value="${ejbsql}/enroller.sql" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-savingsaccount-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes"> <arg value="${ejbsql}/savingsaccount.sql" /> <jvmarg line="${cloud-jvmargs}" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-order-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes" > <arg value="${ejbsql}/order.sql" /> <jvmarg line="${cloud-jvmargs}" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-salesrep-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes"> <arg value="${ejbsql}/salesrep.sql" /> <jvmarg line="${cloud-jvmargs}" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-storagebin-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes"> <arg value="${ejbsql}/storagebin.sql" /> <jvmarg line="${cloud-jvmargs}" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-teller-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes"> <arg value="${ejbsql}/teller.sql" /> <jvmarg line="${cloud-jvmargs}" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-warehouse-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes"> <arg value="${ejbsql}/warehouse.sql" /> <jvmarg line="${cloud-jvmargs}" /> <classpath path="${cloudpath}" /> </java> </target> <target name="create-ejb-db" depends="init, create-bank-table, create-enroller-table, create-savingsaccount-table, create-order-table, create-salesrep-table, create-storagebin-table, create-teller-table, create-warehouse-table"> </target> <target name="get-cci-jar" depends="init"> <mkdir dir="${build}/${connector}/archive" /> <unzip src="${connector-lib}/cciblackbox-tx.rar" dest="${build}/${connector}/archive" /> </target> <target name="procs" depends="init, get-cci-jar"> <mkdir dir="${build}/${connector}/procs" /> <javac srcdir="${src}/${connector}/procs" destdir="${build}/${connector}/procs" classpath="${j2eepath};${build}/${connector}/archive/cciblackbox-tx.jar" /> <echo message="Reminder: Add the classpath for the ${build}/${connector}/procs/Procs.class to the J2EE_HOME variable in bin/userconfig.sh (UNIX) or bin\userconfig.bat (Windows) and restart the Cloudscape server." /> </target> <target name="create-procs-alias" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes" jvmargs="${cloud-jvmargs}" args="${connectorsql}/procs.sql" > <classpath path="${cloudpath}" /> </java> </target> <target name="create-coffee-table" depends="init"> <java classname="COM.cloudscape.tools.ij" fork="yes" jvmargs="${cloud-jvmargs}" args="${connectorsql}/coffee.sql" > <classpath path="${cloudpath}" /> </java> </target> <target name="cci" depends="init, get-cci-jar"> <mkdir dir="${build}/${connector}/cci" /> <javac srcdir="${src}/${connector}/cci" destdir="${build}/${connector}/cci" classpath="${j2eepath};${build}/${connector}/archive/cciblackbox-tx.jar" /> </target> <target name="connector" depends="init, procs, cci" > <chmod perm="go+r" type="both"> <fileset dir=".." /> </chmod> </target> <target name="about" > <echo> This build.xml file contains targets for all of the J2EE Tutorial examples except for the Duke's Bank Application. The targets are documented along with the examples in various chapters. The Getting Started chapter, for example, instructs the reader to run ant converter. </echo> </target> </project>