jvanzyl 01/09/20 18:57:15
Modified: . build.xml
src/tdk build-classic.properties build.xml
src/tdk/apps/2 build.properties build.xml
src/tdk/apps/3 build.properties
Log:
- we are now assuming that ${tdk.home} is going to be set in
${user.home}/build.properties. trying to work with completely relative
paths proves to be difficult when working with applications that
are generated within the container and in a cvs layout.
it also proves difficult to use relative paths when triggering
several builds across many directories. some of the build in
ant tasks, like <exec> do not obey the ${basedir} property. for
example if a target is called in the base directory of the
jakarta-turbine-tdk repository that
i) builds the tdk
ii) generates the sample app
iii) runs the "init" target in the sample app's build.xml
than you get various mismatches in how relative paths are used.
there is the <exec> as mentioned, and the texen task doesn't
obey the ${basedir} property either. i didn't think about that
when working on texen. i don't think having to set one property
is that difficult for those developing with the tdk. this should
only have to be done once as the tdk is moving toward being
a versionless entity itself but will manage the versions of
the components used within it via an upgrade mechanism. so the
directory name of the tdk will from now on always be "tdk", so
when you set the ${tdk.home} property once that's it.
- using hypersonic as the default database now for the sample app.
this means that there is no requirement to setup an industrial
strength rdb before running the sample app. this requirement is
probably a bit much for a novice.
- as hypersonic is now the default database it is now possible to
create a bundle that packages a servlet container and the sample
app ready to run. there is the requirement of setting the ${tdk.home}
property, but there is a <propertyfile> task in the optional jar
that could be used for adding this to the ${user.home}/build.properties
file. hmm, just thought of that. that would probably be very helpful.
an additional target could also be made to package up the self-contained
hypersonic-based sample app in a WAR file and post them so people
who have a servlet container setup can just drop in the WAR and
watch Turbine run. i borrowed the hypersonic self-contained idea
from Jetspeed.
as a side note jetspeed could use the TDK to produce an application
in the form they are currently distributing. i have modified turbine
2.x and 3.x so that ${variable} type references will be interpolated
in the TRP. Right now ${applicationRoot} and ${webappRoot} are
available for use. the ${webappRoot} value is currently being used
so that i can provide a full path to the database files that
hypersonic creates/uses.
i am now going to work on adding some targets so that an app using
a cvslayout can produce a self-contained hypersonic-based package.
two packages, one with a servlet container (basically the tdk and
the application sans the tdk gunk), and a WAR file. we could soon
have a place where people could download unpack-and-run demos
of:
jetspeed
jyve
tambora
scarab
orgami
the all singing all dancing sample app.
i will also make a minimalist hello world application as users
seem to be having difficulty so i'll try to remedy this problem
as quickly as possible. i underestimated the value of hello world
app that once existed, i will resurrect it ASAP.
Revision Changes Path
1.15 +40 -2 jakarta-turbine-tdk/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/build.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- build.xml 2001/09/19 16:37:14 1.14
+++ build.xml 2001/09/21 01:57:14 1.15
@@ -79,10 +79,48 @@
<delete dir="${tdk.target.dir}"/>
</target>
+ <!-- =================================================================== -->
+ <!-- T E S T -->
+ <!-- =================================================================== -->
+ <!-- 1) Builds the TDK -->
+ <!-- 2) Generates the sample application -->
+ <!-- 3) Runs the "init" target in the sample app build.xml file -->
+ <!-- =================================================================== -->
+
<target name="test">
<antcall target="test-dist"/>
- <ant dir="dist/tdk"/>
- <ant dir="dist/tdk/webapps/newapp/WEB-INF/build" target="init"/>
+ <ant dir="${tdk.home}"/>
+ <ant dir="${tdk.home}/webapps/newapp/WEB-INF/build" target="init">
+ <property
+ name="build.properties"
+ value="${tdk.home}/webapps/newapp/WEB-INF/build/build.properties"
+ />
+ </ant>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- S E L F C O N T A I N E D A P P -->
+ <!-- =================================================================== -->
+ <!-- This is the start of automating the build of a set of novice -->
+ <!-- apps that will allow people to get up and running quickly with -->
+ <!-- Turbine and the TDK. -->
+ <!-- =================================================================== -->
+
+ <target depends="test" name="scap">
+ <tar longfile="gnu" tarfile="tdk.tar">
+ <tarfileset dir="${tdk.target.dir}" mode="755">
+ <include name="**/*.sh"/>
+ </tarfileset>
+ <tarfileset dir="${tdk.target.dir}">
+ <include name="**"/>
+ <exclude name="**/*.sh"/>
+ </tarfileset>
+ </tar>
+
+ <gzip zipfile="tdk.tar.gz" src="tdk.tar"/>
+
+ <zip zipfile="tdk.zip" basedir="${tdk.target.dir}"/>
+
</target>
</project>
1.3 +8 -8 jakarta-turbine-tdk/src/tdk/build-classic.properties
Index: build-classic.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/build-classic.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- build-classic.properties 2001/09/17 18:45:07 1.2
+++ build-classic.properties 2001/09/21 01:57:14 1.3
@@ -1,8 +1,8 @@
-app.home=webapps/${turbine.app}
-app.conf=${app.home}/WEB-INF/conf
-build.dest=../classes
-src.dir=../src
-conf.dir=../conf
-app.root=webContext
-abs.conf.dir=webapps/${turbine.app}/WEB-INF/conf
-app.properties=/WEB-INF/conf/TurbineResources.properties
+app.home = webapps/${turbine.app}
+app.conf = ${app.home}/WEB-INF/conf
+build.dest = @TDK_HOME@/webapps/${turbine.app}/WEB-INF/classes
+src.dir = @TDK_HOME@/webapps/${turbine.app}/WEB-INF/src
+conf.dir = @TDK_HOME@/webapps/${turbine.app}/WEB-INF/conf
+app.root = webContext
+abs.conf.dir = webapps/${turbine.app}/WEB-INF/conf
+app.properties = /WEB-INF/conf/TurbineResources.properties
1.12 +20 -2 jakarta-turbine-tdk/src/tdk/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/build.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- build.xml 2001/09/19 01:54:42 1.11
+++ build.xml 2001/09/21 01:57:14 1.12
@@ -43,6 +43,7 @@
<antcall target="turbine-resources"/>
<antcall target="message"/>
<mkdir dir="webapps/${turbine.app}/WEB-INF/classes"/>
+ <mkdir dir="webapps/${turbine.app}/WEB-INF/db"/>
</target>
<target name="cvslayout-properties">
@@ -64,9 +65,10 @@
<antcall target="name-project-conf-files"/>
<antcall target="libs"/>
<antcall target="deployment-descriptor"/>
- <mkdir dir="webapps/${turbine.app}/WEB-INF/classes"/>
<antcall target="turbine-resources"/>
<antcall target="message"/>
+ <mkdir dir="webapps/${turbine.app}/WEB-INF/db"/>
+ <mkdir dir="webapps/${turbine.app}/WEB-INF/classes"/>
</target>
<target name="adjust-for-classic">
@@ -211,7 +213,6 @@
<filter token="BUILD_DEST" value="${build.dest}"/>
<filter token="SRC_DIR" value="${src.dir}"/>
<filter token="CONF_DIR" value="${conf.dir}"/>
- <filter token="TDK_HOME" value="${tdk.home}"/>
<filter token="TURBINE_VERSION" value="${turbine.version}"/>
<echo message="${app.home}"/>
@@ -230,6 +231,23 @@
<include name="**/images/**"/>
</fileset>
</copy>
+
+ <!-- Now we have to replace the @TDK_HOME@ token with
+ the literal string ${tdk.home}. We do not want the
+ actual value placed into the build.properties file
+ because what will be substituted is the value of
+ tdk.home on the machine where the sample app was
+ built and packaged. We obviously don't want this. -->
+
+ <echo message="!!!!!!!!!!!!"/>
+
+ <replace dir="${app.home}">
+ <include name="**/build.properties"/>
+ <replacetoken><![CDATA[@TDK_HOME@]]></replacetoken>
+ <replacevalue><![CDATA[${tdk.home}]]></replacevalue>
+ </replace>
+
+ <echo message="!!!!!!!!!!!!"/>
<!-- Now we have to adjust the the location of the src files
to correspond the specified package structure. -->
1.7 +9 -10 jakarta-turbine-tdk/src/tdk/apps/2/build.properties
Index: build.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/apps/2/build.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.properties 2001/09/17 00:21:17 1.6
+++ build.properties 2001/09/21 01:57:14 1.7
@@ -5,18 +5,17 @@
# -------------------------------------------------------------------
turbine.version=@TURBINE_VERSION@
-tdk.home=@TDK_HOME@
project=@PROJECT@
turbine.app = @PROJECT@
app.root = ../@PROJECT@
-webapp.root = ${tdk.home}/webapps/${turbine.app}
+build.webappRoot = @TDK_HOME@/webapps/${turbine.app}
target.package = @TARGET_PACKAGE@
target.directory = @TARGET_DIRECTORY@
-build.dest = ${webapp.root}/WEB-INF/classes
+build.dest = ${build.webappRoot}/WEB-INF/classes
version=0.1
src.dir=@SRC_DIR@
conf.dir=@CONF_DIR@
-master.conf.dir=${tdk.home}/tdk/ancillary/${turbine.version}/src/conf
+master.conf.dir=@TDK_HOME@/tdk/ancillary/${turbine.version}/src/conf
templatePath=${master.conf.dir}/torque/templates
debug=on
optimize=off
@@ -28,12 +27,12 @@
#
# -------------------------------------------------------------------
-database=mysql
-#database.manual.creation = true
-databaseUrl = jdbc:mysql://127.0.0.1/newapp
-databaseDriver = org.gjt.mm.mysql.Driver
-databaseUser = user
-databasePassword = password
+database=hypersonic
+databaseUrl = jdbc:hsqldb:${webappRoot}/WEB-INF/db/@PROJECT@
+build.databaseUrl = jdbc:hsqldb:${build.webappRoot}/WEB-INF/db/@PROJECT@
+databaseDriver = org.hsqldb.jdbcDriver
+databaseUser = sa
+databasePassword =
databaseHost = 127.0.0.1
# -------------------------------------------------------------------
1.13 +13 -6 jakarta-turbine-tdk/src/tdk/apps/2/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/apps/2/build.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- build.xml 2001/09/19 01:54:42 1.12
+++ build.xml 2001/09/21 01:57:14 1.13
@@ -4,7 +4,8 @@
<property file="${user.home}/build.properties"/>
<property file="build.properties"/>
-
+ <property name="build.properties" value="build.properties"/>
+
<path id="classpath">
<fileset dir="${tdk.home}/webapps/${project}/WEB-INF/lib">
<include name="**/*.jar"/>
@@ -166,7 +167,7 @@
<echo message="+------------------------------------------+"/>
<torque-sql
- contextProperties="build.properties"
+ contextProperties="${build.properties}"
controlTemplate="${SQLControlTemplate}"
outputDirectory="${src.dir}/sql"
templatePath="${templatePath}"
@@ -195,7 +196,7 @@
<echo message="+------------------------------------------+"/>
<torque-om
- contextProperties="build.properties"
+ contextProperties="${build.properties}"
controlTemplate="${OMControlTemplate}"
outputDirectory="${src.dir}/java"
templatePath="${templatePath}"
@@ -388,12 +389,18 @@
</target>
<!-- ================================================================ -->
- <!-- INSERT SINGLE SQL FILE -->
+ <!-- I N S E R T S I N G L E S Q L F I L E -->
<!-- ================================================================ -->
- <target name="insert-sql-file">
+
+ <target name="setDatabaseUrl" if="build.databaseUrl">
+ <property name="sqlInsert.databaseUrl" value="${build.databaseUrl}"/>
+ </target>
+
+ <target name="insert-sql-file" depends="setDatabaseUrl">
+ <property name="sqlInsert.databaseUrl" value="${databaseUrl}"/>
<sql
driver="${databaseDriver}"
- url="${databaseUrl}"
+ url="${sqlInsert.databaseUrl}"
userid="${databaseUser}"
password="${databasePassword}"
src="${sqlFile}"
1.5 +2 -2 jakarta-turbine-tdk/src/tdk/apps/3/build.properties
Index: build.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/apps/3/build.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- build.properties 2001/09/17 00:21:17 1.4
+++ build.properties 2001/09/21 01:57:15 1.5
@@ -9,10 +9,10 @@
project=@PROJECT@
turbine.app = @PROJECT@
app.root = ../@PROJECT@
-webapp.root = ${tdk.home}/webapps/${turbine.app}
+webappRoot = ${tdk.home}/webapps/${turbine.app}
target.package = @TARGET_PACKAGE@
target.directory = @TARGET_DIRECTORY@
-build.dest = ${webapp.root}/WEB-INF/classes
+build.dest = ${webappRoot}/WEB-INF/classes
version=0.1
src.dir=@SRC_DIR@
conf.dir=@CONF_DIR@
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]