Okay, I've discovered the test/test-classpath targets in the build.xml
and have successfully got the testbed working for this patch, which
removes all of the duplicate -classpath targets in favor of a
useClasspath property in the build.properties file.
A summary of the changes I made:
build-test.xml - removed all references to -classpath targets and
instead when test-classpath is called, initially set the
useClasspath=true, then execute test as normal.
src/conf/build.torque.xml - removed all the -classpath targets and added
useClasspath="${useClasspath}" to each of the corresponding
non-classpath targets.
src/conf/build.properties - added the useClasspath property, defaulted
to false, along with a description of what it does.
build.xml - small change in the description of the test-classpath
target.
xdocs/index.xml - removed the wording about the -classpath targets on
the home page.
I made the patch with WinCVS's diff functionality, so I'm not entirely
sure it's the way you want it (e.g. it doesn't have the -u option). Let
me know if I need to submit it differently.
So does this look good?
Thanks,
Stephen
cvs diff build-test.xml src\conf\build-torque.xml src\conf\build.properties build.xml
xdocs\index.xml (in directory C:\cvs\jakarta-turbine-torque\)
Index: build-test.xml
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-torque/build-test.xml,v
retrieving revision 1.29
diff -r1.29 build-test.xml
71,74c71,73
< description="run the testbed using the -classpath tasks">
< <antcall target="test-pre-runtime-classpath"/>
< <antcall target="test-runtime"/>
< <antcall target="test-post-runtime-classpath"/>
---
> description="run the testbed using the useClasspath property">
> <property name="useClasspath" value="true"/>
> <antcall target="test"/>
109,119d107
< <target
< name="test-pre-runtime-classpath">
<
< <antcall target="test-project-doc-classpath"/>
< <antcall target="test-create-db-classpath"/>
< <antcall target="test-project-sql-classpath"/>
< <antcall target="test-id-table-init-sql-classpath"/>
< <antcall target="test-project-insert-sql"/>
< <antcall target="test-project-om-classpath"/>
< </target>
<
141,156d128
< name="test-post-runtime-classpath">
<
< <antcall target="test-project-datadtd-classpath"/>
< <antcall target="test-project-datadump-classpath"/>
< <antcall target="test-project-datasql-classpath"/>
< <antcall target="test-project-jdbc"/>
<
< <!--
< <antcall target="test-project-sql-classpath"/>
< <antcall target="test-project-om-classpath"/>
< <antcall target="test-project-sql2xml"/>
< -->
<
< </target>
<
< <target
166,174d137
< name="test-project-sql-classpath">
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="project-sql-classpath">
< </ant>
< </target>
<
< <target
184,192d146
< name="test-id-table-init-sql-classpath">
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="id-table-init-sql-classpath">
< </ant>
< </target>
<
< <target
202,210d155
< name="test-project-doc-classpath">
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="project-doc-classpath">
< </ant>
< </target>
<
< <target
220,228d164
< name="test-create-db-classpath">
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="project-create-db-classpath">
< </ant>
< </target>
<
< <target
253,268d188
< <target
< name="test-project-om-classpath">
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="project-om-classpath">
< </ant>
< <!-- Compile the classes -->
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="compile"
< inheritAll="false">
< </ant>
< </target>
<
280,289d199
< <target
< name="test-project-datadtd-classpath">
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="project-datadtd-classpath"
< inheritAll="false">
< </ant>
< </target>
<
301,310d210
< <target
< name="test-project-datadump-classpath">
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="project-datadump-classpath"
< inheritAll="false">
< </ant>
< </target>
<
324,339d223
< inheritAll="false">
< </ant>
< </target>
<
< <target
< name="test-project-datasql-classpath">
< <copy
< todir="${torque.distDir}/schema/"
< file="${torque.distDir}/src/bookstore-data.dtd"/>
< <copy
< tofile="${torque.distDir}/schema/bookstore-data.xml"
< file="${torque.distDir}/src/bookstore-bookstore-all-data.xml"/>
< <ant
< dir="${torque.buildFileDir}"
< antfile="${torque.buildFile}"
< target="project-datasql-classpath"
Index: build.xml
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-torque/build.xml,v
retrieving revision 1.50
diff -r1.50 build.xml
30c30
< description="==> runtime tests using the -classpath tasks (set
torque.testProfile in your build.properties)">
---
> description="==> runtime tests using useClasspath property (set
>torque.testProfile in your build.properties)">
Index: src/conf/build-torque.xml
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-torque/src/conf/build-torque.xml,v
retrieving revision 1.30
diff -r1.30 build-torque.xml
33,40d32
< <target
< name="main-classpath"
< description="==> generates sql + om classes">
<
< <antcall target="project-sql-classpath"/>
< <antcall target="project-om-classpath"/>
< </target>
<
69a62
> useClasspath="${useClasspath}"
106a100
> useClasspath="${useClasspath}"
137a132
> useClasspath="${useClasspath}"
246a242
> useClasspath="${useClasspath}"
283a280
> useClasspath="${useClasspath}"
318a316
> useClasspath="${useClasspath}"
356a355
> useClasspath="${useClasspath}"
390a390
> useClasspath="${useClasspath}"
402,706d401
< <!-- ================================================================ -->
< <!-- G E N E R A T E P R O J E C T S Q L -->
< <!-- ================================================================ -->
< <!-- Generate the SQL for your project, these are in addition -->
< <!-- to the base Turbine tables! The tables you require for your -->
< <!-- project should be specified in project-schema.xml. -->
< <!-- ================================================================ -->
<
< <target
< name="project-sql-classpath"
< description="==> generates the SQL for your project">
<
< <echo message="+------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Generating SQL for YOUR Turbine project! |"/>
< <echo message="| Woo hoo! |"/>
< <echo message="| |"/>
< <echo message="+------------------------------------------+"/>
<
< <taskdef
< name="torque-sql"
< classname="org.apache.torque.task.TorqueSQLTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <torque-sql
< contextProperties="${build.properties}"
< controlTemplate="${SQLControlTemplate}"
< outputDirectory="${torque.home}/${outputDirectory}/sql"
< useClasspath="true"
< basePathToDbProps="sql/base/"
< sqldbmap="${torque.home}/${outputDirectory}/sql/sqldb.map"
< outputFile="report.${project}.sql.generation"
< targetDatabase="${database}"
< idTableXMLFile="${idTableXMLFile}">
< <fileset dir="${torque.home}/${schemaDirectory}">
< <include name="*-schema.xml"/>
< </fileset>
< </torque-sql>
< </target>
<
< <!-- ================================================================ -->
< <!-- Generate SQL from XML data file -->
< <!-- ================================================================ -->
<
< <target
< name="project-datasql-classpath"
< description="==> generates sql from data xml">
<
< <echo message="+-----------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Generating SQL from data XML ! |"/>
< <echo message="| Woo hoo! |"/>
< <echo message="| |"/>
< <echo message="+-----------------------------------------------+"/>
< <echo message=" taking build.properties from: ${build.properties}"/>
<
< <taskdef
< name="torque-datasql"
< classname="org.apache.torque.task.TorqueDataSQLTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <torque-datasql
< contextProperties="${build.properties}"
< controlTemplate="${DataSQLControlTemplate}"
< outputDirectory="${torque.home}/${outputDirectory}"
< useClasspath="true"
< outputFile="${project}-data.sql"
< xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
< dataXmlFile="${torque.home}/${schemaDirectory}/${project}-data.xml"
< dataDTD="${torque.home}/${schemaDirectory}/${project}-data.dtd"
< targetDatabase="${database}"
< sqldbmap="${basedir}/${outputDirectory}/sql/sqldb.map"
< />
< </target>
<
< <!-- ================================================================ -->
< <!-- G E N E R A T E P R O J E C T D A T A D T D -->
< <!-- ================================================================ -->
< <!-- Generate the DATA DTD for your project -->
< <!-- ================================================================ -->
<
< <target
< name="project-datadtd-classpath"
< description="==> generates the DATA DTD for your project">
<
< <echo message="+-----------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Generating Data DTD for YOUR Turbine project! |"/>
< <echo message="| Woo hoo! |"/>
< <echo message="| |"/>
< <echo message="+-----------------------------------------------+"/>
<
< <taskdef
< name="torque-datadtd"
< classname="org.apache.torque.task.TorqueDataModelTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <torque-datadtd
< contextProperties="${build.properties}"
< controlTemplate="${DataDTDControlTemplate}"
< outputDirectory="${torque.home}/${outputDirectory}"
< useClasspath="true"
< outputFile="report.${project}.datadtd.generation"
< xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
< />
< </target>
<
< <!-- ================================================================ -->
< <!-- Dump data from database into xml file -->
< <!-- ================================================================ -->
<
< <target
< name="project-datadump-classpath"
< description="==> dump data from database into xml file">
<
< <echo message="+-----------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Dumping the data from database into XML |"/>
< <echo message="| Woo hoo! |"/>
< <echo message="| |"/>
< <echo message="+-----------------------------------------------+"/>
< <echo message=" taking build.properties from: ${build.properties}"/>
<
< <taskdef
< name="torque-datadump"
< classname="org.apache.torque.task.TorqueDataDumpTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <torque-datadump
< contextProperties="${build.properties}"
< controlTemplate="${DataDumpControlTemplate}"
< outputDirectory="${torque.home}/${outputDirectory}"
< useClasspath="true"
< outputFile="report.${project}.datadump.generation"
< xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
< databaseDriver="${databaseDriver}"
< databaseUrl="${databaseUrl}"
< databaseUser="${databaseUser}"
< databasePassword="${databasePassword}"
< databaseName="${databaseName}"
< />
< </target>
<
< <!-- ================================================================ -->
< <!-- G E N E R A T E P R O J E C T P E E R B A S E D O M -->
< <!-- ================================================================ -->
< <!-- Generate the Peer-based object model for your project. -->
< <!-- These are in addition to the base Turbine OM! -->
< <!-- ================================================================ -->
<
< <target
< name="project-om-classpath"
< description="==> generates the Peer-based object model for your project">
<
< <echo message="+------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Generating Peer-based Object Model for |"/>
< <echo message="| YOUR Turbine project! Woo hoo! |"/>
< <echo message="| |"/>
< <echo message="+------------------------------------------+"/>
<
< <taskdef
< name="torque-om"
< classname="org.apache.torque.task.TorqueDataModelTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <torque-om
< contextProperties="${build.properties}"
< controlTemplate="${OMControlTemplate}"
< outputDirectory="${torque.home}/${outputDirectory}/java"
< useClasspath="true"
< outputFile="report.${project}.om.generation"
< targetPackage="${targetPackage}.om"
< targetDatabase="${database}">
< <fileset dir="${torque.home}/${schemaDirectory}">
< <include name="*-schema.xml"/>
< <exclude name="id-table-schema.xml"/>
< </fileset>
< </torque-om>
< </target>
<
< <!-- ================================================================ -->
< <!-- C R E A T E T A R G E T D A T A B A S E -->
< <!-- ================================================================ -->
< <!-- Create the target database by executing a generated script -->
< <!-- that is capable of performing the task. -->
< <!-- ================================================================ -->
<
< <target
< name="project-create-db-classpath"
< unless="database.manual.creation"
< description="==> generates the target database">
<
< <taskdef
< name="torque-create-db"
< classname="org.apache.torque.task.TorqueDataModelTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <echo>
< driver="${databaseDriver}"
< url="${createDatabaseUrl}"
< userid="${databaseUser}"
< password="${databasePassword}"
< </echo>
<
< <torque-create-db
< controlTemplate="sql/db-init/Control.vm"
< outputDirectory="${torque.home}/${outputDirectory}/sql"
< targetDatabase="${database}"
< useClasspath="true"
< outputFile="create-db.sql">
< <fileset dir="${torque.home}/${schemaDirectory}">
< <include name="*-schema.xml"/>
< </fileset>
< </torque-create-db>
<
< <sql
< driver="${databaseDriver}"
< url="${createDatabaseUrl}"
< userid="${databaseUser}"
< password="${databasePassword}"
< src="${torque.home}/${outputDirectory}/sql/create-db.sql"
< autocommit="true"
< onerror="continue">
< <classpath refid="torque-classpath"/>
< </sql>
< </target>
<
< <!-- ================================================================ -->
< <!-- G E N E R A T E I D B R O K E R I N I T S Q L -->
< <!-- ================================================================ -->
<
< <target
< name="id-table-init-sql-classpath">
<
< <echo message="+------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Generating initialization SQL |"/>
< <echo message="| for ID Broker system! |"/>
< <echo message="| |"/>
< <echo message="+------------------------------------------+"/>
<
< <taskdef
< name="torque-sql"
< classname="org.apache.torque.task.TorqueSQLTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <torque-sql
< contextProperties="sql/id-table/project.props"
< controlTemplate="${idTableControlTemplate}"
< useClasspath="true"
< suffix="-idtable-init"
< sqldbmap="${torque.home}/${outputDirectory}/sql/sqldb.map"
< outputDirectory="${torque.home}/${outputDirectory}/sql"
< outputFile="${database}-id-table-init.sql"
< targetDatabase="${database}">
< <fileset dir="${torque.home}/${schemaDirectory}">
< <include name="*-schema.xml"/>
< <exclude name="id-table-schema.xml"/>
< </fileset>
< </torque-sql>
< </target>
<
< <!-- ================================================================ -->
< <!-- G E N E R A T E D O C S -->
< <!-- ================================================================ -->
<
< <target
< name="project-doc-classpath"
< description="==> generates documentation for your datamodel">
<
< <echo message="+------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Generating docs for YOUR datamodel! |"/>
< <echo message="| Woo hoo! |"/>
< <echo message="| |"/>
< <echo message="+------------------------------------------+"/>
<
< <taskdef
< name="torque-doc"
< classname="org.apache.torque.task.TorqueDocumentationTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <torque-doc
< contextProperties="${build.properties}"
< controlTemplate="${DocControlTemplate}"
< outputDirectory="${torque.home}/${outputDirectory}/doc"
< outputFormat="${documentationFormat}"
< useClasspath="true"
< sqldbmap="${torque.home}/${outputDirectory}/sql/sqldb.map"
< outputFile="report.${project}.doc.generation">
< <fileset dir="${torque.home}/${schemaDirectory}">
< <include name="*-schema.xml"/>
< </fileset>
< </torque-doc>
< </target>
<
811a507
> useClasspath="${useClasspath}"
822,851d517
< name="project-ojb-repository-classpath">
<
< <echo message="+------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Generating OJB repository |"/>
< <echo message="| |"/>
< <echo message="+------------------------------------------+"/>
<
< <taskdef
< name="ojb-repository"
< classname="org.apache.torque.task.TorqueDataModelTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <ojb-repository
< contextProperties="${build.properties}"
< controlTemplate="ojb/repository/Control.vm"
< targetPackage="${targetPackage}.om"
< targetDatabase="${database}"
< outputDirectory="${torque.home}/${outputDirectory}/ojb"
< useClasspath="true"
< sqldbmap="${torque.home}/${outputDirectory}/sql/sqldb.map"
< outputFile="report.${project}.ojb.generation">
< <fileset dir="${torque.home}/${schemaDirectory}">
< <include name="*-schema.xml"/>
< </fileset>
< </ojb-repository>
< </target>
<
< <target
871a538
> useClasspath="${useClasspath}"
873,902d539
< sqldbmap="${torque.home}/${outputDirectory}/sql/sqldb.map"
< outputFile="report.${project}.ojb.generation">
< <fileset dir="${torque.home}/${schemaDirectory}">
< <include name="*-schema.xml"/>
< </fileset>
< </ojb-model>
< </target>
<
< <target
< name="project-ojb-model-classpath">
<
< <echo message="+------------------------------------------+"/>
< <echo message="| |"/>
< <echo message="| Generating OJB model |"/>
< <echo message="| |"/>
< <echo message="+------------------------------------------+"/>
<
< <taskdef
< name="ojb-model"
< classname="org.apache.torque.task.TorqueDataModelTask">
< <classpath refid="torque-classpath"/>
< </taskdef>
<
< <ojb-model
< contextProperties="${build.properties}"
< controlTemplate="ojb/model/Control.vm"
< targetPackage="${targetPackage}.om"
< targetDatabase="${database}"
< outputDirectory="${torque.home}/${outputDirectory}/ojb"
< useClasspath="true"
Index: src/conf/build.properties
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-torque/src/conf/build.properties,v
retrieving revision 1.14
diff -r1.14 build.properties
70a71,73
> # useClasspath=true uses Velocity's classpath loader to retrieve the templates
> # from the classpath instead of off the hard drive.
> #
84a88
> useClasspath=false
Index: xdocs/index.xml
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-torque/xdocs/index.xml,v
retrieving revision 1.14
diff -r1.14 index.xml
37,38c37
< project . It defines the following targets (-classpath targets load
< the templates from the torque.jar file):
---
> project . It defines the following targets:
41c40
< <strong>project-sql(-classpath)</strong><br/>
---
> <strong>project-sql</strong><br/>
47c46
< <strong>project-doc(-classpath)</strong><br/>
---
> <strong>project-doc</strong><br/>
52c51
< <strong>project-create-db(-classpath)</strong><br/>
---
> <strong>project-create-db</strong><br/>
58c57
< <strong>project-datadtd(-classpath)</strong><br/>
---
> <strong>project-datadtd</strong><br/>
64c63
< <strong>project-datadump(-classpath)</strong><br/>
---
> <strong>project-datadump</strong><br/>
69c68
< <strong>project-datasql(-classpath)</strong><br/>
---
> <strong>project-datasql</strong><br/>
79c78
< <strong>project-om(-classpath)</strong><br/>
---
> <strong>project-om</strong><br/>
95c94
< <strong>id-table-init-sql(-classpath)</strong><br/>
---
> <strong>id-table-init-sql</strong><br/>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>