You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by mp...@apache.org on 2001/06/26 22:12:27 UTC

cvs commit: jakarta-turbine/build build-turbine-om.xml torque.properties build.xml

mpoeschl    01/06/26 13:12:27

  Modified:    build    build.xml
  Added:       build    build-turbine-om.xml torque.properties
  Log:
  updated build:
  1. compile torque classes
  2. generate om/peer sources
  3. full compile
  
  Revision  Changes    Path
  1.12      +42 -6     jakarta-turbine/build/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/build/build.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- build.xml	2001/06/21 19:46:55	1.11
  +++ build.xml	2001/06/26 20:12:25	1.12
  @@ -9,7 +9,7 @@
   
       <!-- Set default values for the build -->
       <property file="build.properties" />
  -    
  +
       <!-- Allow any user specific values to override the defaults -->
       <property file="${user.home}/build.properties" />
   
  @@ -20,7 +20,7 @@
       <property name="src.dtd.dir" value="${src.dir}/dtd"/>
       <property name="final.name" value="${project}-${version}"/>
       <property name="final.dir" value="../${final.name}/"/>
  -    
  +
       <!-- Build classpath -->
       <path id="classpath">
           <fileset dir="${turbine.jars}">
  @@ -145,7 +145,7 @@
       <!-- ================================================================== -->
       <target name="compile"
               depends="prepare, prepare-jsp, prepare-freemarker,
  -                     prepare-castor"
  +                     prepare-castor, turbine-om"
               description="--> compiles the source code">
           <javac srcdir="${build.src}"
               destdir="${build.dest}"
  @@ -166,6 +166,28 @@
       </target>
   
       <!-- ================================================================== -->
  +    <!-- Compiles the torque sources                                        -->
  +    <!-- ================================================================== -->
  +    <target name="torque-compile"
  +            depends="prepare"
  +            description="--> compiles the torque source code">
  +        <javac srcdir="${build.src}"
  +            destdir="${build.dest}"
  +            excludes="**/package.html"
  +            includes="org/apache/turbine/torque/**"
  +            debug="${debug}"
  +            deprecation="${deprecation}"
  +            optimize="${optimize}">
  +
  +            <classpath refid="classpath"/>
  +        </javac>
  +
  +        <!-- copy database.dtd to the right place -->
  +        <copy file="${src.dtd.dir}/database.dtd"
  +              todir="${build.dest}/org/apache/turbine/torque/engine/database/transform"/>
  +    </target>
  +
  +    <!-- ================================================================== -->
       <!-- Compiles the source directory and creates a .jar file              -->
       <!-- ================================================================== -->
       <target name="jar"
  @@ -228,7 +250,7 @@
               </classpath>
           </available>
       </target>
  -    <target depends="check_for_jdom" name="docs-prepare-error" 
  +    <target depends="check_for_jdom" name="docs-prepare-error"
               unless="jdom.present">
           <echo>
               The Jakarta-Site2 module is not present! Please check
  @@ -275,7 +297,7 @@
               </fileset>
           </copy>
           -->
  -      
  +
       </target>
   
       <!-- ================================================================== -->
  @@ -295,7 +317,7 @@
       <!-- ================================================================== -->
       <target name="test" depends="compile"
           description="--> runs turbine unit tests">
  -        
  +
           <ant antfile="build-test.xml">
             <property file="build.properties"/>
           </ant>
  @@ -308,6 +330,20 @@
               depends="compile"
               description="--> generates the Turbine SQL for all the supported DBs">
           <ant antfile="build-turbine-sql.xml"/>
  +    </target>
  +
  +    <!-- ================================================================== -->
  +    <!-- Create the Turbine SQL for all the supported DBs.   -->
  +    <!-- ================================================================== -->
  +    <target name="turbine-om" depends="torque-compile"
  +            description="--> generates the Turbine OM/Peer classes">
  +        <ant antfile="build-turbine-om.xml"/>
  +        <copy todir="${build.src}/org/apache/turbine/om/security" filtering="yes">
  +            <fileset dir="${src.java.dir}/org/apache/turbine/om/security">
  +                <include name="**/*.java"/>
  +            </fileset>
  +        </copy>
  +
       </target>
   
   </project>
  
  
  
  1.1                  jakarta-turbine/build/build-turbine-om.xml
  
  Index: build-turbine-om.xml
  ===================================================================
  <project name="Turbine SQL" default="main" basedir=".">
  
    <!-- ================================================================ -->
    <!-- I N I T  T A R G E T                                             -->
    <!-- ================================================================ -->
    <!-- We are placing the taskdef initialization in a target of its     -->
    <!-- because the classpath will not be loaded within the taskdef      -->
    <!-- if the taskdef is a child of the project. It must be placed      -->
    <!-- with a target to work. This is a work around for a problem       -->
    <!-- in Ant, but it solves the problem of not having to alter         -->
    <!-- the classpath in the .sh|.bat scripts.                           -->
    <!-- ================================================================ -->
  
    <target name="init">
  
      <taskdef name="torque-om"
        classname="org.apache.turbine.torque.TorqueObjectModelTask">
        <classpath>
          <pathelement location="../bin/classes"/>
          <fileset dir="../lib">
            <include name="*.jar"/>
          </fileset>
        </classpath>
      </taskdef>
  
      <property name="schemaDirectory" value="../conf/master"/>
      <property name="OMControlTemplate" value="om/Control.vm"/>
      <property name="templatePath" value="../conf/torque/templates"/>
  
    </target>
  
    <!-- ================================================================ -->
    <!-- M A I N  T A R G E T                                             -->
    <!-- ================================================================ -->
    <!-- Generate Turbine SQL schema for supported DBs                    -->
    <!-- ================================================================ -->
  
    <target name="main" depends="init">
  
      <torque-om
        contextProperties="torque.properties"
        controlTemplate="${OMControlTemplate}"
        outputDirectory="../src/java"
        templatePath="${templatePath}"
        outputFile="report.turbine.om.generation"
        targetPackage="org.apache.om.security"
        xmlFile="${schemaDirectory}/turbine-schema.xml"
      />
  
    </target>
  
  </project>
  
  
  
  1.1                  jakarta-turbine/build/torque.properties
  
  Index: torque.properties
  ===================================================================
  # -------------------------------------------------------------------
  # 
  # T O R Q U E  C O N F I G U R A T I O N  F I L E
  #
  # used to generate the om/peer classes for the Turbine-db-security 
  # system
  # -------------------------------------------------------------------
  
  # -------------------------------------------------------------------
  # 
  #  T U R B I N E  P R O J E C T
  #
  # -------------------------------------------------------------------
  # This is the name of your Turbine project. Your generated sources
  # will be named using the project name selected below. If your
  # project=killerapp then you will have a generated:
  #
  # killerapp-schema.sql
  #
  # IMPORTANT!
  # This means that your project schema MUST be named
  # killerapp-schema.xml and it MUST be placed in the
  # schema directory for Torque to work property.
  #
  # The object model sources generated are independent of
  # the project name selected.
  # -------------------------------------------------------------------
  
  project=project
  
  # -------------------------------------------------------------------
  # 
  #  T A R G E T  D A T A B A S E
  #
  # -------------------------------------------------------------------
  # This is the target database, only considered when generating
  # the SQL for your Turbine project. Your possible choices are
  #
  # db2
  # hypersonic
  # mysql
  # oracle
  # postgresql
  # mssql
  #
  # Default: none
  # -------------------------------------------------------------------
  
  database=mysql
  
  # -------------------------------------------------------------------
  # 
  #  O B J E C T  M O D E L  I N F O R M A T I O N
  #
  # -------------------------------------------------------------------
  # These settings will allow you to customize the way your
  # Peer-based object model is created.
  # -------------------------------------------------------------------
  # addSaveMethod=true, adds tracking code to determine how to save an
  # object
  # set complexObjectModel=true to generate an om with collection
  # support
  # -------------------------------------------------------------------
  
  targetPackage=org.apache.turbine.om.security
  addSaveMethod=true
  addGetByNameMethod=true
  complexObjectModel=true
  basePrefix=Base
  
  # -------------------------------------------------------------------
  # 
  #  D A T A B A S E  S E T T I N G S
  #
  # -------------------------------------------------------------------
  # JDBC connection settings. This is used by the JDBCToXML task that
  # will create an XML database schema from JDBC metadata. These
  # settings are also used by the SQL Ant task to initialize your
  # Turbine system with the generated SQL.
  # -------------------------------------------------------------------
  
  databaseUrl = jdbc:mysql://127.0.0.1/turbine
  databaseDriver = org.gjt.mm.mysql.Driver
  databaseUser = user
  databasePassword = password
  databaseHost = 127.0.0.1
  
  # -------------------------------------------------------------------
  # You should NOT have to edit anything below here.
  # -------------------------------------------------------------------
  
  # -------------------------------------------------------------------
  # 
  #  C O N F I G U R A T I O N  D I R E C T O R Y
  #
  # -------------------------------------------------------------------
  # This is the directory that Torque looks in the find
  # its torque.props file.
  #
  # Default: none
  # -------------------------------------------------------------------
  
  configDir=./config
  
  # -------------------------------------------------------------------
  # 
  #  T E M P L A T E  P A T H
  #
  # -------------------------------------------------------------------
  
  templatePath = templates
  
  # -------------------------------------------------------------------
  # 
  #  C O N T R O L  T E M P L A T E S
  #
  # -------------------------------------------------------------------
  
  SQLControlTemplate = sql/base/Control.vm
  OMControlTemplate = om/Control.vm
  IntakeControlTemplate = intake/Control.vm
  ServiceControlTemplate = service/Control.vm
  idTableControlTemplate = sql/id-table/Control.vm
  DataDTDControlTemplate = data/Control.vm
  DataDumpControlTemplate = data/dump/Control.vm
  DataSQLControlTemplate = sql/load/Control.vm
  
  # -------------------------------------------------------------------
  # 
  #  O U T P U T  D I R E C T O R Y
  #
  # -------------------------------------------------------------------
  
  outputDirectory=src
  
  # -------------------------------------------------------------------
  # 
  #  S C H E M A  D I R E C T O R Y
  #
  # -------------------------------------------------------------------
  
  schemaDirectory=schema
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org