| <?xml version="1.0"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You 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. |
| --> |
| <project default="build-cocoon" basedir="." name="import-cocoon"> |
| <!-- =============================================================== |
| Import latest version of cocoon |
| =============================================================== --> |
| <target name="init"> |
| <!-- =============================================================== |
| Set properties |
| =============================================================== --> |
| <property file="revision.properties" /> |
| <property environment="env"/> |
| <property name="cocoon.home" location="${env.COCOON_HOME}"/> |
| <property name="cocoon.version" value="2.1.13-dev"/> |
| <property name="forrest.home" location="${env.FORREST_HOME}"/> |
| </target> |
| |
| <target name="import-cocoon-xconf" depends="init"> |
| <!-- =============================================================== |
| import cocoon-xconf tries to import just the mimimun that is needed |
| by forrest |
| FIXME: This needs more testing do not use it yet |
| =============================================================== --> |
| <xslt force="true" style="./upgrade-cocoon-xconf.xsl" |
| in="${cocoon.home}/src/webapp/WEB-INF/xconf/cocoon-core.xconf" |
| out="${forrest.home}/main/webapp/WEB-INF/xconf/forrest-core.xconf" > |
| <outputproperty name="indent" value="yes"/> |
| </xslt> |
| </target> |
| |
| <target name="copy-core-libs" depends="init"> |
| <!-- =============================================================== |
| Copy all the libraries that belong to cocoon core. |
| FIXME: use sync task so you can ensure that removed libs from cocoon |
| are removed within forrest |
| =============================================================== --> |
| <copy todir="${forrest.home}/lib/core" preservelastmodified="true"> |
| <fileset dir="${cocoon.home}/lib/core" defaultexcludes="yes"> |
| <!-- Exclude some that we don't need --> |
| <exclude name="commons-beanutils-core-*.jar"/> |
| <exclude name="excalibur-instrument-mgr-*.jar"/> |
| <exclude name="javac*.jar"/> |
| <exclude name="jdtcore-*.jar"/> |
| <exclude name="js-*.jar"/> |
| <!-- FIXME: The jxpath upgrade cannot be done. |
| See issue FOR-675 (and FOR-405 and FOR-303) and dev mail list. |
| commons-jxpath-1.2 causes errors with "site:" links. |
| We have a workaround so use Cocoon's jar. |
| <exclude name="commons-jxpath-*.jar"/> |
| --> |
| <!-- We have some jars that are newer than Cocoon --> |
| <exclude name="commons-cli-*.jar"/> |
| <exclude name="commons-collections-*.jar"/> |
| <exclude name="commons-io-*.jar"/> |
| <exclude name="commons-jxpath-*.jar"/> |
| <exclude name="commons-lang-*.jar"/> |
| <exclude name="commons-logging-*.jar"/> |
| <exclude name="ehcache-*.jar"/> |
| <exclude name="log4j-*.jar"/> |
| <exclude name="slf4j-api-*.jar"/> |
| <!-- servlet.jar goes under tools/jetty --> |
| <exclude name="servlet-*.jar"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="copy-optional-libs" depends="init"> |
| <!-- =============================================================== |
| Some optional libraries are core to forrest |
| FIXME: jing-*.jar comes from iso-relax.sf.net so maybe we need to |
| have a copy-external-libs target |
| =============================================================== --> |
| <copy todir="${forrest.home}/lib/core" preservelastmodified="true"> |
| <fileset dir="${cocoon.home}/lib/optional"> |
| <include name="batik-all-*.jar"/> |
| <include name="xmlgraphics-commons-*.jar"/> |
| <include name="lucene-*.jar"/> |
| <include name="jtidy-*.jar"/> |
| <!-- FIXME: Chaperon required by core #FOR-501 --> |
| <include name="chaperon-*.jar"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="copy-plugins-libs" depends="init"> |
| <!-- =============================================================== |
| Some optional libraries are copied to plugins within forrest |
| =============================================================== --> |
| <copy todir="${forrest.home}/plugins/org.apache.forrest.plugin.input.dtdx/lib" preservelastmodified="true"> |
| <fileset dir="${cocoon.home}/lib/optional" includes="nekodtd-*.jar"/> |
| </copy> |
| <copy todir="${forrest.home}/plugins/org.apache.forrest.plugin.output.pdf/lib" preservelastmodified="true"> |
| <fileset dir="${cocoon.home}/lib/optional" includes="fop-*.jar"/> |
| </copy> |
| </target> |
| |
| <target name="copy-endorsed-libs" depends="init"> |
| <!-- =============================================================== |
| Endorsed libraries need to go to the endorsed directory |
| =============================================================== --> |
| <copy todir="${forrest.home}/lib/endorsed" preservelastmodified="true"> |
| <fileset dir="${cocoon.home}/lib/endorsed" includes="*.jar"/> |
| </copy> |
| </target> |
| |
| <target name="build-cocoon" depends="init"> |
| <!-- =============================================================== |
| Copy local settings and build cocoon |
| =============================================================== --> |
| <copy todir="${cocoon.home}"> |
| <fileset dir="." includes="local.*.properties"/> |
| </copy> |
| <condition property="build.script" value="build.bat"> |
| <os family="windows"/> |
| </condition> |
| <condition property="build.script" value="build.sh"> |
| <not> |
| <os family="windows"/> |
| </not> |
| </condition> |
| |
| <exec dir="${cocoon.home}" executable="${cocoon.home}/${build.script}"/> |
| </target> |
| |
| <target name="copy-cocoon" depends="init"> |
| <!-- =============================================================== |
| Copy a fresh build from cocoon |
| =============================================================== --> |
| <delete> |
| <fileset dir="${forrest.home}/lib/core" includes="cocoon-*.jar"> |
| <!-- NOTE: If you have been experimenting with temporary blocks, then |
| exclude them from deletion. |
| <exclude name="cocoon-foo-block-r123456.jar"/> |
| --> |
| </fileset> |
| </delete> |
| <copy todir="${forrest.home}/lib/core"> |
| <mapper type="glob" from="*.jar" to="*-${cocoon.version}.jar"/> |
| <fileset dir="${cocoon.home}/build/cocoon-${cocoon.version}"> |
| <include name="cocoon.jar"/> |
| </fileset> |
| </copy> |
| <copy todir="${forrest.home}/lib/core"> |
| <mapper type="glob" from="*.jar" to="cocoon-*.jar"/> |
| <fileset dir="${cocoon.home}/build/cocoon-${cocoon.version}/blocks"> |
| <include name="*-block.jar"/> |
| <!-- servlet.jar has been added within jetty--> |
| <exclude name="servlet-*.jar"/> |
| </fileset> |
| </copy> |
| </target> |
| </project> |