You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tdk-dev@turbine.apache.org by jv...@apache.org on 2001/05/25 08:29:21 UTC
cvs commit: jakarta-turbine-tdk/src README_FIRST.txt build.properties build.xml
jvanzyl 01/05/24 23:29:21
Modified: src README_FIRST.txt build.properties build.xml
Log:
- changing the build process to allow the automatic integration
of an external turbine application into the TDK. this will allow
a common development strategy among different turbine applications.
i'm trying jyve as an example.
Revision Changes Path
1.7 +2 -2 jakarta-turbine-tdk/src/README_FIRST.txt
Index: README_FIRST.txt
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/README_FIRST.txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- README_FIRST.txt 2001/05/16 18:50:33 1.6
+++ README_FIRST.txt 2001/05/25 06:29:21 1.7
@@ -20,8 +20,8 @@
Now, you will need to start the Tomcat Servlet Engine:
- ./bin/catalina.sh <-- Unix
- ./bin/catalina.bat <-- Windows
+ ./bin/catalina.sh run [ or start ] <-- Unix
+ ./bin/catalina.bat run [ or start ] <-- Windows
Verify your installation by browsing
1.2 +7 -16 jakarta-turbine-tdk/src/build.properties
Index: build.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/build.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- build.properties 2001/05/06 17:56:21 1.1
+++ build.properties 2001/05/25 06:29:21 1.2
@@ -1,20 +1,11 @@
# -------------------------------------------------------------------------
-# This is where you control the initial generation of a Turbine
-# webapp.
-#
-# If you don't edit this file you will have the most basic webapp
-# generated for you. This may well be a good place to start because
-# you don't have to edit anything in this file and you won't require
-# any database connectivity. You can just run the newapp script to
-# try a Turbine webapp that has a few simple screens and actions.
-#
-# If you wish to do anything more complicated you will be required
-# to edit your project properties file after the webapp is generated
-# before it will work.
+# This is where you control the initial generation of the Turbine
+# sample webapp.
# -------------------------------------------------------------------------
-turbine.app.name=newapp
-turbine.app.type=peer
+turbine.app = newapp
-target.package=org.mycompany.newapp
-target.directory=org/mycompany/newapp
+target.package = org.mycompany.newapp
+target.directory = org/mycompany/newapp
+
+tdk.home = .
1.9 +241 -217 jakarta-turbine-tdk/src/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/build.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- build.xml 2001/05/23 17:28:46 1.8
+++ build.xml 2001/05/25 06:29:21 1.9
@@ -2,294 +2,318 @@
<!-- Build file for creating new applications with Turbine -->
-<project name="TDK" default="compile" basedir=".">
+<project name="TDK" default="application" basedir=".">
<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it -->
- <property file="${user.home}/.ant.properties" />
<property file="build.properties"/>
- <property name="newapp" value="${turbine.app.name}"/>
+ <property file="${user.home}/build.properties"/>
+
+ <!-- =================================================================== -->
+ <!-- P R O P E R T I E S -->
+ <!-- =================================================================== -->
+
+ <target name="properties">
+
+ <property name="tdk.home" value="${tdk.home}"/>
+ <property name="turbine.app.home" value="${tdk.home}/webapps/${turbine.app}"/>
+ <property name="turbine.app.logs" value="${turbine.app.home}/logs"/>
+ <property name="turbine.app.images" value="${turbine.app.home}/images"/>
+ <property name="turbine.app.templates" value="${turbine.app.home}/templates"/>
+ <property name="turbine.app.resources" value="${turbine.app.home}/resources"/>
+ <property name="turbine.app.webinf" value="${turbine.app.home}/WEB-INF"/>
+ <property name="turbine.app.conf" value="${turbine.app.home}/WEB-INF/conf"/>
+ <property name="turbine.app.db" value="${turbine.app.home}/WEB-INF/db"/>
+ <property name="turbine.app.src" value="${turbine.app.home}/WEB-INF/src"/>
+ <property name="turbine.app.classes" value="${turbine.app.home}/WEB-INF/classes"/>
+ <property name="turbine.app.lib" value="${turbine.app.home}/WEB-INF/lib"/>
+ <property name="turbine.app.build" value="${turbine.app.home}/WEB-INF/build"/>
+ <property name="turbine.app.project" value="${turbine.app.home}/WEB-INF/build/project"/>
+ <property name="turbine.app.torque" value="${turbine.app.home}/WEB-INF/build/bin/torque"/>
+ <property name="turbine.app.modules" value="${turbine.app.home}/WEB-INF/src/java/${target.directory}/modules"/>
+ <property name="turbine.app.view" value="velocity"/>
+ <property name="turbine.app.type" value="peer"/>
+ <property name="database" value="mysql"/>
+ <property name="torque.home" value="."/>
+ <property name="template.path" value="bin/torque/templates"/>
+ <property name="output.directory" value="../src"/>
+ <property name="schema.directory" value="../conf"/>
+
+ <property name="app.root" value="share/sample"/>
+ <property name="app.root.templates" value="${app.root}/templates"/>
+ <property name="app.root.resources" value="${app.root}/resources"/>
+ <property name="app.root.images" value="${app.root}/images"/>
+ <property name="app.root.webinf" value="${app.root}/WEB-INF"/>
+ <property name="app.root.build" value="${app.root}/WEB-INF/build"/>
+ <property name="app.root.conf" value="${app.root}/WEB-INF/conf"/>
+ <property name="app.root.modules" value="${app.root}/WEB-INF/src/java/modules"/>
+
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- S A M P L E A P P L I C A T I O N -->
+ <!-- =================================================================== -->
- <property name="tomcat.home" value="."/>
- <property name="newapp.home" value="${tomcat.home}/webapps/${newapp}"/>
- <property name="newapp.logs" value="${newapp.home}/logs"/>
- <property name="ant.home" value="."/>
-
- <property name="debug" value="on"/>
- <property name="deprecation" value="on"/>
- <property name="optimize" value="off"/>
-
- <property name="turbine.app.view" value="velocity"/>
- <property name="turbine.app.type" value="peer"/>
-
- <!-- Build classpath -->
- <path id="classpath">
- <fileset dir="./share/lib">
- <include name="**/*.jar"/>
- </fileset>
- <fileset dir="./lib">
- <include name="**/*.jar"/>
- </fileset>
- </path>
+ <target name="application" depends="properties">
+ <antcall target="webapp-structure"/>
+ <antcall target="torque"/>
+ <antcall target="turbine-schemas"/>
+ <antcall target="project"/>
+ <antcall target="project-libs"/>
+ <antcall target="flux"/>
+ <antcall target="turbine-resources"/>
+
+ <!-- =================================================================== -->
+ <!-- Here we cannot just simply compile all the sources because -->
+ <!-- Torque must be run first in order to generate the peers. Just -->
+ <!-- give the user some instructions on what to do next :-) -->
+ <!-- =================================================================== -->
+
+ <echo>
+
+ There are few things that you must do before
+ you can run the sample application. Everything
+ will be done for you automatically, but you must
+ change some properties for your project before
+ your Java and SQL sources can be fully generated.
+
+ Once you have made the necessary changes, you can
+ then run an initialization target with the build script
+ provided and the whole sample app will be setup for you!.
+
+ Detailed instructions on how to precede are outlined
+ outlined in the GETTING_STARTED.txt located in the
+ webapps/${turbine.app}/WEB-INF/build directory
+
+ </echo>
+
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- I N T E G R A T E A P P L I C A T I O N -->
<!-- =================================================================== -->
- <!-- Prepares the application directory -->
+ <!-- -->
<!-- =================================================================== -->
- <target name="prepare">
- <mkdir dir="${newapp.home}"/>
+
+ <target name="integrate" depends="application">
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- W E B A P P S T R U C T U R E -->
+ <!-- =================================================================== -->
+
+ <target name="webapp-structure">
+
+ <mkdir dir="${turbine.app.home}"/>
- <mkdir dir="${newapp.home}/logs"/>
- <mkdir dir="${newapp.home}/images"/>
- <mkdir dir="${newapp.home}/templates/app"/>
+ <mkdir dir="${turbine.app.logs}"/>
+ <mkdir dir="${turbine.app.images}"/>
+ <mkdir dir="${turbine.app.templates}"/>
- <mkdir dir="${newapp.home}/WEB-INF/build"/>
- <mkdir dir="${newapp.home}/WEB-INF/classes"/>
- <mkdir dir="${newapp.home}/WEB-INF/conf"/>
- <mkdir dir="${newapp.home}/WEB-INF/lib"/>
- <mkdir dir="${newapp.home}/WEB-INF/src"/>
+ <mkdir dir="${turbine.app.build}"/>
+ <mkdir dir="${turbine.app.classes}"/>
+ <mkdir dir="${turbine.app.conf}"/>
+ <mkdir dir="${turbine.app.src}"/>
+ <mkdir dir="${turbine.app.lib}"/>
- <!--
- Create separate directories for the java source
- and the SQL source as we are creating quite a
- few source files now. This follows standard
- practice more closely anyway.
- -->
+ <!-- ================================================================= -->
+ <!-- Create separate directories for the java source -->
+ <!-- and the SQL source as we are creating quite a -->
+ <!-- few source files now. This follows standard -->
+ <!-- practice more closely anyway. -->
+ <!-- ================================================================= -->
- <mkdir dir="${newapp.home}/WEB-INF/src/java"/>
- <mkdir dir="${newapp.home}/WEB-INF/src/sql"/>
+ <mkdir dir="${turbine.app.src}/java"/>
+ <mkdir dir="${turbine.app.src}/sql"/>
- <tstamp/>
</target>
- <!-- =================================================================== -->
- <!-- Copies dependent files -->
- <!-- =================================================================== -->
- <target name="gather" depends="prepare">
-
- <!-- Find and replace tokens -->
- <filter token="date" value="${TODAY}"/>
-
- <filter token="TOMCAT_HOME" value="${tomcat.home}"/>
- <filter token="NEWAPP" value="${newapp}"/>
- <filter token="PROJECT" value="${newapp}"/>
- <filter token="DATABASE" value="mysql"/>
- <filter token="TORQUE_HOME" value="."/>
- <filter token="TEMPLATE_PATH" value="bin/torque/templates"/>
- <filter token="OUTPUT_DIRECTORY" value="../src"/>
- <filter token="SCHEMA_DIRECTORY" value="project"/>
- <filter token="TARGET_PACKAGE" value="${target.package}"/>
+ <!-- ================================================================= -->
+ <!-- T O R Q U E -->
+ <!-- ================================================================= -->
- <!-- The newapp directories -->
- <property name="newapp.conf" value="${newapp.home}/WEB-INF/conf"/>
- <property name="newapp.db" value="${newapp.home}/WEB-INF/db"/>
- <property name="newapp.src" value="${newapp.home}/WEB-INF/src"/>
- <property name="newapp.lib" value="${newapp.home}/WEB-INF/lib"/>
- <property name="newapp.build" value="${newapp.home}/WEB-INF/build"/>
- <property name="newapp.project" value="${newapp.home}/WEB-INF/build/project"/>
- <property name="newapp.torque" value="${newapp.home}/WEB-INF/build/bin/torque"/>
+ <target name="torque">
- <!-- Copy the Torque config files -->
- <copy todir="${newapp.torque}" filtering="yes">
+ <copy todir="${turbine.app.torque}">
<fileset dir="share/conf/torque">
- <exclude name="torque.sh"/>
- <exclude name="torque.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name="build.xml"/>
<exclude name="schema/**"/>
</fileset>
</copy>
+
+ </target>
- <copy todir="${newapp.home}/WEB-INF/build" filtering="yes">
- <fileset dir="share/common/build">
- <exclude name="**/lib/*"/>
+ <!-- ================================================================= -->
+ <!-- T U R B I N E S C H E M A S -->
+ <!-- ================================================================= -->
+
+ <target name="turbine-schemas">
+
+ <copy todir="${turbine.app.conf}">
+ <fileset dir="share/conf/master">
+ <include name="turbine-schema.xml"/>
+ <include name="id-table-schema.xml"/>
</fileset>
</copy>
- <!-- Turn the filtering off for binary files because
- Ant takes a byte off the file. -->
-
- <copy todir="${newapp.home}/WEB-INF/build">
- <fileset dir="share/common/build">
- <include name="**/lib/*"/>
- </fileset>
+ </target>
+
+ <!-- ================================================================= -->
+ <!-- P R O J E C T L I B S -->
+ <!-- ================================================================= -->
+
+ <target name="project-libs">
+
+ <copy todir="${turbine.app.home}/WEB-INF/lib">
+ <fileset dir="share/lib"/>
</copy>
- <!--
- Little hack to make the project schema come out
- with the name of the app provided.
- -->
+ </target>
- <move
- file="${newapp.project}/project-schema.xml"
- tofile="${newapp.project}/${newapp}-schema.xml"
- />
+ <!-- ================================================================= -->
+ <!-- P R O J E C T -->
+ <!-- ================================================================= -->
+
+ <!--
+
+ These are all pretty much app specific. We can skip this
+ if an app is being exported to the TDK.
+
+ 1) WEB-INF/build/GETTING_STARTED.txt
+ 2) WEB-INF/src/ (needs transforming to package)
+ 3) templates/
+ 4) resources/
+ 5) images/
+
+ -->
- <move
- file="${newapp.project}/project.properties"
- tofile="${newapp.project}/${newapp}.properties"
- />
+ <target name="project">
+
+ <!-- ================================================================= -->
+ <!-- Copy the files specific to the application type -->
+ <!-- specified. But we can't copy the source files -->
+ <!-- yet because we have to change them a bit first -->
+ <!-- and create the directory structure that matches -->
+ <!-- the selected target package. -->
+ <!-- ================================================================= -->
+
+ <!-- T E M P L A T E S -->
+
+ <copy todir="${turbine.app.templates}">
+ <fileset dir="${app.root.templates}"/>
+ </copy>
- <!-- Copy master schemas into the project directory -->
+ <!-- R E S O U R C E S -->
- <copy todir="${newapp.project}" filtering="yes">
- <fileset dir="share/conf/master">
- <include name="turbine-schema.xml"/>
- <include name="id-table-schema.xml"/>
- </fileset>
+ <copy todir="${turbine.app.resources}">
+ <fileset dir="${app.root.resources}"/>
</copy>
- <copy todir="${newapp.home}/WEB-INF/" filtering="yes">
- <fileset dir="share/common/">
- <include name="web.xml"/>
- </fileset>
+ <!-- I M A G E S -->
+
+ <copy todir="${turbine.app.images}">
+ <fileset dir="${app.root.images}"/>
</copy>
- <!--
- Copy the files specific to the application type
- specified. But we can't copy the source files
- yet because we have to change them a bit first
- and create the directory structure that matches
- the selected target package.
- -->
-
- <copy todir="${newapp.home}" filtering="yes">
- <fileset dir="share/${turbine.app.view}/${turbine.app.type}">
- <exclude name="**/*.class"/>
- <exclude name="*/src"/>
- <exclude name="**/images"/>
- <exclude name="**/templates/**"/>
- </fileset>
+ <!-- B U I L D -->
+
+ <filter token="PROJECT" value="${turbine.app}"/>
+ <filter token="DATABASE" value="${database}"/>
+ <filter token="TORQUE_HOME" value="${torque.home}"/>
+ <filter token="TEMPLATE_PATH" value="${template.path}"/>
+ <filter token="OUTPUT_DIRECTORY" value="${output.directory}"/>
+ <filter token="SCHEMA_DIRECTORY" value="${schema.directory}"/>
+ <filter token="TARGET_PACKAGE" value="${target.package}"/>
+ <filter token="TARGET_PACKAGE" value="${target.package}"/>
+
+ <copy
+ file="${app.root.webinf}/web.xml"
+ tofile="${turbine.app.webinf}/web.xml"
+ filtering="yes"
+ />
+
+ <copy todir="${turbine.app.build}" filtering="yes">
+ <fileset dir="${app.root.build}"/>
</copy>
- <!--
- <copy todir="${newapp.home}/templates/app">
- <fileset dir="share/${turbine.app.view}/${turbine.app.type}/templates/app"/>
+ <copy todir="${turbine.app.conf}" filtering="yes">
+ <fileset dir="${app.root.conf}"/>
</copy>
- -->
<!--
- Filtering CANNOT be on for binary files or we end up
- gaining a byte in the transfer. All I know is
- that the original size of a binary file is increased
- one byte in size. I have reported this twice now
- to the Ant dev list and have never received a
- response so this is what we're doing.
- -->
-
- <copy todir="${newapp.home}/images">
- <fileset dir="share/${turbine.app.view}/${turbine.app.type}/images"/>
- </copy>
+ Little hack to make the project schema come out
+ with the name of the app provided.
+ -->
- <property
- name="module.dir"
- value="${newapp.src}/java/${target.directory}/modules"
+ <move
+ file="${turbine.app.conf}/project-schema.xml"
+ tofile="${turbine.app.conf}/${turbine.app}-schema.xml"
/>
- <mkdir dir="${module.dir}"/>
- <copy todir="${module.dir}" filtering="yes">
- <fileset dir="share/${turbine.app.view}/${turbine.app.type}/WEB-INF/src"/>
+ <move
+ file="${turbine.app.conf}/project-inputs.xml"
+ tofile="${turbine.app.conf}/${turbine.app}-inputs.xml"
+ />
+
+ <mkdir dir="${turbine.app.modules}"/>
+
+ <copy todir="${turbine.app.modules}" filtering="yes">
+ <fileset dir="${app.root.modules}"/>
</copy>
- <!-- ================================================================= -->
- <!-- F L U X -->
- <!-- ================================================================= -->
-
- <copy todir="${newapp.src}/java">
+ </target>
+
+ <!-- ================================================================= -->
+ <!-- F L U X -->
+ <!-- ================================================================= -->
+
+ <target name="flux">
+
+ <copy todir="${turbine.app.src}/java">
<fileset dir="share/flux/src/java"/>
</copy>
- <copy todir="${newapp.home}/templates/flux">
+ <copy todir="${turbine.app.home}/templates/flux">
<fileset dir="share/flux/src/templates"/>
</copy>
- <copy todir="${newapp.home}/resources">
+ <copy todir="${turbine.app.home}/resources">
<fileset dir="share/flux/src/resources">
<exclude name="skin.props"/>
</fileset>
</copy>
- <copy file="share/flux/conf/Flux.properties" todir="${newapp.conf}"/>
+ <copy file="share/flux/conf/Flux.properties" todir="${turbine.app.conf}"/>
<property name="flux.modules" value="org.apache.turbine.flux.modules"/>
- <!-- ================================================================= -->
- <!-- T U R B I N E R E S O U R C E S P R O P E R T I E S -->
- <!-- ================================================================= -->
+ </target>
- <!--
- This will dynamically generate the correct
- TurbineResources.properties file for this web
- application.
- -->
-
+ <!-- ================================================================= -->
+ <!-- T U R B I N E R E S O U R C E S P R O P E R T I E S -->
+ <!-- ================================================================= -->
+ <!-- This will dynamically generate the correct -->
+ <!-- TurbineResources.properties file for this web -->
+ <!-- application. -->
+ <!-- ================================================================= -->
+
+ <target name="turbine-resources">
+
<ant antfile="share/conf/build.xml" target="tr-props-without-db-values">
<property name="conf.home" value="share/conf"/>
<property name="master.home" value="share/conf/master"/>
- <property name="target.dir" value="${newapp.home}/WEB-INF/conf"/>
+ <property name="target.dir" value="${turbine.app.home}/WEB-INF/conf"/>
<property name="turbine.log" value="/logs/turbine.log"/>
<property name="view.type" value="${turbine.app.view}"/>
- <property name="database.name" value="${newapp}"/>
+ <property name="database.name" value="${turbine.app}"/>
<property name="module.packages" value="${target.package}.modules,${flux.modules}"/>
<property name="include.file" value="include = Flux.properties"/>
<property name="template.path" value="/templates/app,/templates/flux"/>
</ant>
- <!-- copy the lib directory over to the new app lib directory -->
- <copy todir="${newapp.home}/WEB-INF/lib">
- <fileset dir="${tomcat.home}/share/lib"/>
- </copy>
-
- <!-- ================================================================= -->
- <!-- F I X P E R M I S S I O N S -->
- <!-- ================================================================= -->
-
- <chmod dir="${newapp.home}" perm="ugo+rx" includes="**/*.sh" />
-
- </target>
-
- <!-- =================================================================== -->
- <!-- Make application directories -->
- <!-- =================================================================== -->
- <target name="compile" depends="gather">
- <!-- Print some information -->
- <echo message=""/>
- <echo message="NEWAPP is ${newapp}"/>
- <echo message=""/>
-
- <!--
- Invoke the post app creation action by looking
- at the app type requested.
- -->
-
- <antcall target="post-${turbine.app.type}"/>
-
- </target>
-
- <!-- =================================================================== -->
- <!-- P O S T P E E R A P P A C T I O N -->
- <!-- =================================================================== -->
- <!-- Here we cannot just simply compile all the sources because -->
- <!-- Torque must be run first in order to generate the peers. Just -->
- <!-- give the user some instructions on what to do next :-) -->
- <!-- =================================================================== -->
-
- <target name="post-peer">
- <echo>
-
- There are few things that you must do before
- you can run the sample peer application. Everything
- will be done for you automatically, but you must
- change some properties for your project before
- your Java and SQL sources can be fully generated.
-
- Once you have made the necessary changes, you can
- then run an initialization target with the build script
- provided and the whole sample app will be setup for you!.
-
- Detailed instructions on how to precede are outlined
- outlined in the GETTING_STARTED.txt located in the
- webapps/${newapp}/WEB-INF/build directory
-
- </echo>
</target>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-tdk-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-tdk-dev-help@jakarta.apache.org