Update of /cvsroot/jpox/JPOX/jdo-tools/bookants
In directory sc8-pr-cvs1:/tmp/cvs-serv816/bookants
Modified Files:
jpox.xml
Added Files:
tomcat.xml
Log Message:
Add support for
- statetracker
- rental-gui
- rental-servlet
--- NEW FILE: tomcat.xml ---
<!--
Copyright (c) 2002 Yankee Software.
This file is part of the JDO Learning Tools
The JDO Learning Tools is free software; you can use it, redistribute it,
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The JDO Learning Tools software is distributed in the hope that it
will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
A copy of the GPL Version 2 is contained in LICENSE.TXT in this source
distribution. If you cannot find LICENSE.TXT, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA or visit http://www.fsf.org on the web.
Copyright law and the license agreement do not apply to your
understanding of the the concepts, principles, and practices embedded
in this code. The purpose of the JDO Learning Tools to to help
advance the use and understanding of Java Data Objects, the standard
for transparent persistence for Java objects from the Java Community
Process.
Change History:
Please insert a brief record of any changes made.
Author Date Purpose
=================+==========+===================================
David Ezzio 09/01/02 Created
-->
<!-- This build is specific to the Tomcat 4.0 Servlet container -->
<project name="JDO Book Examples Ant Script: subscripts specific to Tomcat" default="Help" basedir=".">
<fileset dir="${build.dir}" id="build-fileset-servlet" >
<include name="${book.path}/common/exceptions/*.class" />
<include name="${book.path}/common/*.class" />
<include name="${book.path}/rental/persistent/*.jdo" />
<include name="${book.path}/rental/service/*.class" />
<include name="${book.path}/rental/servlet/service/*.class" />
<include name="${book.path}/rental/servlet/util/*.class" />
<include name="${book.path}/rental/servlet/beans/*.class" />
<include name="${book.path}/rental/servlet/${servlet-design}/*.class" />
</fileset>
<fileset dir="${enhanced.dir}" id="enhanced-fileset-servlet" >
<include name="${book.path}/rental/**/*" />
<exclude name="${book.path}/rental/**/*.txt" />
</fileset>
<fileset dir="${build.dir}" id="build-fileset-ejb" >
<include name="${book.path}/rental/servlet/util/*.class" />
<include name="${book.path}/rental/servlet/${servlet-design}/*.class" />
</fileset>
<fileset dir="${enhanced.dir}" id="enhanced-fileset-ejb" >
<include name="none" />
</fileset>
<target name="Help" >
<echo message="This build script is not called directly. The main script is build.xml" />
</target>
<target name="find-Tomcat" >
<echo message="checking: ${tomcat.home}/server/lib/tomcat-util.jar" />
<available property="found.Tomcat" file="${tomcat.home}/server/lib/tomcat-util.jar" />
</target>
<target name="die-without-Tomcat" depends="find-Tomcat" unless="found.Tomcat" >
<fail message="Tomcat is not installed or default.properties is not configured" />
</target>
<target name="rental" depends="die-without-Tomcat" >
<echo message="Building war file for servlet design: ${servlet-design}" />
<exec dir="${tomcat.home}/bin" os="Windows 2000,Windows NT" executable="cmd.exe" >
<arg line="/c shutdown.bat"/>
</exec>
<exec dir="${tomcat.home}/bin" os="Linux,HP-UX,SunOS,Solaris,AIX" executable="${tomcat.home}/bin/shutdown.sh" />
<!-- construct the directory structure in warfiles -->
<copy todir="warfiles" >
<fileset dir="${book.path}/rental/servlet/jsp">
<include name="*.jsp" />
</fileset>
</copy>
<mkdir dir="warfiles/WEB-INF" />
<copy todir="warfiles/WEB-INF" >
<fileset dir="${book.path}/rental/servlet/misc">
<include name="web.xml" />
<include name="c.tld" />
</fileset>
<fileset dir="temp" >
<include name="jndi.properties" />
</fileset>
</copy>
<replace file="warfiles/WEB-INF/web.xml" token="{ANT-VAR}" value="${servlet-design}" />
<mkdir dir="warfiles/WEB-INF/classes" />
<copy todir="warfiles/WEB-INF/classes" >
<fileset refid="${build-fileset}" />
<fileset refid="${enhanced-fileset}" />
</copy>
<copy todir="warfiles/WEB-INF/classes/${book.path}/rental/servlet/service" >
<mapper type="glob" from="${jdo.tool}*.properties" to="factory*.properties" />
<fileset dir="${book.path}/rental/servlet/${servlet-design}" >
<include name="${jdo.tool}*.properties" />
</fileset>
</copy>
<copy file="${book.path}/common/servlet/package.properties"
tofile="warfiles/WEB-INF/classes/${book.path}/common/package.properties" />
<mkdir dir="warfiles/images" />
<copy todir="warfiles/images" >
<fileset dir="doc/images" >
<include name="*.jpg" />
</fileset>
</copy>
<!-- pick up EJB client jars that may be here -->
<copy todir="warfiles/web-inf/lib" >
<fileset dir="temp" includes="*.jar" />
</copy>
<delete>
<fileset dir="temp" >
<patternset>
<include name="*.*"/>
<exclude name="keepme.txt" />
</patternset>
</fileset>
</delete>
<!-- sleep long enough for shutdown of Tomcat to take place -->
<sleep seconds="10" />
<delete dir="${tomcat.home}/webapps/rental" />
<mkdir dir="${tomcat.home}/webapps/rental" />
<copy todir="${tomcat.home}/webapps/rental" >
<fileset dir="warfiles">
<include name="**/*" />
</fileset>
</copy>
<echo message="You'll have to restart Tomcat" />
</target>
<target name="rental-servlet" >
<property name="build-fileset" value="build-fileset-servlet" />
<property name="enhanced-fileset" value="enhanced-fileset-servlet" />
<antcall target="rental" />
</target>
<target name="rental-servlet-ejb" >
<copy todir="temp" file="clientjars/reservationclient.jar" />
<copy todir="temp" file="resources/jndi.properties" />
<!-- <echo message="In tomcat.xml:rental-servlet-ejb" /> -->
<property name="build-fileset" value="build-fileset-ejb" />
<property name="enhanced-fileset" value="enhanced-fileset-ejb" />
<antcall target="rental" />
</target>
</project>
Index: jpox.xml
===================================================================
RCS file: /cvsroot/jpox/JPOX/jdo-tools/bookants/jpox.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** jpox.xml 27 Aug 2003 11:27:27 -0000 1.2
--- jpox.xml 28 Aug 2003 13:43:49 -0000 1.3
***************
*** 38,41 ****
--- 38,42 ----
<project name="JDO Book Examples Ant Script: subscripts specific to JPOX" default="Help" basedir=".">
+ <property name="jpox.version" value="1.0.0-alpha" />
<property name="enhancer.tool" value="org.jpox.enhance.SunReferenceEnhancer" />
<property name="jdo.jar" value="${jdo.home}/lib/jdo.jar" />
***************
*** 44,48 ****
<path id="jpox-path-id">
<pathelement location="${jdo.jar}" />
! <pathelement location="${jdo.home}/target/jpox-1.0.0-alpha.jar" />
<pathelement location="${jdo.home}/lib/jdori.jar" />
<pathelement location="${jdo.home}/lib/log4j.jar" />
--- 45,49 ----
<path id="jpox-path-id">
<pathelement location="${jdo.jar}" />
! <pathelement location="${jdo.home}/target/jpox-${jpox.version}.jar" />
<pathelement location="${jdo.home}/lib/jdori.jar" />
<pathelement location="${jdo.home}/lib/log4j.jar" />
***************
*** 127,130 ****
--- 128,138 ----
</condition>
+ <condition property="script.comment" value="REM" >
+ <os family="windows" />
+ </condition>
+ <condition property="script.comment" value="#" >
+ <os family="unix" />
+ </condition>
+
</target>
***************
*** 196,200 ****
<echo file="${megacups.script.name}" >${script.line1}
java -cp ${run.classpath} com.ysoft.jdo.book.coffee.MegaCups ${script.args}
! </echo>
</target>
--- 204,209 ----
<echo file="${megacups.script.name}" >${script.line1}
java -cp ${run.classpath} com.ysoft.jdo.book.coffee.MegaCups ${script.args}
! </echo>
! <chmod file="${megacups.script.name}" perm="u+x" />
</target>
***************
*** 237,240 ****
--- 246,250 ----
java -cp ${run.classpath} com.ysoft.jdo.book.library.client.Library ${script.args}
</echo>
+ <chmod file="${library.script.name}" perm="u+x" />
</target>
***************
*** 244,258 ****
<ant antfile="${book.path}/statetracker/build.xml" />
<echo message="returned from ${book.path}/statetracker/build.xml" />
!
! <!-- for 1.0 -->
! <copy file="${book.path}/statetracker/jpox/statetracker.ri"
! tofile="${build.dir}/${book.path}/statetracker.jdo"/>
! <copy file="${book.path}/statetracker/jpox/statetracker.ri"
! tofile="${enhanced.dir}/${book.path}/statetracker.jdo"/>
! <!-- for 1.0.1 -->
! <copy file="${book.path}/statetracker/jpox/statetracker.ri"
! tofile="${build.dir}/${book.path}/statetracker/package.jdo"/>
! <copy file="${book.path}/statetracker/jpox/statetracker.ri"
! tofile="${enhanced.dir}/${book.path}/statetracker/package.jdo"/>
<!-- use the enhancer tool -->
--- 254,262 ----
<ant antfile="${book.path}/statetracker/build.xml" />
<echo message="returned from ${book.path}/statetracker/build.xml" />
! <copy todir="${build.dir}/${book.path}/statetracker/">
! <fileset dir="${book.path}/statetracker/jpox" >
! <include name="*.jdo" />
! </fileset>
! </copy>
<!-- use the enhancer tool -->
***************
*** 261,281 ****
<!-- uncomment the next line to see tons of output -->
<!-- <arg value="-v" /> -->
! <arg line="-s ${build.dir};${jdo.jar} -d ${enhanced.dir}" />
! <arg value="com.ysoft.jdo.book.statetracker.Apple" />
! <arg value="com.ysoft.jdo.book.statetracker.Worm" />
</java>
! <echo message="creating runStatetracker.bat" />
! <echo file="runStatetracker.bat" >
! REM Build generated macro to run the statetracker example
! REM
! REM Without a command line parameter, this test uses the JPOX
! REM adaptor in the com.ysoft.jdo.book.factory.ri.JPOXAdaptor
! REM class. To override, specify as a command line argument,
! REM the adaptor class desired.
! REM
! java -cp ${run.classpath} com.ysoft.jdo.book.statetracker.client.StateTracker %1
</echo>
</target>
--- 265,287 ----
<!-- uncomment the next line to see tons of output -->
<!-- <arg value="-v" /> -->
! <arg line=" -d ${enhanced.dir}" />
! <arg value="${build.dir}/${book.path}/statetracker/Apple.jdo" />
! <arg value="${build.dir}/${book.path}/statetracker/Worm.jdo" />
</java>
! <condition property="statetracker.script.name" value="runStateTracker.bat" >
! <os family="windows" />
! </condition>
! <condition property="statetracker.script.name" value="runStateTracker" >
! <os family="unix" />
! </condition>
!
! <echo message="creating ${statetracker.script.name}" />
!
! <echo file="${statetracker.script.name}" >${script.line1}
! java -cp ${run.classpath} com.ysoft.jdo.book.statetracker.client.StateTracker com.ysoft.jdo.book.factory.jpox.JPOXAdaptor
</echo>
+
</target>
***************
*** 284,300 ****
<ant antfile="${book.path}/rental/local/build.xml" />
<echo message="returned from ${book.path}/rental/local/build.xml" />
! <copy file="${book.path}/rental/local/jpox.properties"
tofile="${build.dir}/${book.path}/rental/persistent/factory.properties"/>
!
! <!-- for 1.0 -->
! <copy file="${book.path}/rental/persistent/local/persistent.jdo"
! tofile="${build.dir}/${book.path}/rental/persistent.jdo"/>
! <copy file="${book.path}/rental/persistent/local/persistent.jdo"
! tofile="${enhanced.dir}/${book.path}/rental/persistent.jdo"/>
! <!-- for 1.0.1 -->
! <copy file="${book.path}/rental/persistent/local/persistent.jdo"
! tofile="${build.dir}/${book.path}/rental/persistent/package.jdo"/>
! <copy file="${book.path}/rental/persistent/local/persistent.jdo"
! tofile="${enhanced.dir}/${book.path}/rental/persistent/package.jdo"/>
<!-- use the enhancer tool -->
--- 290,300 ----
<ant antfile="${book.path}/rental/local/build.xml" />
<echo message="returned from ${book.path}/rental/local/build.xml" />
! <copy file="${book.path}/factory/jpox/jpox.properties"
tofile="${build.dir}/${book.path}/rental/persistent/factory.properties"/>
! <copy todir="${build.dir}/${book.path}/rental/persistent">
! <fileset dir="${book.path}/rental/persistent/local/jpox" >
! <include name="*.jdo" />
! </fileset>
! </copy>
<!-- use the enhancer tool -->
***************
*** 303,325 ****
<!-- uncomment the next line to see tons of output -->
<!-- <arg value="-v" /> -->
! <arg line="-s ${build.dir};${jdo.jar} -d ${enhanced.dir}" />
! <arg value="com.ysoft.jdo.book.rental.persistent.Rental" />
! <arg value="com.ysoft.jdo.book.rental.persistent.Customer" />
! <arg value="com.ysoft.jdo.book.rental.persistent.Lighthouse" />
! <arg value="com.ysoft.jdo.book.rental.persistent.Week" />
</java>
! <echo message="creating runRentalConsole.bat" />
! <echo file="runRentalConsole.bat" >
! REM Build generated macro to run the RentalConsole example
java -cp ${run.classpath} com.ysoft.jdo.book.rental.local.client.console.ReservationClient
</echo>
! <echo message="creating runRentalGui.bat" />
! <echo file="runRentalGui.bat" >
! REM Build generated macro to run the RentalGui example
! java -cp ${run.classpath} com.ysoft.jdo.book.rental.local.client.gui.ReservationClient %1 %2
</echo>
! </target>
<target name="setup-warfiles" >
--- 303,342 ----
<!-- uncomment the next line to see tons of output -->
<!-- <arg value="-v" /> -->
! <arg line="-d ${enhanced.dir}" />
! <arg value="${build.dir}/${book.path}/rental/persistent/Rental.jdo" />
! <arg value="${build.dir}/${book.path}/rental/persistent/Customer.jdo" />
! <arg value="${build.dir}/${book.path}/rental/persistent/Lighthouse.jdo" />
! <arg value="${build.dir}/${book.path}/rental/persistent/Week.jdo" />
</java>
! <condition property="rentalconsole.script.name" value="runRentalConsole.bat" >
! <os family="windows" />
! </condition>
! <condition property="rentalconsole.script.name" value="runRentalConsole" >
! <os family="unix" />
! </condition>
!
! <echo message="creating ${rentalconsole.script.name}" />
!
! <echo file="${rentalconsole.script.name}" >${script.line1}
java -cp ${run.classpath} com.ysoft.jdo.book.rental.local.client.console.ReservationClient
</echo>
+ <chmod file="${rentalconsole.script.name}" perm="u+x" />
!
! <condition property="rentalgui.script.name" value="runRentalGui.bat" >
! <os family="windows" />
! </condition>
! <condition property="rentalgui.script.name" value="runRentalGui" >
! <os family="unix" />
! </condition>
!
! <echo message="creating ${rentalgui.script.name}" />
!
! <echo file="${rentalgui.script.name}" >${script.line1}
! java -cp ${run.classpath} com.ysoft.jdo.book.rental.local.client.gui.ReservationClient ${script.args}
</echo>
! <chmod file="${rentalgui.script.name}" perm="u+x" />
! </target>
<target name="setup-warfiles" >
***************
*** 336,343 ****
<copy todir="warfiles/WEB-INF/lib" >
! <fileset dir="${jdo.home}/src" >
<patternset>
! <include name="jdo.jar" />
! <include name="jpox.jar" />
</patternset>
</fileset>
--- 353,359 ----
<copy todir="warfiles/WEB-INF/lib" >
! <fileset dir="${jdo.home}/target" >
<patternset>
! <include name="jpox-${jpox.version}.jar" />
</patternset>
</fileset>
***************
*** 345,357 ****
<copy todir="warfiles/WEB-INF/lib" >
! <fileset dir="${jdo.lib.path}" >
<patternset>
! <include name="btree.jar" />
! <include name="antlr.jar" />
! <!-- <include name="xerces.jar" /> -->
! <!-- <include name="jta-spec1_0_1.jar" /> -->
</patternset>
</fileset>
! </copy>
<!-- to get the oracle zip working with tomcat, I had to unzip it and then jar it, then
--- 361,379 ----
<copy todir="warfiles/WEB-INF/lib" >
! <fileset dir="${jdo.home}/lib" >
<patternset>
! <include name="jdori.jar" />
! <include name="jdo.jar" />
! <include name="log4j.jar" />
! <include name="j2ee.jar" />
</patternset>
</fileset>
! </copy>
!
! <copy todir="warfiles/WEB-INF/lib" >
! <fileset dir="lib" />
! </copy>
!
! <copy todir="warfiles/WEB-INF/lib" file="${jdbc.jar}" />
<!-- to get the oracle zip working with tomcat, I had to unzip it and then jar it, then
***************
*** 363,378 ****
<ant antfile="${book.path}/rental/servlet/build.xml" target="rental-servlet"/>
<echo message="returned from ${book.path}/rental/servlet/build.xml" />
!
! <!-- for 1.0 -->
! <copy file="${book.path}/rental/persistent/servlet/persistent.jdo"
! tofile="${build.dir}/${book.path}/rental/persistent.jdo"/>
! <copy file="${book.path}/rental/persistent/servlet/persistent.jdo"
! tofile="${enhanced.dir}/${book.path}/rental/persistent.jdo"/>
! <!-- for 1.0.1 -->
! <copy file="${book.path}/rental/persistent/servlet/persistent.jdo"
! tofile="${build.dir}/${book.path}/rental/persistent/package.jdo"/>
! <copy file="${book.path}/rental/persistent/servlet/persistent.jdo"
! tofile="${enhanced.dir}/${book.path}/rental/persistent/package.jdo"/>
!
<!-- use the enhancer tool -->
<java classname="${enhancer.tool}" classpath="${enhance.classpath}" fork="yes"
--- 385,393 ----
<ant antfile="${book.path}/rental/servlet/build.xml" target="rental-servlet"/>
<echo message="returned from ${book.path}/rental/servlet/build.xml" />
! <copy todir="${build.dir}/${book.path}/rental/persistent">
! <fileset dir="${book.path}/rental/persistent/local/jpox" >
! <include name="*.jdo" />
! </fileset>
! </copy>
<!-- use the enhancer tool -->
<java classname="${enhancer.tool}" classpath="${enhance.classpath}" fork="yes"
***************
*** 380,388 ****
<!-- uncomment the next line to see tons of output -->
<!-- <arg value="-v" /> -->
! <arg line="-s ${build.dir};${jdo.jar} -d ${enhanced.dir}" />
! <arg value="com.ysoft.jdo.book.rental.persistent.Rental" />
! <arg value="com.ysoft.jdo.book.rental.persistent.Customer" />
! <arg value="com.ysoft.jdo.book.rental.persistent.Lighthouse" />
! <arg value="com.ysoft.jdo.book.rental.persistent.Week" />
</java>
--- 395,403 ----
<!-- uncomment the next line to see tons of output -->
<!-- <arg value="-v" /> -->
! <arg line="-d ${enhanced.dir}" />
! <arg value="${build.dir}/${book.path}/rental/persistent/Rental.jdo" />
! <arg value="${build.dir}/${book.path}/rental/persistent/Customer.jdo" />
! <arg value="${build.dir}/${book.path}/rental/persistent/Lighthouse.jdo" />
! <arg value="${build.dir}/${book.path}/rental/persistent/Week.jdo" />
</java>
***************
*** 396,399 ****
</antcall>
</target>
-
</project>
--- 411,413 ----
|