| <?xml version="1.0"?> |
| <!-- |
| Copyright 1999-2005 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$ --> |
| <project name="webapp"> |
| |
| <description> |
| Webapp targets |
| </description> |
| |
| <target name="prepare-webapp" depends="blocks, package"> |
| <mkdir dir="${build.webapp}"/> |
| |
| <copy file="${webapp}/welcome.xml" tofile="${build.webapp}/welcome.xml" filtering="on"/> |
| <copy file="${webapp}/not-found.xml" tofile="${build.webapp}/not-found.xml" filtering="on"/> |
| <copy file="${webapp}/welcome.xslt" tofile="${build.webapp}/welcome.xslt" filtering="on"/> |
| <copy file="${webapp}/sitemap.xmap" tofile="${build.webapp}/sitemap.xmap"/> |
| <copy file="${webapp}/wiring.xml" tofile="${build.webapp}/wiring.xml" filtering="on"/> |
| |
| <!-- generate sitemap entries |
| <sitemap-components sitemap="${build.webapp}/sitemap.xmap" source="${java}"/> |
| --> |
| |
| <copy todir="${build.webapp}/stylesheets" filtering="on"> |
| <fileset dir="${webapp}/stylesheets"> |
| <include name="**/*.xslt"/> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.webapp}/resources" filtering="off"> |
| <fileset dir="${webapp}/resources"/> |
| </copy> |
| |
| <copy todir="${build.webapp}/WEB-INF" filtering="on"> |
| <fileset dir="${webapp}/WEB-INF"/> |
| </copy> |
| |
| <copy file="${build}/${name}.jar" |
| tofile="${build.webapp.lib}/${name}-${version}.jar"/> |
| |
| <copy todir="${build.webapp.lib}"> |
| <fileset dir="${lib}/endorsed"> |
| <include name="*.jar"/> |
| </fileset> |
| <fileset dir="${lib.core}"> |
| <include name="*.jar"/> |
| <exclude name="servlet*.jar"/> |
| </fileset> |
| <!-- Currently, we have no JVM dependent libraries |
| <fileset dir="${lib.core}/jvm${target.vm}"> |
| <include name="*.jar"/> |
| </fileset> |
| --> |
| <fileset dir="${lib.local}"> |
| <include name="*.jar"/> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.webapp.lib}"> |
| <fileset dir="${build.blocks}"> |
| <include name="*-block.jar"/> |
| </fileset> |
| <mapper type="glob" from="*-block.jar" to="cocoon-*-block.jar"/> |
| </copy> |
| |
| <if> |
| <istrue value="${include.sources-jars}"/> |
| <then> |
| <copy file="${build}/${name}.src.jar" |
| tofile="${build.webapp.lib}/${name}-${version}.src.jar"/> |
| <copy todir="${build.webapp.lib}"> |
| <fileset dir="${build.blocks}"> |
| <include name="*-block.src.jar"/> |
| </fileset> |
| <mapper type="glob" from="*-block.src.jar" to="cocoon-*-block.src.jar"/> |
| </copy> |
| </then> |
| </if> |
| |
| <ant antfile="${build.temp}/blocks-build.xml" |
| inheritAll="true" |
| inheritRefs="false" |
| target="lib"/> |
| |
| <ant antfile="${build.temp}/blocks-build.xml" |
| inheritAll="true" |
| inheritRefs="false" |
| target="patch"/> |
| </target> |
| |
| <target name="prepare-webapp-samples" depends="prepare-webapp, samples, block-samples" unless="internal.exclude.webapp.samples"/> |
| |
| <target name="prepare-webapp-test-suite" depends="prepare-webapp" unless="internal.exclude.webapp.test-suite"> |
| <!-- copy test suite files --> |
| <copy todir="${build.webapp.test-suite}"> |
| <fileset dir="${webapp.test-suite}"/> |
| </copy> |
| </target> |
| |
| <target name="prepare-webapp-deprecated" depends="prepare-webapp" unless="internal.exclude.deprecated"> |
| <copy file="${build}/${name}-deprecated.jar" tofile="${build.webapp.lib}/${name}-${version}-deprecated.jar"/> |
| <!-- |
| <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf" |
| srcdir="${deprecated.conf}" |
| includes="**/*.xconf" |
| addComments="true"/> |
| --> |
| </target> |
| |
| <target name="webapp" depends="prepare-webapp,prepare-webapp-samples,prepare-webapp-test-suite,prepare-webapp-deprecated,validate-jars,validate-config,custom-conf" description="Builds web application folder"> |
| </target> |
| |
| <target name="war" depends="webapp" description="Builds web application archive"> |
| <!-- A task to create manifest for webapp. --> |
| <taskdef name="manifest" classname="ManifestToolTask" classpath="${tools.tasks.dest}"/> |
| <!-- Create WAR manifest --> |
| <manifest directory="${build.webapp.lib}" manifest="${build.webapp}/WEB-INF/Manifest.mf"/> |
| <!-- Package WAR file --> |
| <jar jarfile="${build.war}" manifest="${build.webapp}/WEB-INF/Manifest.mf" index="true"> |
| <fileset dir="${build.webapp}"/> |
| </jar> |
| </target> |
| |
| <target name="custom-conf" description="Uses Cocoon's xpatch task to customize runtime configuration"> |
| <xpatch file="${build.webapp}/sitemap.xmap" srcdir=""> |
| <include name="${customconf}/*.xmap" /> |
| <include name="${customconf}/*.xpipe" /> |
| </xpatch> |
| <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf" srcdir="" addComments="true"> |
| <include name="${customconf}/*.xconf" /> |
| </xpatch> |
| <xpatch file="${build.webapp}/WEB-INF/logkit.xconf" srcdir=""> |
| <include name="${customconf}/*.xlog" /> |
| </xpatch> |
| <xpatch file="${build.webapp}/WEB-INF/web.xml" srcdir=""> |
| <include name="${customconf}/*.xweb" /> |
| </xpatch> |
| </target> |
| </project> |