mpoeschl 2002/07/11 11:09:26
Modified: src/conf build-torque.xml
xdocs index.xml tutorial.xml
. build-test.xml
Log:
patch by Stephen Haberman <[EMAIL PROTECTED]>
Here's the patch with the deprecation of the project- targets and
moving/renaming all of the taskdefs to the beginning of the file.
Revision Changes Path
1.37 +129 -129 jakarta-turbine-torque/src/conf/build-torque.xml
Index: build-torque.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/conf/build-torque.xml,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- build-torque.xml 27 Jun 2002 17:38:58 -0000 1.36
+++ build-torque.xml 11 Jul 2002 18:09:25 -0000 1.37
@@ -13,6 +13,43 @@
</fileset>
</path>
+ <!--
+ Do forward declarations of all of our tasks to
+ centralize them and clean up the targets.
+ -->
+ <taskdef
+ name="torque-data-model"
+ classpathref="torque-classpath"
+ classname="org.apache.torque.task.TorqueDataModelTask"/>
+ <taskdef
+ name="torque-data-dump"
+ classpathref="torque-classpath"
+ classname="org.apache.torque.task.TorqueDataDumpTask"/>
+ <taskdef
+ name="torque-data-sql"
+ classpathref="torque-classpath"
+ classname="org.apache.torque.task.TorqueDataSQLTask"/>
+ <taskdef
+ name="torque-doc"
+ classpathref="torque-classpath"
+ classname="org.apache.torque.task.TorqueDocumentationTask"/>
+ <taskdef
+ name="torque-jdbc-transform"
+ classpathref="torque-classpath"
+ classname="org.apache.torque.task.TorqueJDBCTransformTask"/>
+ <taskdef
+ name="torque-sql"
+ classpathref="torque-classpath"
+ classname="org.apache.torque.task.TorqueSQLTask"/>
+ <taskdef
+ name="torque-sql-exec"
+ classpathref="torque-classpath"
+ classname="org.apache.torque.task.TorqueSQLExec"/>
+ <taskdef
+ name="torque-sql-transform"
+ classpathref="torque-classpath"
+ classname="org.apache.torque.task.TorqueSQLTransformTask"/>
+
<!-- ================================================================ -->
<!-- M A I N T A R G E T -->
<!-- ================================================================ -->
@@ -26,8 +63,8 @@
name="main"
description="==> generates sql + om classes">
- <antcall target="project-sql"/>
- <antcall target="project-om"/>
+ <antcall target="sql"/>
+ <antcall target="om"/>
</target>
<!-- ================================================================ -->
@@ -39,7 +76,7 @@
<!-- ================================================================ -->
<target
- name="project-sql"
+ name="sql"
description="==> generates the SQL for your project">
<echo message="+------------------------------------------+"/>
@@ -49,22 +86,16 @@
<echo message="| |"/>
<echo message="+------------------------------------------+"/>
- <antcall target="project-sql-classpath"/>
- <antcall target="project-sql-template"/>
+ <antcall target="sql-classpath"/>
+ <antcall target="sql-template"/>
</target>
<target
- name="project-sql-classpath"
+ name="sql-classpath"
if="useClasspath">
<echo message="using classpath"/>
- <taskdef
- name="torque-sql"
- classname="org.apache.torque.task.TorqueSQLTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
<torque-sql
contextProperties="${build.properties}"
controlTemplate="${SQLControlTemplate}"
@@ -82,17 +113,11 @@
</target>
<target
- name="project-sql-template"
+ name="sql-template"
unless="useClasspath">
<echo message="using template path ${templatePath}"/>
- <taskdef
- name="torque-sql"
- classname="org.apache.torque.task.TorqueSQLTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
<torque-sql
contextProperties="${build.properties}"
controlTemplate="${SQLControlTemplate}"
@@ -114,7 +139,7 @@
<!-- ================================================================ -->
<target
- name="project-doc"
+ name="doc"
description="==> generates documentation for your datamodel">
<echo message="+------------------------------------------+"/>
@@ -124,12 +149,6 @@
<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}"
@@ -153,17 +172,11 @@
<!-- ================================================================ -->
<target
- name="project-create-db"
+ name="create-db"
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>
-
- <torque-create-db
+ <torque-data-model
controlTemplate="sql/db-init/Control.vm"
outputDirectory="${torque.home}/${outputDirectory}/sql"
useClasspath="${useClasspath}"
@@ -173,7 +186,7 @@
<fileset dir="${torque.home}/${schemaDirectory}">
<include name="*-schema.xml"/>
</fileset>
- </torque-create-db>
+ </torque-data-model>
<echo>
Executing the create-db.sql script ...
@@ -196,15 +209,9 @@
<!-- ================================================================ -->
<target
- name="project-insert-sql">
+ name="insert-sql">
- <taskdef
- name="torque-insert-sql"
- classname="org.apache.torque.task.TorqueSQLExec">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
- <torque-insert-sql
+ <torque-sql-exec
driver="${databaseDriver}"
url="${buildDatabaseUrl}"
userid="${databaseUser}"
@@ -214,7 +221,7 @@
sqldbmap="${torque.home}/${outputDirectory}/sql/sqldb.map"
srcDir="${torque.home}/${outputDirectory}/sql">
<classpath refid="torque-classpath"/>
- </torque-insert-sql>
+ </torque-sql-exec>
</target>
<!-- ================================================================ -->
@@ -222,7 +229,7 @@
<!-- ================================================================ -->
<target
- name="project-jdbc"
+ name="jdbc"
description="==> jdbc to xml">
<echo message="+-----------------------------------------------+"/>
@@ -233,13 +240,7 @@
<echo message="+-----------------------------------------------+"/>
<echo message=" taking build.properties from: ${build.properties}"/>
- <taskdef
- name="torque-jdbc"
- classname="org.apache.torque.task.TorqueJDBCTransformTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
- <torque-jdbc
+ <torque-jdbc-transform
dbUrl="${databaseUrl}"
dbDriver="${databaseDriver}"
dbUser="${databaseUser}"
@@ -255,7 +256,7 @@
<!-- ================================================================ -->
<target
- name="project-datasql"
+ name="datasql"
description="==> generates sql from data xml">
<echo message="+-----------------------------------------------+"/>
@@ -266,13 +267,7 @@
<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
+ <torque-data-sql
contextProperties="${build.properties}"
controlTemplate="${DataSQLControlTemplate}"
outputDirectory="${torque.home}/${outputDirectory}"
@@ -301,12 +296,6 @@
<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="${idTableControlTemplate}"
@@ -329,7 +318,7 @@
<!-- ================================================================ -->
<target
- name="project-datadump"
+ name="datadump"
description="==> dump data from database into xml file">
<echo message="+-----------------------------------------------+"/>
@@ -340,13 +329,7 @@
<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
+ <torque-data-dump
contextProperties="${build.properties}"
controlTemplate="${DataDumpControlTemplate}"
outputDirectory="${torque.home}/${outputDirectory}"
@@ -369,7 +352,7 @@
<!-- ================================================================ -->
<target
- name="project-datadtd"
+ name="datadtd"
description="==> generates the DATA DTD for your project">
<echo message="+-----------------------------------------------+"/>
@@ -379,13 +362,7 @@
<echo message="| |"/>
<echo message="+-----------------------------------------------+"/>
- <taskdef
- name="torque-datadtd"
- classname="org.apache.torque.task.TorqueDataModelTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
- <torque-datadtd
+ <torque-data-model
contextProperties="${build.properties}"
controlTemplate="${DataDTDControlTemplate}"
outputDirectory="${torque.home}/${outputDirectory}"
@@ -404,7 +381,7 @@
<!-- ================================================================ -->
<target
- name="project-om"
+ name="om"
description="==> generates the Peer-based object model for your project">
<echo message="+------------------------------------------+"/>
@@ -414,23 +391,17 @@
<echo message="| |"/>
<echo message="+------------------------------------------+"/>
- <antcall target="project-om-classpath"/>
- <antcall target="project-om-template"/>
+ <antcall target="om-classpath"/>
+ <antcall target="om-template"/>
</target>
<target
- name="project-om-classpath"
+ name="om-classpath"
if="useClasspath">
<echo message="using classpath"/>
- <taskdef
- name="torque-om"
- classname="org.apache.torque.task.TorqueDataModelTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
- <torque-om
+ <torque-data-model
contextProperties="${build.properties}"
controlTemplate="${OMControlTemplate}"
outputDirectory="${torque.home}/${outputDirectory}/java"
@@ -442,22 +413,16 @@
<include name="*-schema.xml"/>
<exclude name="id-table-schema.xml"/>
</fileset>
- </torque-om>
+ </torque-data-model>
</target>
<target
- name="project-om-template"
+ name="om-template"
unless="useClasspath">
<echo message="using template path ${templatePath}"/>
- <taskdef
- name="torque-om"
- classname="org.apache.torque.task.TorqueDataModelTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
- <torque-om
+ <torque-data-model
contextProperties="${build.properties}"
controlTemplate="${OMControlTemplate}"
outputDirectory="${torque.home}/${outputDirectory}/java"
@@ -469,7 +434,7 @@
<include name="*-schema.xml"/>
<exclude name="id-table-schema.xml"/>
</fileset>
- </torque-om>
+ </torque-data-model>
</target>
<!-- =================================================================== -->
@@ -513,16 +478,10 @@
<!-- =================================================================== -->
<target
- name="project-sql2xml"
+ name="sql2xml"
description="==> creates an xml schema from an sql schema">
- <taskdef
- name="sql-xml"
- classname="org.apache.torque.task.TorqueSQLTransformTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
- <sql-xml
+ <torque-sql-transform
inputFile="schema/schema.sql"
outputFile="schema/schema.xml"
/>
@@ -557,7 +516,7 @@
<!-- =================================================================== -->
<target
- name="project-ojb-repository">
+ name="ojb-repository">
<echo message="+------------------------------------------+"/>
<echo message="| |"/>
@@ -565,13 +524,7 @@
<echo message="| |"/>
<echo message="+------------------------------------------+"/>
- <taskdef
- name="ojb-repository"
- classname="org.apache.torque.task.TorqueDataModelTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
- <ojb-repository
+ <torque-data-model
contextProperties="${build.properties}"
controlTemplate="ojb/repository/Control.vm"
targetPackage="${targetPackage}"
@@ -584,11 +537,11 @@
<fileset dir="${torque.home}/${schemaDirectory}">
<include name="*-schema.xml"/>
</fileset>
- </ojb-repository>
+ </torque-data-model>
</target>
<target
- name="project-ojb-model">
+ name="ojb-model">
<echo message="+------------------------------------------+"/>
<echo message="| |"/>
@@ -596,13 +549,7 @@
<echo message="| |"/>
<echo message="+------------------------------------------+"/>
- <taskdef
- name="ojb-model"
- classname="org.apache.torque.task.TorqueDataModelTask">
- <classpath refid="torque-classpath"/>
- </taskdef>
-
- <ojb-model
+ <torque-data-model
contextProperties="${build.properties}"
controlTemplate="ojb/model/Control.vm"
targetPackage="${targetPackage}"
@@ -615,7 +562,60 @@
<fileset dir="${torque.home}/${schemaDirectory}">
<include name="*-schema.xml"/>
</fileset>
- </ojb-model>
+ </torque-data-model>
+ </target>
+
+ <!--
+ Deprecated targets with the project- prefix.
+ -->
+ <target name="project-sql">
+ <echo message="The 'project-sql' target is deprecated. Please use the 'sql'
target instead."/>
+ <antcall target="sql"/>
+ </target>
+ <target name="project-om">
+ <echo message="The 'project-om' target is deprecated. Please use the 'om'
target instead."/>
+ <antcall target="om"/>
+ </target>
+ <target name="project-doc">
+ <echo message="The 'project-doc' target is deprecated. Please use the 'doc'
target instead."/>
+ <antcall target="doc"/>
+ </target>
+ <target name="project-create-db">
+ <echo message="The 'project-create-db' target is deprecated. Please use the
'create-db' target instead."/>
+ <antcall target="create-db"/>
+ </target>
+ <target name="project-insert-sql">
+ <echo message="The 'project-insert-sql' target is deprecated. Please use the
'insert-sql' target instead."/>
+ <antcall target="insert-sql"/>
+ </target>
+ <target name="project-jdbc">
+ <echo message="The 'project-jdbc' target is deprecated. Please use the 'jdbc'
target instead."/>
+ <antcall target="jdbc"/>
+ </target>
+ <target name="project-datasql">
+ <echo message="The 'project-datasql' target is deprecated. Please use the
'datasql' target instead."/>
+ <antcall target="datasql"/>
+ </target>
+ <target name="project-datadump">
+ <echo message="The 'project-datadump' target is deprecated. Please use the
'datadump' target instead."/>
+ <antcall target="datadump"/>
+ </target>
+ <target name="project-datadtd">
+ <echo message="The 'project-datadtd' target is deprecated. Please use the
'datadtd' target instead."/>
+ <antcall target="datadtd"/>
+ </target>
+ <target name="project-sql2xml">
+ <echo message="The 'project-sql2xml' target is deprecated. Please use the
'sql2xml' target instead."/>
+ <antcall target="sql2xml"/>
+ </target>
+ <target name="project-ojb-repository">
+ <echo message="The 'project-ojb-repository' target is deprecated. Please use
the 'ojb-repository' target instead."/>
+ <antcall target="ojb-repository"/>
+ </target>
+ <target name="project-ojb-model">
+ <echo message="The 'project-obj-model' target is deprecated. Please use the
'ojb-model' target instead."/>
+ <antcall target="ojb-model"/>
</target>
+
</project>
1.16 +10 -10 jakarta-turbine-torque/xdocs/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/xdocs/index.xml,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- index.xml 7 Jun 2002 18:35:39 -0000 1.15
+++ index.xml 11 Jul 2002 18:09:26 -0000 1.16
@@ -37,56 +37,56 @@
project . It defines the following targets:
<ul>
<li>
- <strong>project-sql</strong><br/>
+ <strong>sql</strong><br/>
generates SQL source from an XML schema describing a database
structure
</li>
<p/>
<li>
- <strong>project-doc</strong><br/>
+ <strong>doc</strong><br/>
generates html or xml documentation for xml schemas
</li>
<p/>
<li>
- <strong>project-create-db</strong><br/>
+ <strong>create-db</strong><br/>
generates simple scripts for creating databases on various
platforms.
</li>
<p/>
<li>
- <strong>project-datadtd</strong><br/>
+ <strong>datadtd</strong><br/>
generates data DTD from an XML schema describing a database
structure
</li>
<p/>
<li>
- <strong>project-datadump</strong><br/>
+ <strong>datadump</strong><br/>
dumping data from db into XML
</li>
<p/>
<li>
- <strong>project-datasql</strong><br/>
+ <strong>datasql</strong><br/>
generates SQL source from an XML data file
</li>
<p/>
<li>
- <strong>project-jdbc</strong><br/>
+ <strong>jdbc</strong><br/>
generates an XML schema of an existing database from JDBC metadata
</li>
<p/>
<li>
- <strong>project-om</strong><br/>
+ <strong>om</strong><br/>
generates output by using Velocity
</li>
<p/>
<li>
- <strong>project-insert-sql</strong><br/>
+ <strong>insert-sql</strong><br/>
inserts a SQL file into its designated database
</li>
<p/>
<p/>
<li>
- <strong>project-sql2xml</strong><br/>
+ <strong>sql2xml</strong><br/>
generates an xml schema from an sql schema
</li>
<p/>
1.7 +2 -2 jakarta-turbine-torque/xdocs/tutorial.xml
Index: tutorial.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/xdocs/tutorial.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- tutorial.xml 10 May 2002 14:41:22 -0000 1.6
+++ tutorial.xml 11 Jul 2002 18:09:26 -0000 1.7
@@ -777,7 +777,7 @@
in the top-level <em>torque</em> directory:
</p>
<source><![CDATA[
- ant -f build-torque.xml project-create-db
+ ant -f build-torque.xml create-db
]]></source>
<p>
To create your tables, type the following commands in
@@ -785,7 +785,7 @@
</p>
<source><![CDATA[
ant -f build-torque.xml id-table-init-sql
- ant -f build-torque.xml project-insert-sql
+ ant -f build-torque.xml insert-sql
]]></source>
<p>
Note: if this tutorial had not utilized Torque's
1.32 +35 -35 jakarta-turbine-torque/build-test.xml
Index: build-test.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/build-test.xml,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- build-test.xml 4 Jul 2002 12:43:50 -0000 1.31
+++ build-test.xml 11 Jul 2002 18:09:26 -0000 1.32
@@ -85,10 +85,10 @@
<!-- -->
<!-- These are the tasks that we will be testing: -->
<!-- -->
- <!-- project-sql -->
- <!-- project-om -->
+ <!-- sql -->
+ <!-- om -->
<!-- -->
- <!-- The project-sql is also another complete set of tests: -->
+ <!-- The sql is also another complete set of tests: -->
<!-- we need to run the task for each of the supported databases -->
<!-- to make sure that generated SQL remains coherent across -->
<!-- changes to the templates. -->
@@ -97,12 +97,12 @@
<target
name="test-pre-runtime">
- <antcall target="test-project-doc"/>
+ <antcall target="test-doc"/>
<antcall target="test-create-db"/>
- <antcall target="test-project-sql"/>
+ <antcall target="test-sql"/>
<antcall target="test-id-table-init-sql"/>
- <antcall target="test-project-insert-sql"/>
- <antcall target="test-project-om"/>
+ <antcall target="test-insert-sql"/>
+ <antcall target="test-om"/>
</target>
<!-- ============================================================== -->
@@ -112,25 +112,25 @@
<target
name="test-post-runtime">
- <antcall target="test-project-datadtd"/>
- <antcall target="test-project-datadump"/>
- <antcall target="test-project-datasql"/>
- <antcall target="test-project-jdbc"/>
+ <antcall target="test-datadtd"/>
+ <antcall target="test-datadump"/>
+ <antcall target="test-datasql"/>
+ <antcall target="test-jdbc"/>
<!--
- <antcall target="test-project-sql-classpath"/>
- <antcall target="test-project-om-classpath"/>
- <antcall target="test-project-sql2xml"/>
+ <antcall target="test-sql-classpath"/>
+ <antcall target="test-om-classpath"/>
+ <antcall target="test-sql2xml"/>
-->
</target>
<target
- name="test-project-sql">
+ name="test-sql">
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-sql">
+ target="sql">
</ant>
</target>
@@ -144,11 +144,11 @@
</target>
<target
- name="test-project-doc">
+ name="test-doc">
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-doc">
+ target="doc">
</ant>
</target>
@@ -157,25 +157,25 @@
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-create-db">
+ target="create-db">
</ant>
</target>
<target
- name="test-project-insert-sql">
+ name="test-insert-sql">
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-insert-sql">
+ target="insert-sql">
</ant>
</target>
<target
- name="test-project-om">
+ name="test-om">
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-om">
+ target="om">
</ant>
<!-- Compile the classes -->
<ant
@@ -188,29 +188,29 @@
<!-- Still uses ${project} references. BAD!!! -->
<target
- name="test-project-datadtd">
+ name="test-datadtd">
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-datadtd"
+ target="datadtd"
inheritAll="false">
</ant>
</target>
<!-- Still uses ${project} references. BAD!!! -->
<target
- name="test-project-datadump">
+ name="test-datadump">
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-datadump"
+ target="datadump"
inheritAll="false">
</ant>
</target>
<!-- Still uses ${project} references. BAD!!! -->
<target
- name="test-project-datasql">
+ name="test-datasql">
<copy
todir="${torque.distDir}/schema/"
file="${torque.distDir}/src/bookstore-data.dtd"/>
@@ -220,17 +220,17 @@
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-datasql"
+ target="datasql"
inheritAll="false">
</ant>
</target>
<target
- name="test-project-jdbc">
+ name="test-jdbc">
<ant
dir="${torque.buildFileDir}"
antfile="${torque.buildFile}"
- target="project-jdbc">
+ target="jdbc">
<property name="torque.home" value="${torque.distDir}"/>
</ant>
</target>
@@ -359,7 +359,7 @@
<!-- ============================================================== -->
<target
- name="test-sql"
+ name="sql-test"
depends="test-libs,test-templates">
<filter token="DATABASE_DEFAULT" value="${torque.sqlTest.defaultDatabase}"/>
@@ -394,19 +394,19 @@
<ant
dir="${build.test}/sqltest"
antfile="${torque.buildFile}"
- target="project-create-db">
+ target="create-db">
</ant>
<ant
dir="${build.test}/sqltest"
antfile="${torque.buildFile}"
- target="project-sql">
+ target="sql">
</ant>
<ant
dir="${build.test}/sqltest"
antfile="${torque.buildFile}"
- target="project-insert-sql">
+ target="insert-sql">
</ant>
</target>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>