| <?xml version="1.0"?> |
| <!-- |
| Copyright 2002-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. |
| --> |
| |
| <project default="site" basedir="." name="Forrest Ant proxy targets"> |
| |
| <description> |
| Proxy Forrest targets that run the customized Ant provided with Forrest, |
| rather than using the invoker's version. |
| |
| The 'validate' target in forrest.build.xml requires a patched Ant 1.6 to |
| run. Thus if forrest.build.xml is invoked from a user's script, it will |
| fail. The solution is to invoke this script's proxy targets, eg: |
| |
| <![CDATA[ |
| <target name="site" description="Build a static website"> |
| <ant antfile="${forrest.home}/forrest.antproxy.xml" target="site"/> |
| </target> |
| ]]> |
| </description> |
| |
| <property name="build.sysclasspath" value="ignore"/> |
| |
| <target name="validate" description="Validates XML doc files"> |
| <antcall target="forrest"><param name="target" value="validate"/></antcall> |
| </target> |
| <target name="webapp" description="Generates an unpacked webapp"> |
| <antcall target="forrest"><param name="target" value="webapp"/></antcall> |
| </target> |
| <target name="war" description="Generates a packaged .war webapp"> |
| <antcall target="forrest"><param name="target" value="war"/></antcall> |
| </target> |
| <target name="site" description="Generates static HTML"> |
| <antcall target="forrest"><param name="target" value="site"/></antcall> |
| </target> |
| |
| <path id="forrest-classpath"> |
| <fileset dir="${forrest.home}"> |
| <include name="tools/ant/lib/*.jar"/> |
| <include name="lib/endorsed/*.jar"/> |
| </fileset> |
| <pathelement location="${java.home}/../lib/tools.jar"/> |
| </path> |
| |
| <target name="forrest"> |
| <property name="project.home" location="."/> |
| <java classname="org.apache.tools.ant.Main" fork="true" failonerror="true"> |
| <classpath refid="forrest-classpath"/> |
| <jvmarg value="-Dforrest.home=${forrest.home}"/> |
| <jvmarg value="-Dbasedir=${basedir}"/> |
| <jvmarg value="-Dproject.home=${project.home}"/> |
| <jvmarg value="-Djava.endorsed.dirs=${forrest.home}/lib/endorsed${path.separator}${java.endorsed.dirs}"/> |
| <arg line="-f '${forrest.home}/forrest.build.xml' -emacs ${target}"/> |
| </java> |
| </target> |
| |
| |
| </project> |