blob: 7d1e6ffcf3026c2effc36ab663441e154e463cfe [file] [log] [blame]
<?xml version="1.0"?>
<!--
Copyright 1999-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id: init-build.xml,v 1.30 2004/05/12 21:51:29 michi Exp $ -->
<project name="init">
<description>
Initialization Targets
</description>
<!-- ============================================================ -->
<!-- Initialization target -->
<!-- ============================================================ -->
<target name="init">
<tstamp>
<format property="SNAPSHOT_STAMP" pattern="yyyyMMddhhmmss"/>
</tstamp>
<property name="Name" value="Apache Lenya"/>
<property name="release" value="1th"/>
<property name="year" value="1999-2004"/>
<echo message="------------------- ${Name} ${version} [${year}] ----------------"/>
<echo>Building with ${ant.version} using build file ${ant.file}</echo>
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="off"/>
<property name="nowarn" value="on"/>
<property name="build.compiler" value="modern"/>
<property name="target.vm" value="1.4"/>
<property name="packages" value="*.*"/>
<property name="resource.dir" value="${src.webapp.dir}/resources/css"/>
<property name="today" value="${TODAY}"/>
<property name="snapshot.bin.dir" value="${dist.root}/incubating-${fullname}-bin-${SNAPSHOT_STAMP}"/>
<property name="snapshot.src.dir" value="${dist.root}/incubating-${fullname}-src-${SNAPSHOT_STAMP}"/>
</target>
<target name="build-custom-tasks" depends="init">
<echo>INFO: Building Custom Tasks</echo>
<mkdir dir="${build.dir}/tools/anttasks"/>
<javac srcdir="src/java"
destdir="${build.dir}/tools/anttasks"
debug="${debug}"
optimize="{optimize}"
deprecation="${deprecation}"
target="${target.vm}"
nowarn="${nowarn}"
includes="org/apache/lenya/cms/ant/**"
classpathref="classpath"
source="1.4"/>
<taskdef name="copyJavaSources" classpath="${build.dir}/tools/anttasks" classname="org.apache.lenya.cms.ant.CopyJavaSourcesTask"/>
<taskdef name="copyPubs" classpath="${build.dir}/tools/anttasks" classname="org.apache.lenya.cms.ant.CopyTask"/>
<taskdef name="xpatch" classname="XConfToolTask" classpath="${tools.tasks.dest}"/>
</target>
<!-- ============================================================ -->
<!-- Prepares the build webapp directory -->
<!-- ============================================================ -->
<target name="prepare-cocoon" depends="init">
<echo>INFO: exclude: sitemap.xmap</echo>
<echo>INFO: exclude: WEB-INF/cocoon.xconf</echo>
<echo>INFO: exclude: WEB-INF/logkit.xconf</echo>
<echo>INFO: exclude: WEB-INF/web.xml</echo>
<echo>INFO: exclude: WEB-INF/lib/lucene**.jar (NOTE: Have you checked the lucene block within "local.block.properties")</echo>
<echo>INFO: exclude: **/javac.jar</echo>
<copy todir="${build.webapp}" filtering="off">
<fileset dir="${cocoon.webapp.dir}">
<exclude name="sitemap.xmap"/>
<exclude name="WEB-INF/cocoon.xconf"/>
<exclude name="WEB-INF/logkit.xconf"/>
<exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/lib/lucene**.jar"/>
<!-- Lenya ships a xalan.jar due to xslt issues with parameter passing in special xalan versions -->
<exclude name="WEB-INF/lib/xalan**.jar"/>
<exclude name="**/javac.jar"/>
</fileset>
</copy>
<!-- copy forrest and default libraries -->
<!-- FIXME: shouldn't be publication specific -->
<echo>Copy forrest libraries</echo>
<copy todir="${build.webapp}/WEB-INF/lib" filtering="off">
<fileset dir="src/webapp/lenya/pubs/docs-new/WEB-INF/lib"/>
</copy>
<!-- patch cocoon.xconf -->
<echo>INFO: patching cocoon.xconf with XSLT stylesheet</echo>
<xslt
in="${cocoon.webapp.dir}/WEB-INF/cocoon.xconf"
out="${build.webapp}/WEB-INF/cocoon.xconf"
style="${src.webapp.dir}/WEB-INF/cocoon-xconf.xsl"
>
<param name="forrest-publication" expression="/lenya/pubs/docs-new"/>
<param name="hsqldb-server-port" expression="${hsqldb-server.port}"/>
<param name="xopus-context" expression="${xopus.context}"/>
<outputproperty name="indent" value="yes"/>
</xslt>
<!-- patch logkit.xconf -->
<echo>INFO: patching logkit.xconf with XSLT stylesheet</echo>
<xslt
in="${cocoon.webapp.dir}/WEB-INF/logkit.xconf"
out="${build.webapp}/WEB-INF/logkit.xconf"
style="${src.webapp.dir}/WEB-INF/logkit-xconf.xsl"
>
<outputproperty name="indent" value="yes"/>
</xslt>
<!-- patch web.xml -->
<echo>INFO: patching web.xml with XSLT stylesheet</echo>
<xslt
in="${cocoon.webapp.dir}/WEB-INF/web.xml"
out="${build.webapp}/WEB-INF/web.xml"
style="${src.webapp.dir}/WEB-INF/web-xml.xsl"
force="false"
>
<param name="enableUploads" expression="${enable.uploads}"/>
<xmlcatalog>
<dtd
publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
location="${src.webapp.dir}/WEB-INF/entities/web-app_2_2.dtd"/>
</xmlcatalog>
<outputproperty name="indent" value="yes"/>
</xslt>
<!-- patch lucene -->
<echo message="INFO: Patch Lucene"/>
<copy todir="${build.webapp}" filtering="off">
<fileset dir="${src.webapp.dir}">
<include name="WEB-INF/lib/lucene**.jar"/>
</fileset>
</copy>
<!-- Copy Entities
<echo>INFO: Copy publication-specific entities to Cocoon catalog</echo>
<copyJavaSources pubsrootdirs="${pubs.root.dirs}" javadir="${src.entities.dir}" builddir="${build.webapp}/${build.entities.dir}" />
-->
</target>
<!-- ============================================================ -->
<!-- copy the bulk of the cocoon webapp to our destination -->
<!-- ============================================================ -->
<target name="prepare" depends="prepare-cocoon">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.webapp}"/>
</target>
<!-- ============================================================ -->
<!-- Prepares the source code -->
<!-- ============================================================ -->
<target name="prepare-src" depends="prepare, build-custom-tasks">
<echo>INFO: Create log4j.properties (${build.src}/log4j.properties)</echo>
<!-- using stylesheet as input file so we don't need a dummy xml -->
<xslt
in="${java.dir}/log4j-properties.xsl"
out="${build.src}/log4j.properties"
style="${java.dir}/log4j-properties.xsl"
force="false"
>
<param name="log4j-rollingFileAppender" expression="${enable.log4j}"/>
<param name="webapp-directory" expression="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<outputproperty name="indent" value="yes"/>
</xslt>
<echo>INFO: Copy java source files from ${java.dir} to ${build.src}</echo>
<copy todir="${build.src}" filtering="on">
<fileset dir="${java.dir}">
<exclude name="log4j-properties.xsl"/>
</fileset>
</copy>
<echo>INFO: Copy java source files from ${pubs.root.dirs} to ${build.src}</echo>
<copyJavaSources pubsrootdirs="${pubs.root.dirs}" javadir="java/src" builddir="${build.src}" />
</target>
</project>