jvanzyl 01/08/01 09:24:54
Added: . build.properties build.xml test.sh
Log:
- moving build files to top level directory
Revision Changes Path
1.1 jakarta-turbine-tdk/build.properties
Index: build.properties
===================================================================
# -------------------------------------------------------------------
# Properties for building the TDK
# -------------------------------------------------------------------
tdk.version = 3.0a4
#tdk.version = 2.1
# These will be standardized when Maven is
# finished, sorry for the inconsistency in naming.
#turbine.home = ../jakarta-turbine-2.1
turbine.home = ../jakarta-turbine
torque.home = ../jakarta-turbine-torque
ant.src.home = ../jakarta-ant
hypersonic.home = ../hypersonic
velocity.home = ../jakarta-velocity
flux.home = ../jakarta-turbine-flux
#flux.home = ../jakarta-turbine-flux-2.1
tomcat.home = ../jakarta-tomcat-4.0
servletapi.home = ../jakarta-servletapi-4
site2.home = ../jakarta-site2
tdk.src = ./src
tdk.lib = ./lib
tdk.xdocs = ./xdocs
tdk.base = ./dist
tdk.dist = ./dist/tdk-${tdk.version}
#sample.dir = sample
sample.dir = sample30
1.1 jakarta-turbine-tdk/build.xml
Index: build.xml
===================================================================
<?xml version="1.0"?>
<!-- Build file for creating the TDK -->
<project name="TDK" default="test-dist" basedir=".">
<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it -->
<property file="build.properties" />
<property file="${user.home}/build.properties" />
<property name="tdk.dist.lib" value="${tdk.dist}/share/lib"/>
<property name="tdk.webapp" value="${tdk.dist}/webapps/tdk"/>
<property name="tdk.site" value="${tdk.dist}/webapps/site"/>
<property name="ant.dist" value="${ant.src.home}/dist"/>
<property name="ant.docs" value="${ant.dist}/docs"/>
<property name="ant.lib" value="${ant.dist}/lib"/>
<property name="hypersonic.docs" value="${hypersonic.home}/doc"/>
<property name="hypersonic.lib" value="${hypersonic.home}/demo"/>
<property name="turbine.lib" value="${turbine.home}/lib"/>
<property name="turbine.bin" value="${turbine.home}/bin"/>
<property name="turbine.docs" value="${turbine.home}/docs"/>
<property name="turbine.sql" value="${turbine.home}/src/sql"/>
<property name="turbine.conf" value="${turbine.home}/conf"/>
<property name="torque.templates" value="${torque.home}/src/templates"/>
<property name="torque.conf" value="${torque.home}/src/conf"/>
<property name="torque.bin" value="${torque.home}/bin"/>
<property name="velocity.docs" value="${velocity.home}/docs"/>
<property name="flux.src" value="${flux.home}/src"/>
<property name="flux.conf" value="${flux.home}/conf"/>
<property name="tomcat.dist" value="${tomcat.home}/dist"/>
<property name="tomcat.conf" value="${tomcat.dist}/conf"/>
<property name="servletapi.docs" value="${servletapi.home}/dist/docs/api"/>
<!-- Jar Files -->
<property name="hsql.jar" value="hsql.jar"/>
<!-- ================================================================== -->
<!-- Prints useful build environment values -->
<!-- ================================================================== -->
<target name="env">
<echo message="build.compiler = ${build.compiler}"/>
<echo message="java.class.path = ${java.class.path}"/>
<echo message="java.home = ${java.home}"/>
<echo message="user.home = ${user.home}"/>
<echo message=""/>
<available property="jdom.present" classname="org.jdom.JDOMException">
<classpath path="${java.class.path}"/>
</available>
</target>
<!-- =================================================================== -->
<!-- Copies dependent files -->
<!-- =================================================================== -->
<target name="prepare" depends="env">
<delete dir="${tdk.base}"/>
<mkdir dir="${tdk.dist}"/>
<!-- =================================================================== -->
<!-- T D K S O U R C E -->
<!-- =================================================================== -->
<copy todir="${tdk.dist}">
<fileset dir="${tdk.src}">
<exclude name="share/sample*/**"/>
</fileset>
</copy>
<copy todir="${tdk.dist}/share/sample">
<fileset dir="${tdk.src}/share/${sample.dir}"/>
</copy>
<!-- =================================================================== -->
<!-- T O M C A T -->
<!-- =================================================================== -->
<copy todir="${tdk.dist}">
<fileset dir="${tomcat.dist}">
<exclude name="webapps/**"/>
<exclude name="src/**"/>
<exclude name="LICENSE"/>
<exclude name="RELEASE*"/>
<exclude name="NEW_SPECS.txt"/>
</fileset>
</copy>
<delete file="${tdk.dist}/conf/server.xml"/>
<copy todir="${tdk.dist}/conf">
<fileset dir="${tomcat.conf}"/>
</copy>
<replace file="${tdk.dist}/conf/server.xml">
<replacetoken><![CDATA[<!-- Tomcat Examples Context -->]]></replacetoken>
<replacevalue><![CDATA[<!-- Comment Out Examples]]></replacevalue>
</replace>
<replace file="${tdk.dist}/conf/server.xml">
<replacetoken><![CDATA[<!-- PersistentManager]]></replacetoken>
<replacevalue><![CDATA[-->
<!-- PersistentManager]]></replacevalue>
</replace>
<replace file="${tdk.dist}/conf/server.xml">
<replacetoken><![CDATA[<Environment ]]></replacetoken>
<replacevalue><![CDATA[<!--
<Environment ]]></replacevalue>
</replace>
<replace file="${tdk.dist}/conf/server.xml">
<replacetoken><![CDATA[</Context>]]></replacetoken>
<replacevalue><![CDATA[</Context> -->
<!--
Uncomment the following if you want class reloading
for the default 'newapp' sample application.
-->
<!--
<Context path="/newapp" docBase="newapp" reloadable="true"/>
-->
<!-- TDK SITE -->
]]></replacevalue>
</replace>
<chmod dir="${tdk.dist}/bin" perm="+x" includes="**/*.sh"/>
<!-- =================================================================== -->
<!-- A N T -->
<!-- =================================================================== -->
<copy todir="${tdk.dist}/lib">
<fileset dir="${ant.lib}">
<include name="ant*.jar"/>
</fileset>
</copy>
<!-- =================================================================== -->
<!-- T U R B I N E R E S O U R C E S G E N E R A T O R -->
<!-- =================================================================== -->
<copy todir="${tdk.dist}/share/conf">
<fileset dir="${turbine.conf}"/>
</copy>
<!-- We're just trying to make the TDK work as it did with
Torque living in its new home. -->
<copy todir="${tdk.dist}/share/conf/torque/templates">
<fileset dir="${torque.templates}"/>
</copy>
<!-- =================================================================== -->
<!-- T U R B I N E L I B R A R Y J A R F I L E S -->
<!-- =================================================================== -->
<!--
We are not copying over the xerces jar because it is
in the global classpath. Xerces is used above to
prevent a sealing violoation that's happending when
crimson and parser jars are present in the global
classpath and xerces is present in the webapp
classpath. This fixes a sealing violation with
the XML-RPC service and will hopefully fix
the Jetspeed problem aswell.
-->
<copy todir="${tdk.dist.lib}">
<fileset dir="${turbine.lib}">
<exclude name="castor*.jar"/>
<exclude name="servlet*.jar"/>
</fileset>
</copy>
<copy todir="${tdk.dist.lib}">
<fileset dir="${torque.bin}">
<include name="*.jar"/>
</fileset>
</copy>
<!-- =================================================================== -->
<!-- T D K J A R F I L E S -->
<!-- =================================================================== -->
<!-- These are JAR files that we provide for convenience and/or added -->
<!-- functionality. For example we provide some unit testing -->
<!-- capability. -->
<copy todir="${tdk.dist.lib}">
<fileset dir="${tdk.lib}"/>
</copy>
<!-- =================================================================== -->
<!-- T U R B I N E J A R F I L E -->
<!-- =================================================================== -->
<copy todir="${tdk.dist.lib}">
<fileset dir="${turbine.bin}">
<include name="**/turbine*.jar"/>
</fileset>
</copy>
<!-- =================================================================== -->
<!-- H Y P E R S O N I C -->
<!-- =================================================================== -->
<copy todir="${tdk.dist.lib}">
<fileset dir="${hypersonic.lib}">
<include name="${hsql.jar}"/>
</fileset>
</copy>
<!-- =================================================================== -->
<!-- F L U X -->
<!-- =================================================================== -->
<copy todir="${tdk.dist}/share/flux">
<fileset dir="${flux.home}">
<exclude name="**/bin/**"/>
<exclude name="**/build/**"/>
</fileset>
</copy>
</target>
<!-- =================================================================== -->
<!-- -->
<!-- D O C U M E N T A T I O N T A R G E T -->
<!-- -->
<!-- =================================================================== -->
<!-- Gather all the documentation required for the TDK. -->
<!-- =================================================================== -->
<target name="docs-prepare-error" depends="prepare" unless="jdom.present">
<echo>
The Jakarta-Site2 module is not present! Please check
to make sure that you have checked it out from CVS.
<http://jakarta.apache.org/site/jakarta-site2.html>
</echo>
</target>
<target
name="docs"
depends="docs-prepare-error, prepare"
description="--> generates the HTML documentation"
if="jdom.present">
<taskdef
name="anakia"
classname="org.apache.velocity.anakia.AnakiaTask">
</taskdef>
<mkdir dir="${tdk.site}"/>
<anakia
basedir="${tdk.xdocs}"
destdir="${tdk.site}/"
extension=".html" style="./site.vsl"
projectFile="stylesheets/project.xml"
excludes="**/stylesheets/** empty.xml"
includes="**/*.xml"
lastModifiedCheck="true"
templatePath="${site2.home}/xdocs/stylesheets">
</anakia>
<copy file="${turbine.docs}/images/logo.gif" todir="${tdk.site}/images"/>
<!-- In case we have images someday
<copy todir="${tdk.site}/images" filtering="no">
<fileset dir="${tdk.xdocs}/images">
<include name="**/*.gif"/>
<include name="**/*.jpeg"/>
<include name="**/*.jpg"/>
</fileset>
</copy>
-->
<!-- In case we have CSS someday
<copy todir="${docs.dest}" filtering="no">
<fileset dir="${docs.src}">
<include name="**/*.css"/>
</fileset>
</copy>
-->
<!-- Copy documentation files from dependent modules -->
<copy todir="${tdk.site}/ant-docs">
<fileset dir="${ant.docs}"/>
</copy>
<copy todir="${tdk.site}/hypersonic-docs">
<fileset dir="${hypersonic.docs}"/>
</copy>
<copy todir="${tdk.site}/servletapi-docs">
<fileset dir="${servletapi.docs}"/>
</copy>
<copy todir="${tdk.site}/turbine-docs">
<fileset dir="${turbine.docs}"/>
</copy>
<copy todir="${tdk.site}/velocity-docs">
<fileset dir="${velocity.docs}"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- T E S T D I S T R I B U T I O N -->
<!-- =================================================================== -->
<!-- This a fully functional TDK, but lacks all the documentation in -->
<!-- an attempt to keep the size down while testing. -->
<!-- =================================================================== -->
<target name="test-dist" depends="prepare"
description="--> generates the TDK without docs">
</target>
<!-- =================================================================== -->
<!-- P R O D U C T I O N D I S T R I B U T I O N -->
<!-- =================================================================== -->
<!-- This is a fully functional TDK distribution -->
<!-- =================================================================== -->
<target name="production-dist" depends="docs,test-dist"
description="--> generates the full TDK distribution">
<property name="tmp.name" value="tdk-${tdk.version}"/>
<replace file="${tdk.dist}/conf/server.xml">
<replacetoken><![CDATA[<!-- TDK SITE -->]]></replacetoken>
<replacevalue><![CDATA[<Context path="" docBase="site" reloadable="true"/>]]>
</replacevalue>
</replace>
<!--
The actual packaging of tarballs and zip files
is dealt with in a shell script now.
-->
</target>
<!-- =================================================================== -->
<!-- C L E A N -->
<!-- =================================================================== -->
<!-- Cleans up generated files -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${tdk.base}"/>
</target>
<!-- =================================================================== -->
<!-- T E S T -->
<!-- =================================================================== -->
<!-- This is the start of a test harness to try and make it easy -->
<!-- to see if the TDK is working as a whole. -->
<!-- =================================================================== -->
<target name="test">
<!-- NOTE: this has stopped working now. I don't know what in ant
has changed and I don't have time right now to figure out
why. This has step has been replaced with the test.sh script
in this directory. -->
<!--
1. Setup the test distribution
-->
<antcall target="test-dist"/>
<!--
2. Generate the default sample app.
-->
<ant dir="../dist/tdk">
<property name="tomcat.home" value="."/>
</ant>
<!--
3. Run the 'init' target for the sample app. This
requires some tinkering to get the paths right,
and we have to introduce a new 'fullPathOutputDirectory'
specifically for the Ant <exec> task because it is
not obeying the 'dir' attribute. So I can't use
the same 'outputDirectory' for both the texen task
that creates the 'create-database.sh' script and
the <exec> task that executes. This is admittedly
a bit of goat fuck, but it works so that I can
create a TDK and test the sample app very rapidly.
This is first step in making the TDK a replicable
testing environment for other TDK developers.
-->
<ant
dir="../dist/tdk/webapps/newapp/WEB-INF/build"
target="create-database">
<property
name="schemaDirectory"
value="../dist/tdk/webapps/newapp/WEB-INF/conf"
/>
<property
name="outputDirectory"
value="../src"
/>
<property
name="fullPathOutputDirectory"
value="../dist/tdk/webapps/newapp/WEB-INF/src"
/>
</ant>
</target>
</project>
1.1 jakarta-turbine-tdk/test.sh
Index: test.sh
===================================================================
#!/bin/sh
# I am using this because I changed something that is
# stopping the "test" target not to work anymore. It
# is specifically the <exec> task that is now broken.
#
# This script lets me quickly test the TDK, and this
# probably more accurately represents how a user
# would use the TDK. I don't have time to figure
# out what's wrong with ant and this works fine
# so this is what I'm using for now.
VERSION=`grep ^tdk\.version build.properties | sed 's/tdk\.version *= *//'`
# Assemble the TDK
ant
# Move to the assembled TDK and generate
# the sample application.
(
cd ../dist/tdk-${VERSION}
ant
)
# Move to the generated sample application
# and execute the init target.
(
cd ../dist/tdk-${VERSION}/webapps/newapp/WEB-INF/build
ant init
)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]