venice-main-classic/build.xml

280 lines
12 KiB
XML

<?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):
-->
<project name="venice" default="deploy">
<!-- ============================================================================
Load build properties
============================================================================ -->
<property file="build.properties"/>
<!-- ============================================================================
Default build properties
============================================================================ -->
<!-- [Compilation control flags] -->
<property name="compile.debug" value="on"/>
<property name="compile.deprecation" value="on"/>
<property name="compile.optimize" value="off"/>
<property name="build.compiler" value="modern"/>
<!-- [Target directories] -->
<property name="deploy.home" value="../venice"/>
<property name="javadoc.home" value="${deploy.home}/javadoc"/>
<property name="logging.dir" value="${user.home}"/>
<!-- [Location of Servlet API 2.4] -->
<property name="servlet.base" value="../servletapi"/>
<property name="servlet.lib" value="${servlet.base}/lib"/>
<property name="servlet.jarfile" value="servlet-api.jar"/>
<!-- [Location of JSP API 2.0] -->
<property name="jsp.base" value="../jspapi"/>
<property name="jsp.lib" value="${jsp.base}/lib"/>
<property name="jsp.jarfile" value="jsp-api.jar"/>
<!-- [Location of Commons Collections Library 3.1] -->
<property name="collections.base" value="../commons-collections"/>
<property name="collections.lib" value="${collections.base}"/>
<property name="collections.jarfile" value="commons-collections-3.1.jar"/>
<!-- [Location of Commons Codec Library 1.3] -->
<property name="codec.base" value="../commons-codec"/>
<property name="codec.lib" value="${codec.base}"/>
<property name="codec.jarfile" value="commons-codec-1.3.jar"/>
<!-- [Location of Commons HTTP Client Library 3.0] -->
<property name="httpclient.base" value="../commons-httpclient"/>
<property name="httpclient.lib" value="${httpclient.base}"/>
<property name="httpclient.jarfile" value="commons-httpclient-3.0.jar"/>
<!-- [Location of Jakarta Regexp Library 1.4] -->
<property name="regexp.base" value="../jakarta-regexp"/>
<property name="regexp.lib" value="${regexp.base}"/>
<property name="regexp.jarfile" value="jakarta-regexp-1.4.jar"/>
<!-- [Location of Log4J 1.2.13] -->
<property name="log4j.base" value="../log4j"/>
<property name="log4j.lib" value="${log4j.base}/dist/lib"/>
<property name="log4j.jarfile" value="log4j-1.2.13.jar"/>
<!-- [Location of Bean Scripting Framework 2.3] -->
<property name="bsf.base" value="../bsf"/>
<property name="bsf.lib" value="${bsf.base}/lib"/>
<property name="bsf.jarfile" value="bsf.jar"/>
<!-- [Location of Jacl 1.3.2] -->
<property name="jacl.base" value="../jacl"/>
<property name="jacl.lib" value="${jacl.base}"/>
<property name="jacl.jarfile" value="jacl.jar"/>
<property name="jacl.tcljarfile" value="tcljava.jar"/>
<!-- [Location of Rhino 1.5R4.1] -->
<property name="rhino.base" value="../rhino"/>
<property name="rhino.lib" value="${rhino.base}"/>
<property name="rhino.jarfile" value="js.jar"/>
<!-- [Location of Velocity 1.4] -->
<property name="velocity.base" value="../velocity"/>
<property name="velocity.lib" value="${velocity.base}"/>
<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 id="base.build.path">
<fileset dir="${servlet.lib}" includes="${servlet.jarfile}"/>
<fileset dir="${jsp.lib}" includes="${jsp.jarfile}"/>
<fileset dir="${collections.lib}" includes="${collections.jarfile}"/>
<fileset dir="${codec.lib}" includes="${codec.jarfile}"/>
<fileset dir="${httpclient.lib}" includes="${httpclient.jarfile}"/>
<fileset dir="${regexp.lib}" includes="${regexp.jarfile}"/>
<fileset dir="${log4j.lib}" includes="${log4j.jarfile}"/>
<fileset dir="${bsf.lib}" includes="${bsf.jarfile}"/>
<fileset dir="${velocity.lib}" includes="${velocity.jarfile}"/>
</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
============================================================================ -->
<target name="buildprep">
<mkdir dir="buildwork"/>
<mkdir dir="jars"/>
</target>
<!-- ============================================================================
"compile" - Compile all the Java source
============================================================================ -->
<target name="compile" depends="buildprep">
<javac srcdir="src" destdir="buildwork" debug="${compile.debug}" optimize="${compile.optimize}"
deprecation="${compile.deprecation}" source="1.5" target="1.5">
<classpath>
<pathelement location="buildwork"/>
<path refid="base.build.path"/>
</classpath>
</javac>
<copy todir="buildwork">
<fileset dir="src" includes="**/*.properties"/>
<fileset dir="src" includes="**/*.ini"/>
</copy>
</target>
<!-- ============================================================================
"jar" - Create the JAR file of all the Java compiled code
============================================================================ -->
<target name="jar" depends="compile">
<jar destfile="jars/venice001.jar" basedir="buildwork"/>
</target>
<!-- ============================================================================
"mkbasedirs" - Creates the base directories for "fastupdate"
============================================================================ -->
<target name="mkbasedirs">
<mkdir dir="${deploy.home}"/>
<mkdir dir="${deploy.home}/WEB-INF"/>
<mkdir dir="${deploy.home}/WEB-INF/scripts"/>
<mkdir dir="${deploy.home}/WEB-INF/rpcscripts"/>
<mkdir dir="${deploy.home}/WEB-INF/templates"/>
</target>
<!-- ============================================================================
"fastupdate" - Copies everything to the deployment directory that can be
copied without a restart.
============================================================================ -->
<target name="fastupdate" depends="mkbasedirs">
<copy todir="${deploy.home}"> <!-- this copies all the JSP files and stuff -->
<fileset dir="web"/>
</copy>
<copy todir="${deploy.home}/WEB-INF/scripts"> <!-- this copies all the scripts -->
<fileset dir="scripts"/>
</copy>
<copy todir="${deploy.home}/WEB-INF/rpcscripts"> <!-- this copies all the RPC scripts -->
<fileset dir="rpcscripts"/>
</copy>
<copy todir="${deploy.home}/WEB-INF/templates"> <!-- this copies all the RPC scripts -->
<fileset dir="templates"/>
</copy>
</target>
<!-- ============================================================================
"deploy-files" - Copy everything to the deployment directory, including stuff
that requires a restart to take effect.
============================================================================ -->
<target name="deploy-files" depends="jar,fastupdate">
<copy todir="${deploy.home}/WEB-INF">
<fileset dir="etc">
<include name="*.xml"/>
<include name="*.css"/>
<include name="*.dict"/>
</fileset>
</copy>
<copy file="etc/logging-config.xml.in" tofile="${deploy.home}/WEB-INF/logging-config.xml">
<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">
<fileset dir="${collections.lib}" includes="${collections.jarfile}"/>
<fileset dir="${codec.lib}" includes="${codec.jarfile}"/>
<fileset dir="${httpclient.lib}" includes="${httpclient.jarfile}"/>
<fileset dir="${regexp.lib}" includes="${regexp.jarfile}"/>
<fileset dir="${log4j.lib}" includes="${log4j.jarfile}"/>
<fileset dir="${bsf.lib}" includes="${bsf.jarfile}"/>
<fileset dir="${velocity.lib}" includes="${velocity.jarfile}"/>
<!-- <fileset dir="${jacl.lib}" includes="${jacl.jarfile}, ${jacl.tcljarfile}"/> -->
<fileset dir="${rhino.lib}" includes="${rhino.jarfile}"/>
<fileset dir="lib" includes="*.jar"/>
<fileset dir="jars" includes="venice001.jar"/>
</copy>
<mkdir dir="${deploy.home}/WEB-INF/tlds"/>
<copy todir="${deploy.home}/WEB-INF/tlds">
<fileset dir="tlds">
<include name="*.tld"/>
</fileset>
</copy>
<mkdir dir="${deploy.home}/WEB-INF/temp"/>
</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
============================================================================ -->
<target name="javadoc" depends="mkbasedirs">
<mkdir dir="${javadoc.home}"/>
<javadoc sourcepath="src" packagenames="*" destdir="${javadoc.home}"/>
</target>
<!-- ============================================================================
"clean" - Cleans up all stuff that was built
============================================================================ -->
<target name="clean">
<delete file="${tomcat5.confdir}/${tomcat5.deployAs}.xml" quiet="true"/>
<delete dir="${deploy.home}"/>
<delete dir="buildwork"/>
<delete dir="jars"/>
</target>
<!-- ============================================================================
"all" - Build entire project
============================================================================ -->
<target name="all" depends="clean,deploy,javadoc"/>
</project>