jvanzyl     01/05/12 23:31:29

  Added:       conf/torque build.bat build.sh build.xml
  Removed:     conf/torque torque.bat torque.sh torque.xml
  Log:
  - standardizing build system
  
  Revision  Changes    Path
  1.1                  jakarta-turbine/conf/torque/build.bat
  
  Index: build.bat
  ===================================================================
  @echo off
  
  REM --------------------------------------------
  REM No need to edit anything past here
  REM --------------------------------------------
  
  :final
  
  if "%JAVA_HOME%" == "" goto javahomeerror
  if exist %JAVA_HOME%\lib\tools.jar set 
CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
  
  set LOCALCLASSPATH="%CLASSPATH%"
  for %%i in ("lib\*.jar") do call "lcp.bat" "%%i"
  
  set _JAVAC=%JAVAC%
  set JAVAC=classic
  if not "%JIKES%" == "" set JAVAC=jikes
  
  %JAVA_HOME%\bin\java.exe -classpath "%LOCALCLASSPATH%" -DJAVAC=%JAVAC% 
org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
  
  goto end
  
  REM -----------ERROR-------------
  :javahomeerror
  echo "ERROR: JAVA_HOME not found in your environment."
  echo "Please, set the JAVA_HOME variable in your environment to match the"
  echo "location of the Java Virtual Machine you want to use."
  
  :end
  set LOCALCLASSPATH=
  set JAVAC=%_JAVAC%
  set _JAVAC=
  
  
  
  1.1                  jakarta-turbine/conf/torque/build.sh
  
  Index: build.sh
  ===================================================================
  #!/bin/sh
  #
  # $Id: build.sh,v 1.1 2001/05/13 06:31:29 jvanzyl Exp $
  #
  
  # convert the existing path to unix
  if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
     CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  fi
  
  for i in @JARS@
  do
      CLASSPATH=${CLASSPATH}:$i
  done    
  
  # convert the existing path to windows
  if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
     CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  fi
  
  # if torque hangs, you may need to boost the memory here
  # for example, -Xmx64m will boost the max heap size to 64 megs with sun's vm
  ${JAVA_HOME}/bin/java -classpath ${CLASSPATH} org.apache.tools.ant.Main "$@"
  
  
  
  1.1                  jakarta-turbine/conf/torque/build.xml
  
  Index: build.xml
  ===================================================================
  <project name="Torque" default="main" basedir=".">
  
    <property name="torque.home" value="@TORQUE_HOME@"/>
    <property name="torque.dir" value="torque.home"/>
    <property name="torque.config" value="${torque.home}/config"/>
    <property name="torque.props" value="${torque.config}/torque.props"/>
    <property name="torque.macros" value="${torque.config}/torque.macros"/>
  
    <!-- Build classpath -->
    <path id="classpath">
      <fileset dir="lib">
        <include name="**/*.jar"/>
      </fileset>
    </path>
  
    <!--
         Load the torque properties file. All the targets use the
         information stored in the properties file. Edit the properties
         file! Not this build file!
    -->
  
    <property file="${torque.props}"/>
  
  
    <!-- ================================================================ -->
    <!-- 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">
      <antcall target="project-sql"/>
      <antcall target="project-om"/>
    </target>
  
  
    <!-- ================================================================ -->
    <!-- I N I T  T A S K  T A R G E T                                    -->
    <!-- ================================================================ -->
    <!-- Taskdefs are defined inside this target as Ant seems to have     -->
    <!-- problems defining them at the top level.                         -->
    <!-- ================================================================ -->
  
    <target name="init-tasks">
  
      <taskdef name="torque-datasql"
        classname="org.apache.turbine.torque.TorqueDataSQLTask">
        <classpath refid="classpath"/>
      </taskdef>
  
      <taskdef name="torque-datadump"
        classname="org.apache.turbine.torque.TorqueDataDumpTask">
        <classpath refid="classpath"/>
      </taskdef>
  
      <taskdef name="torque-datadtd"
        classname="org.apache.turbine.torque.TorqueDataDTDTask">
        <classpath refid="classpath"/>
      </taskdef>
  
      <taskdef name="torque-sql"
        classname="org.apache.turbine.torque.TorqueSQLTask">
        <classpath refid="classpath"/>
      </taskdef>
  
      <taskdef name="torque-om"
        classname="org.apache.turbine.torque.TorqueObjectModelTask">
        <classpath refid="classpath"/>
      </taskdef>
  
      <!--taskdef name="torque-intake"
        classname="org.apache.turbine.torque.TorqueIntakeTask">
        <classpath refid="classpath"/>
      </taskdef-->
  
      <taskdef name="sql-xml"
        classname="org.apache.turbine.torque.TorqueSQLTransformTask">
        <classpath refid="classpath"/>
      </taskdef>
  
      <taskdef name="texen"
        classname="org.apache.velocity.texen.ant.TexenTask">
        <classpath refid="classpath"/>
      </taskdef>
  
    </target>
  
    <!-- ================================================================ -->
    <!-- Generate SQL from XML data file                                  -->
    <!-- ================================================================ -->
  
    <target name="project-datasql" depends="init-tasks">
  
      <echo message="+-----------------------------------------------+"/>
      <echo message="|                                               |"/>
      <echo message="| Generating SQL from data XML !                |"/>
      <echo message="| Woo hoo!                                      |"/>
      <echo message="|                                               |"/>
      <echo message="+-----------------------------------------------+"/>
      <echo message=" taking torque.props from: ${torque.props}"/>
  
      <torque-datasql
        contextProperties="${torque.props}"
        controlTemplate="${DataSQLControlTemplate}"
        outputDirectory="${torque.home}/${outputDirectory}"
        templatePath="${templatePath}"
        outputFile="report.${project}.datasql.generation"
        xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
        dataXmlFile="${torque.home}/${schemaDirectory}/${project}-data.xml"
        dataDTD="${torque.home}/${schemaDirectory}/${project}-data.dtd"
        databaseName="${databaseName}"
        targetDatabase="${database}"
      />
  
    </target>
  
    <!-- ================================================================ -->
    <!-- Dump data from databse into xml file                             -->
    <!-- ================================================================ -->
  
    <target name="project-datadump" depends="init-tasks">
  
      <echo message="+-----------------------------------------------+"/>
      <echo message="|                                               |"/>
      <echo message="| Dumping the data from database into XML       |"/>
      <echo message="| Woo hoo!                                      |"/>
      <echo message="|                                               |"/>
      <echo message="+-----------------------------------------------+"/>
      <echo message=" taking torque.props from: ${torque.props}"/>
  
      <torque-datadump
        contextProperties="${torque.props}"
        controlTemplate="${DataDumpControlTemplate}"
        outputDirectory="${torque.home}/${outputDirectory}"
        templatePath="${templatePath}"
        outputFile="report.${project}.datadump.generation"
        xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
        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="project-datadtd" depends="init-tasks">
  
      <echo message="+-----------------------------------------------+"/>
      <echo message="|                                               |"/>
      <echo message="| Generating Data DTD for YOUR Turbine project! |"/>
      <echo message="| Woo hoo!                                      |"/>
      <echo message="|                                               |"/>
      <echo message="+-----------------------------------------------+"/>
  
      <torque-datadtd
        contextProperties="${torque.props}"
        controlTemplate="${DataDTDControlTemplate}"
        outputDirectory="${torque.home}/${outputDirectory}"
        templatePath="${templatePath}"
        outputFile="report.${project}.datadtd.generation"
        xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
      />
  
    </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="project-sql" depends="init-tasks">
  
      <echo message="+------------------------------------------+"/>
      <echo message="|                                          |"/>
      <echo message="| Generating SQL for YOUR Turbine project! |"/>
      <echo message="| Woo hoo!                                 |"/>
      <echo message="|                                          |"/>
      <echo message="+------------------------------------------+"/>
  
      <torque-sql
        contextProperties="${torque.props}"
        controlTemplate="${SQLControlTemplate}"
        outputDirectory="${torque.home}/${outputDirectory}"
        templatePath="${templatePath}"
        outputFile="report.${project}.sql.generation"
        xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
        targetDatabase="${database}"
      />
  
    </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" depends="init-tasks">
  
      <echo message="+------------------------------------------+"/>
      <echo message="|                                          |"/>
      <echo message="| Generating Peer-based Object Model for   |"/>
      <echo message="| YOUR Turbine project! Woo hoo!           |"/>
      <echo message="|                                          |"/>
      <echo message="+------------------------------------------+"/>
  
      <torque-om
        contextProperties="${torque.props}"
        controlTemplate="${OMControlTemplate}"
        outputDirectory="${torque.home}/${outputDirectory}"
        templatePath="${templatePath}"
        outputFile="report.${project}.om.generation"
        targetPackage="${targetPackage}.om"
        xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
      />
    
    </target>
  
    <!-- ================================================================ -->
    <!-- G E N E R A T E  T U R B I N E  S E R V I C E                    -->
    <!-- ================================================================ -->
    <!-- Generate turbine service code.                                   -->
    <!-- ================================================================ -->
    
    <target name="turbine-service" depends="init-tasks">
    
      <texen 
        contextProperties="service.props"
        controlTemplate="${ServiceControlTemplate}"
        outputDirectory="${outputDirectory}"
        templatePath="${templatePath}"
        outputFile="report.${project}.service.generation"
      />
      
    </target>
  
    <!-- =================================================================== -->
    <!-- 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" depends="init-tasks">
      <sql-xml
        inputFile="schema/schema.sql"
        outputFile="schema/schema.xml"
      />
    </target>
  
    <!-- ================================================================== -->
    <!-- Creates the API documentation                                      -->
    <!-- ================================================================== -->
    <target name="javadocs"
            description="--> generates the API documentation">
      <mkdir dir="${torque.home}/${outputDirectory}/javadoc"/>
      <javadoc sourcepath="${torque.home}/${outputDirectory}"
               packagenames="${targetPackage}.*"
               destdir="${outputDirectory}/javadoc"
               author="true"
               private="true"
               version="true"
               use="true"
      >
        <classpath refid="classpath"/>
      </javadoc>
    </target>
  
  </project>
  
  
  
  

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

Reply via email to