updated build to automate the process of copying configuration to Tomcat 5,

and also have it generate logging configuration with selectable logging
directory
This commit is contained in:
Eric J. Bowersox 2006-01-26 07:04:42 +00:00
parent 00952ef543
commit b4e49e8b29
6 changed files with 77 additions and 19 deletions

View File

@ -24,6 +24,7 @@
# [Target directories] # [Target directories]
deploy.home=/home/erbo/venice deploy.home=/home/erbo/venice
# javadoc.home=${deploy.home}/javadoc # javadoc.home=${deploy.home}/javadoc
# logging.dir=${user.home}
# [Location of Servlet API 2.4] # [Location of Servlet API 2.4]
servlet.base=/usr/local/java/apache-tomcat-5.5.15 servlet.base=/usr/local/java/apache-tomcat-5.5.15
@ -80,3 +81,9 @@ rhino.base=/usr/local/java/rhino1_5R4_1
velocity.base=/usr/local/java/velocity-1.4 velocity.base=/usr/local/java/velocity-1.4
# velocity.lib=${velocity.base} # velocity.lib=${velocity.base}
# velocity.jarfile=velocity-1.4.jar # velocity.jarfile=velocity-1.4.jar
# [Tomcat 5 deploy properties]
# tomcat5.base=../tomcat5
# tomcat5.confdir=${tomcat5.base}/conf/Catalina/localhost
# tomcat5.deployAs=${ant.project.name}

View File

@ -16,7 +16,7 @@
Contributor(s): Contributor(s):
--> -->
<project name="Venice" default="deploy"> <project name="venice" default="deploy">
<!-- ============================================================================ <!-- ============================================================================
Load build properties Load build properties
@ -37,6 +37,7 @@
<!-- [Target directories] --> <!-- [Target directories] -->
<property name="deploy.home" value="../venice"/> <property name="deploy.home" value="../venice"/>
<property name="javadoc.home" value="${deploy.home}/javadoc"/> <property name="javadoc.home" value="${deploy.home}/javadoc"/>
<property name="logging.dir" value="${user.home}"/>
<!-- [Location of Servlet API 2.4] --> <!-- [Location of Servlet API 2.4] -->
<property name="servlet.base" value="../servletapi"/> <property name="servlet.base" value="../servletapi"/>
@ -94,6 +95,11 @@
<property name="velocity.lib" value="${velocity.base}"/> <property name="velocity.lib" value="${velocity.base}"/>
<property name="velocity.jarfile" value="velocity-1.4.jar"/> <property name="velocity.jarfile" value="velocity-1.4.jar"/>
<!-- [Tomcat 5 deploy properties] -->
<property name="tomcat5.base" value="../tomcat5"/>
<property name="tomcat5.confdir" value="${tomcat5.base}/conf/Catalina/localhost"/>
<property name="tomcat5.deployAs" value="${ant.project.name}"/>
<!-- ============================================================================ <!-- ============================================================================
Path references Path references
============================================================================ --> ============================================================================ -->
@ -110,6 +116,13 @@
<fileset dir="${velocity.lib}" includes="${velocity.jarfile}"/> <fileset dir="${velocity.lib}" includes="${velocity.jarfile}"/>
</path> </path>
<!-- ============================================================================
Initialization task information
============================================================================ -->
<property name="deploy.home.full" location="${deploy.home}"/>
<available file="${tomcat5.confdir}" type="dir" property="do.deploy-tomcat5"/>
<!-- ============================================================================ <!-- ============================================================================
"buildprep" - Creates the build directories "buildprep" - Creates the build directories
============================================================================ --> ============================================================================ -->
@ -178,11 +191,11 @@
</target> </target>
<!-- ============================================================================ <!-- ============================================================================
"deploy" - Copy everything to the deployment directory, including stuff that "deploy-files" - Copy everything to the deployment directory, including stuff
requires a restart to take effect. that requires a restart to take effect.
============================================================================ --> ============================================================================ -->
<target name="deploy" depends="jar,fastupdate"> <target name="deploy-files" depends="jar,fastupdate">
<copy todir="${deploy.home}/WEB-INF"> <copy todir="${deploy.home}/WEB-INF">
<fileset dir="etc"> <fileset dir="etc">
<include name="*.xml"/> <include name="*.xml"/>
@ -190,8 +203,13 @@
<include name="*.dict"/> <include name="*.dict"/>
</fileset> </fileset>
</copy> </copy>
<mkdir dir="${deploy.home}/WEB-INF/classes"/> <copy file="etc/logging-config.xml.in" tofile="${deploy.home}/WEB-INF/logging-config.xml">
<mkdir dir="${deploy.home}/WEB-INF/lib"/> <filterset>
<filter token="LOGDIR" value="${logging.dir}"/>
</filterset>
</copy>
<mkdir dir="${deploy.home}/WEB-INF/classes"/>
<mkdir dir="${deploy.home}/WEB-INF/lib"/>
<copy todir="${deploy.home}/WEB-INF/lib"> <copy todir="${deploy.home}/WEB-INF/lib">
<fileset dir="${collections.lib}" includes="${collections.jarfile}"/> <fileset dir="${collections.lib}" includes="${collections.jarfile}"/>
<fileset dir="${codec.lib}" includes="${codec.jarfile}"/> <fileset dir="${codec.lib}" includes="${codec.jarfile}"/>
@ -205,15 +223,33 @@
<fileset dir="lib" includes="*.jar"/> <fileset dir="lib" includes="*.jar"/>
<fileset dir="jars" includes="venice001.jar"/> <fileset dir="jars" includes="venice001.jar"/>
</copy> </copy>
<mkdir dir="${deploy.home}/WEB-INF/tlds"/> <mkdir dir="${deploy.home}/WEB-INF/tlds"/>
<copy todir="${deploy.home}/WEB-INF/tlds"> <copy todir="${deploy.home}/WEB-INF/tlds">
<fileset dir="tlds"> <fileset dir="tlds">
<include name="*.tld"/> <include name="*.tld"/>
</fileset> </fileset>
</copy> </copy>
<mkdir dir="${deploy.home}/WEB-INF/temp"/> <mkdir dir="${deploy.home}/WEB-INF/temp"/>
</target> </target>
<!-- ============================================================================
"deploy-tomcat5" - Copies the deployment config file to Tomcat 5.
============================================================================ -->
<target name="deploy-tomcat5" if="do.deploy-tomcat5">
<copy file="setup/venice-tomcat5.xml.in" tofile="${tomcat5.confdir}/${tomcat5.deployAs}.xml">
<filterset>
<filter token="DOCBASE" value="${deploy.home.full}"/>
</filterset>
</copy>
</target>
<!-- ============================================================================
"deploy" - Pseudo-target that deploys everything.
============================================================================ -->
<target name="deploy" depends="deploy-files,deploy-tomcat5"/>
<!-- ============================================================================ <!-- ============================================================================
"javadoc" - Create Javadocs "javadoc" - Create Javadocs
============================================================================ --> ============================================================================ -->
@ -228,6 +264,7 @@
============================================================================ --> ============================================================================ -->
<target name="clean"> <target name="clean">
<delete file="${tomcat5.confdir}/${tomcat5.deployAs}.xml" quiet="true"/>
<delete dir="${deploy.home}"/> <delete dir="${deploy.home}"/>
<delete dir="buildwork"/> <delete dir="buildwork"/>
<delete dir="jars"/> <delete dir="jars"/>

View File

@ -13,7 +13,7 @@
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@users.sf.net>, The Initial Developer of the Original Code is Eric J. Bowersox <erbo@users.sf.net>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved. Copyright (C) 2001-2006 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s): Contributor(s):
--> -->
@ -21,7 +21,7 @@
<!-- Define the standard file appender. --> <!-- Define the standard file appender. -->
<appender name="STDLOG" class="org.apache.log4j.RollingFileAppender"> <appender name="STDLOG" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/home/erbo/venice.log"/> <param name="File" value="@LOGDIR@/venice.log"/>
<param name="Append" value="true"/> <param name="Append" value="true"/>
<param name="MaxFileSize" value="10MB"/> <param name="MaxFileSize" value="10MB"/>
<param name="MaxBackupIndex" value="5"/> <param name="MaxBackupIndex" value="5"/>
@ -32,7 +32,7 @@
<!-- Define the memory logging appender. --> <!-- Define the memory logging appender. -->
<appender name="MEM" class="org.apache.log4j.FileAppender"> <appender name="MEM" class="org.apache.log4j.FileAppender">
<param name="File" value="/home/erbo/venice.memory.log"/> <param name="File" value="@LOGDIR@/venice.memory.log"/>
<layout class="org.apache.log4j.PatternLayout"> <layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%x] - %m%n"/> <param name="ConversionPattern" value="%d [%x] - %m%n"/>
</layout> </layout>

View File

@ -1,4 +0,0 @@
<Context path="/venice"
docBase="/home/erbo/venice"
crossContext="false" debug="0" reloadable="true" trusted="false">
</Context>

View File

@ -1,4 +0,0 @@
grant codebase "file:/home/erbo/venice" {
permission java.security.AllPermission;
};

View File

@ -0,0 +1,22 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
The Original Code is the Venice Web Communities System.
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@users.sf.net>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001-2006 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
-->
<!-- Deploy file for Venice on Tomcat 5.x - to be copied to the server config directory -->
<Context docBase="@DOCBASE@"
reloadable="true">
</Context>