There are only four files, so I've just attached each one. 

build.xml:

This is the build file for the current project I'm working on. First it
loads the properties in order, then sets up Torque to be called from
within the Maven build process. The standard Maven delegates are next,
and then the Torque delegates I added are at the bottom.

project.properties:

This is where you'd configure torque on an application-by-application
basis. All of the standard stuff is there, just renamed.

One thing I haven't got to work yet is overriding the default
"addTimeStamp"-style parameters. I'd like to only specify the two or
three that aren't default (as in this sample file), however, it looks
like these settings are read directly from the contextProperties
attribute on the task instead of from the environment. Hence I either
have to specify all of them in the project.properties and have it be the
contextProperties file or change them in the central build.properties. A
workaround for this would be great (e.g. adding specific attributes to
the tasks or having them read from the environment).

build-torque.xml:

I took the 3.0-b2 build-torque.xml and hacked it until I could compile
the project I'm working on. I know this isn't safe and there are still
probably bugs in it.  

In the process of hacking, I renamed a lot of things. I'll be the first
to admit I got carried away; initially I was doing this just for my
project and was renaming things to what they made sense to me. Because I
am came up it, I naturally think my naming scheme is more organized than
the old one.

The renaming will break any previous integration with the old build
file. However, I don't think it'd be that hard to update to changed
syntax. But I'm well aware it's not my call on what is and is not
renamed, so whatever ends up in the repository, I don't care what the
naming is as long as the functionality is there.

Oh, I also added a preliminary clean target to the Torque file. There
are many times when I regenerate the OM and end up having old files
laying around, so I'd like to have Torque clean out the base files (and
then intelligently delete all of the old files that weren't generated in
the latest run?), but I haven't gotten around to implementing it.

Any comments are welcome. If I need to start over with a clean
build-torque.xml and add the same functionality without renaming every
property in sight, I will reluctantly do so. Just let me know.

Thanks,
Stephen

> -----Original Message-----
> From: John McNally [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 20, 2002 11:48 AM
> To: Turbine Torque Developers List
> Subject: Re: moved torque from project's source tree
> 
> You can add attachments to an email to the list.  Or a link to a
tarball
> of the diff's would be good as well, if there are a lot of changes.
> 
> john mcnally
> 
> On Mon, 2002-05-20 at 09:34, Stephen Haberman wrote:
> > Hello,
> >
> > I've modified the build.properties and build-torque.xml so that
Torque
> > can sit in another directory specified by torque.home in the user's
> > build.properties file and then a project's build.xml file delegates
it's
> > Torque target out to the ${torque.home}/build-torque.xml.
> >
> > Most of the ideas are from the Maven project; I think having a
separate
> > Torque directory that's installed like an application on the system
> > instead of dropped into each project's source tree is more organized
and
> > easier to maintain.
> >
> > After browsing the Scarab build file, I also implemented it's
uptodate
> > idea into the build-torque.xml file so that it will regenerate the
OM
> > and SQL files only when the schema changes.
> >
> > Though it's not related to the main refactoring of moving Torque
into
> > it's own directory, within my own project, I also used some of
Maven's
> > callbacks to integrate Torque within the Maven build process. In a
> > Maven-enabled project, just running "ant" will automatically check
that
> > the schema is uptodate before compiling (the check is actually done
in
> > the build-torque.xml as it's not Maven-specific).
> >
> > Is there any interest in the modifications I've made? If so, should
I
> > send the files as attachments or cut and paste the contents into an
> > email?
> >
> > I'm certainly open to criticisms, both constructive and otherwise,
to
> > the changes I've implemented. I'd really like to see this integrated
> > into Torque, but I know I've probably missed some things and got too
> > ambitious in my property renaming effort.
> >
> > Let me know what I need to do next. Or if there's no interest,
that's
> > fine, too...I think it's a great idea, but I'm a little biased.
> >
> > Thanks,
> > Stephen
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:turbine-torque-dev-
> [EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:turbine-torque-dev-
> [EMAIL PROTECTED]>
> >
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-dev-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-torque-dev-
> [EMAIL PROTECTED]>

Attachment: project.properties
Description: Binary data

<?xml version="1.0"?>
<project name="maven" default="maven:jar" basedir=".">
  <property file="${user.home}/build.properties"/>
  <property file="build.properties"/>
  <property file="project.properties"/>

  <!-- Tie Torque into Maven -->
  <property
    name="maven.core.callback.pre-compile.buildFile"
    value="${torque.home}/build-torque.xml"/>
  <property
    name="maven.core.callback.pre-compile.buildTarget"
    value="main"/>
  <property
    name="maven.core.callback.pre-clean.buildFile"
    value="${torque.home}/build-torque.xml"/>
  <property
    name="maven.core.callback.pre-clean.buildTarget"
    value="clean"/>

  <!-- maven:start -->
  
  <target name="maven:iutest">
    <ant antfile="${maven.home}/plugins/iutest/build.xml" target="iutest"/>
  </target>

  <target name="maven:update-jars">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="update-jars"/>
  </target>

  <target name="maven:docs">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="docs"/>
  </target>

  <target name="maven:cvs-change-log">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="cvs-change-log"/>
  </target>

  <target name="maven:compile">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="compile"/>
  </target>

  <target name="maven:pdf">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="pdf"/>
  </target>

  <target name="maven:validate-war">
    <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="validate-war"/>
  </target>

  <target name="maven:env">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="env"/>
  </target>

  <target name="maven:deploy-site">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="deploy-site"/>
  </target>

  <target name="maven:gump-descriptor">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="gump-descriptor"/>
  </target>

  <target name="maven:announce">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="announce"/>
  </target>

  <target name="maven:install-jar">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="install-jar"/>
  </target>

  <target name="maven:war">
    <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="war"/>
  </target>

  <target name="maven:dist">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="dist"/>
  </target>

  <target name="maven:task-list">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="task-list"/>
  </target>

  <target name="maven:javadocs">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="javadocs"/>
  </target>

  <target name="maven:run-singletest">
    <ant antfile="${maven.home}/plugins/test/build.xml" target="run-singletest"/>
  </target>

  <target name="maven:jar">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="jar"/>
  </target>

  <target name="maven:docs-quick">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="docs-quick"/>
  </target>

  <target name="maven:validate-pom">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="validate-pom"/>
  </target>

  <target name="maven:ear">
    <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="ear"/>
  </target>

  <target name="maven:test">
    <ant antfile="${maven.home}/plugins/test/build.xml" target="test"/>
  </target>

  <target name="maven:deploy-dist">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="deploy-dist"/>
  </target>

  <target name="maven:maven-update">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="maven-update"/>
  </target>

  <target name="maven:generate-reactor">
    <ant antfile="${maven.home}/plugins/reactor/build.xml" target="generate-reactor"/>
  </target>

  <target name="maven:fo">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="fo"/>
  </target>

  <target name="maven:clean">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="clean"/>
  </target>

  <target name="maven:site">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="site"/>
  </target>

  <target name="maven:dist-build">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="dist-build"/>
  </target>

  <target name="maven:cross-ref">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="cross-ref"/>
  </target>

  <target name="maven:activity-log">
    <ant antfile="${maven.home}/plugins/docs/build.xml" target="activity-log"/>
  </target>

  <target name="maven:verify-project">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="verify-project"/>
  </target>

  <target name="maven:metrics">
    <ant antfile="${maven.home}/plugins/metrics/build.xml" target="metrics"/>
  </target>

  <target name="maven:check-source">
    <ant antfile="${maven.home}/plugins/core/build.xml" target="check-source"/>
  </target>

  <!-- maven:end -->

  <!-- torque:start -->

  <target name="torque:main">
    <ant antfile="${torque.home}/build-torque.xml" target="main"/>
  </target>

  <target name="torque:sql">
    <ant antfile="${torque.home}/build-torque.xml" target="sql"/>
  </target>

  <target name="torque:doc">
    <ant antfile="${torque.home}/build-torque.xml" target="doc"/>
  </target>

  <target name="torque:create-db">
    <ant antfile="${torque.home}/build-torque.xml" target="create-db"/>
  </target>

  <target name="torque:insert-sql">
    <ant antfile="${torque.home}/build-torque.xml" target="insert-sql"/>
  </target>

  <target name="torque:jdbc">
    <ant antfile="${torque.home}/build-torque.xml" target="jdbc"/>
  </target>

  <target name="torque:datasql">
    <ant antfile="${torque.home}/build-torque.xml" target="datasql"/>
  </target>

  <target name="torque:id-table-init-sql">
    <ant antfile="${torque.home}/build-torque.xml" target="id-table-init-sql"/>
  </target>

  <target name="torque:datadump">
    <ant antfile="${torque.home}/build-torque.xml" target="datadump"/>
  </target>

  <target name="torque:datadtd">
    <ant antfile="${torque.home}/build-torque.xml" target="datadtd"/>
  </target>

  <target name="torque:om">
    <ant antfile="${torque.home}/build-torque.xml" target="om"/>
  </target>

  <target name="torque:sql2xml">
    <ant antfile="${torque.home}/build-torque.xml" target="sql2xml"/>
  </target>

  <target name="torque:ojb-repository">
    <ant antfile="${torque.home}/build-torque.xml" target="ojb-repository"/>
  </target>

  <target name="torque:ojb-model">
    <ant antfile="${torque.home}/build-torque.xml" target="ojb-model"/>
  </target>

  <!-- torque:end -->

</project>

Attachment: build.properties
Description: Binary data

<project name="Torque" default="main" basedir=".">

  <property name="build.properties" value="${torque.home}/build.properties"/>
  <property file="${torque.home}/build.properties"/>
  <property name="torque.lib.dir" value="${torque.home}/lib"/>
  <property name="torque.idTableXMLFile" value=""/>

  <!-- Build classpath -->
  <path id="torque-classpath">
    <fileset dir="${torque.lib.dir}">
      <include name="**/*.jar"/>
    </fileset>
  </path>

  <!-- ================================================================ -->
  <!-- M A I N  T A R G E T                                             -->
  <!-- ================================================================ -->
  <!-- This default target will run all the targets that generate       -->
  <!-- source. You will probably only run this target once then         -->
  <!-- call individual targets as necessary to update your sources      -->
  <!-- when you change your XML schema.                                 -->
  <!-- ================================================================ -->

  <target
    name="main"
    description="==> generates sql + om classes">

    <antcall target="sql"/>
    <antcall target="om"/>
  </target>

  <!-- ================================================================ -->
  <!-- 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="sql-check"
    description="==> checks whether the sql needs executed">
    <uptodate 
      property="torque.sql.uptodate"
      targetfile="${torque.target.sql.dir}/report.${torque.project}.sql.generation">
      <srcfiles dir="${torque.src.dir}" includes="*-schema.xml"/>
    </uptodate>
  </target>

  <target
    name="sql"
    description="==> generates the SQL for your project"
  	depends="sql-check"
  	unless="torque.sql.uptodate">

    <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="${torque..template.SQLControl}"
      outputDirectory="${torque.target.sql.dir}"
      templatePath="${torque.template.path}"
      basePathToDbProps="${torque.template.path}/sql/base/"
      sqldbmap="${torque.target.sql.dir}/sqldb.map"
      outputFile="report.${torque.project}.sql.generation"
      targetDatabase="${torque.database}"
      idTableXMLFile="${torque.idTableXMLFile}">
      <fileset dir="${torque.src.dir}">
        <include name="*-schema.xml"/>
      </fileset>
    </torque-sql>
  </target>

  <!-- ================================================================ -->
  <!-- G E N E R A T E   D O C S                                        -->
  <!-- ================================================================ -->

  <target name="doc-check"
    description="==> checks whether the doc needs executed">
    <uptodate 
      property="torque.doc.uptodate"
      targetfile="${torque.target.sql.dir}/report.${torque.project}.doc.generation">
      <srcfiles dir="${torque.src.dir}" includes="*-schema.xml"/>
    </uptodate>
  </target>

  <target
    name="doc"
    description="==> generates documentation for your datamodel"
    depends="doc-check"
    unless="torque.doc.update">

    <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="${torque.template.SQLControl}"
      outputDirectory="${torque.target.sql.dir}"
      templatePath="${torque.template.path}"
      basePathToDbProps="${torque.template.path}/sql/base/"
      sqldbmap="${torque.target.sql.dir}/sqldb.map"
      outputFile="report.${torque.project}.doc.generation"
      targetDatabase="${torque.database}"
      idTableXMLFile="${torque.idTableXMLFile}">
      <fileset dir="${torque.src.dir}">
        <include name="*-schema.xml"/>
      </fileset>
    </torque-doc>
  </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="create-db"
    unless="torque.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
      controlTemplate="sql/db-init/Control.vm"
      outputDirectory="${torque.target.sql.dir}"
      targetDatabase="${torque.database}"
      templatePath="${torque.template.path}"
      outputFile="create-db.sql">
      <fileset dir="${torque.src.dir}">
        <include name="*-schema.xml"/>
      </fileset>
    </torque-create-db>

    <echo>
      Executing the create-db.sql script ...
    </echo>

    <sql
      driver="${torque.database.driver}"
      url="${torque.database.createUrl}"
      userid="${torque.database.user}"
      password="${torque.database.password}"
      src="${torque.target.sql.dir}/create-db.sql"
      autocommit="true"
      onerror="continue">
      <classpath refid="torque-classpath"/>
    </sql>
  </target>

  <!-- ================================================================ -->
  <!-- I N S E R T  S I N G L E  S Q L  F I L E S                       -->
  <!-- ================================================================ -->

  <target
    name="insert-sql">

    <taskdef
      name="torque-insert-sql"
      classname="org.apache.torque.task.TorqueSQLExec">
      <classpath refid="torque-classpath"/>
    </taskdef>

    <torque-insert-sql
      driver="${torque.database.driver}"
      url="${torque.database.url}"
      userid="${torque.database.user}"
      password="${torque.database.password}"
      autocommit="true"
      onerror="continue"
      sqldbmap="${torque.target.sql.dir}/sqldb.map"
      srcDir="${torque.target.sql.dir}">
      <classpath refid="torque-classpath"/>
    </torque-insert-sql>
  </target>

  <!-- ================================================================ -->
  <!-- J D B C  TO  X M L                                               -->
  <!-- ================================================================ -->

  <target
    name="jdbc"
    description="==> jdbc to xml">

    <echo message="+-----------------------------------------------+"/>
    <echo message="|                                               |"/>
    <echo message="| Generating XML from JDBC connection !         |"/>
    <echo message="| Woo hoo!                                      |"/>
    <echo message="|                                               |"/>
    <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
      dbUrl="${torque.database.url}"
      dbDriver="${torque.database.driver}"
      dbUser="${torque.database.user}"
      dbPassword="${torque.database.password}"
      dbSchema="${databaseSchema}"
      outputFile="${torque.home}/${outputDirectory}/schema.xml"
      sameJavaName="${torque.sameJavaName}"
    />
  </target>

  <!-- ================================================================ -->
  <!-- Generate SQL from XML data file                                  -->
  <!-- ================================================================ -->

  <target
    name="datasql"
    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="${torque.template.DataSQLControl}"
      outputDirectory="${torque.target.sql.dir}"
      templatePath="${torque.template.path}"
      outputFile="${torque.project}-data.sql"
      xmlFile="${torque.src.dir}/${torque.project}-schema.xml"
      dataXmlFile="${torque.target.sql.dir}/${torque.project}-data.xml"
      dataDTD="${torque.target.sql.dir}/${torque.project}-data.dtd"
      targetDatabase="${torque.database}"
      sqldbmap="${torque.target.sql.dir}/sqldb.map"
    />
  </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">

    <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="${torque.template.path}/sql/id-table/project.props"
      controlTemplate="${torque.template.idTableControl}"
      templatePath="${torque.template.path}"
      suffix="-idtable-init"
      sqldbmap="${torque.target.sql.dir}/sqldb.map"
      outputDirectory="${torque.target.sql.dir}"
      outputFile="${torque.database}-id-table-init.sql"
      targetDatabase="${torque.database}">
      <fileset dir="${torque.src.dir}">
        <include name="*-schema.xml"/>
        <exclude name="id-table-schema.xml"/>
      </fileset>
    </torque-sql>
  </target>

  <!-- ================================================================ -->
  <!-- Dump data from database into xml file                            -->
  <!-- ================================================================ -->

  <target
    name="datadump"
    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="${torque.template.DataDumpControl}"
      outputDirectory="${torque.target.sql.dir}"
      templatePath="${torque.template.path}"
      outputFile="report.${torque.project}.datadump.generation"
      xmlFile="${torque.src.dir}/${torque.project}-schema.xml"
      torque.database.driver="${torque.database.driver}"
      databaseUrl="${torque.database.url}"
      torque.database.user="${torque.database.user}"
      torque.database.password="${torque.database.password}"
      databaseName="${databaseName}"
    />
  </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="datadtd"
    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="${torque.template.DataDTDControl}"
      outputDirectory="${torque.target.sql.dir}"
      templatePath="${torque.template.path}"
      outputFile="report.${torque.project}.datadtd.generation"
      xmlFile="${torque.target.sql.dir}/${torque.project}-schema.xml"
    />
  </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="om-check"
    description="==> checks whether the om needs executed">
    <uptodate 
      property="torque.om.uptodate"
      targetfile="${torque.target.java.dir}/report.${torque.project}.om.generation">
      <srcfiles dir="${torque.src.dir}" includes="*-schema.xml"/>
    </uptodate>
  </target>


  <target
    name="om"
    description="==> generates the Peer-based object model for your project"
    depends="om-check"
    unless="torque.om.uptodate">

    <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="${torque.template.OMControl}"
      outputDirectory="${torque.target.java.dir}"
      templatePath="${torque.template.path}"
      outputFile="report.${torque.project}.om.generation"
      targetPackage="${torque.target.java.package}"
      targetDatabase="${torque.database}">
      <fileset dir="${torque.src.dir}">
        <include name="*-schema.xml"/>
        <exclude name="id-table-schema.xml"/>
      </fileset>
    </torque-om>
  </target>

  <!-- =================================================================== -->
  <!-- S Q L  T O  X M L                                                   -->
  <!-- =================================================================== -->
  <!-- Create an xml schema from an sql schema.                            -->
  <!--                                                                     -->
  <!--  inputFile: The input sql file. This must be valid sql file but     -->
  <!--             it not not be in any specific format.                   -->
  <!-- outputFile: The file where the xml schema will be written           -->
  <!-- =================================================================== -->

  <target
    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
      inputFile="${torque.target.sql.dir}/schema.sql"
      outputFile="${torque.target.sql.dir}/schema.xml"
    />
  </target>

  <!-- =================================================================== -->
  <!-- =================================================================== -->
  <!-- O J B   S T U F F                                                   -->
  <!-- =================================================================== -->
  <!-- =================================================================== -->

  <target
    name="ojb-repository">

    <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="${torque.target.java.package}"
      targetDatabase="${torque.database}"
      outputDirectory="${torque.target.java.dir}/ojb"
      templatePath="${torque.template.path}"
      sqldbmap="${torque.target.sql.dir}/sqldb.map"
      outputFile="report.${torque.project}.ojb.generation">
      <fileset dir="${torque.src.dir}">
        <include name="*-schema.xml"/>
      </fileset>
    </ojb-repository>
  </target>

  <target
    name="ojb-model">

    <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="${torque.target.java.package}"
      targetDatabase="${torque.database}"
      outputDirectory="${torque.target.java.dir}/ojb"
      templatePath="${torque.template.path}"
      sqldbmap="${torque.target.sql.dir}/sqldb.map"
      outputFile="report.${torque.project}.ojb.generation">
      <fileset dir="${torque.src.dir}">
        <include name="*-schema.xml"/>
      </fileset>
    </ojb-model>
  </target>

  <!-- =================================================================== -->
  <!-- =================================================================== -->
  <!-- C L E A N   T A R G E T                                             -->
  <!-- =================================================================== -->
  <!-- =================================================================== -->
  <target
    name="clean"
    description="==> removes all Torque-generated files">

  </target>
</project>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to