blob: 31eb7e58d0b51d60bacfa4418beaea0349fab4ef [file] [log] [blame]
<!--
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 name="manifoldcf-site" default="help">
<target name="clean">
<delete dir="build"/>
<delete dir="tmp"/>
</target>
<target name="checkout-source-via-svn">
<mkdir dir="${root-dir}"/>
<exec dir="${root-dir}" executable="svn" failifexecutionfails="true" failonerror="true">
<arg value="checkout" />
<arg value="${svn-url}" />
<arg value="${dir-name}" />
</exec>
</target>
<target name="checkout-forrest">
<mkdir dir="build"/>
<antcall target="checkout-source-via-svn">
<param name="root-dir" value="build"/>
<param name="svn-url" value="http://svn.apache.org/repos/asf/forrest/tags/forrest_09_release"/>
<param name="dir-name" value="forrest"/>
</antcall>
</target>
<target name="build-forrest" depends="checkout-forrest">
<exec osfamily="windows" dir="build/forrest/main" executable="cmd" failifexecutionfails="true" failonerror="true">
<arg value="/c"/>
<arg value="build.bat"/>
</exec>
<exec osfamily="unix" dir="build/forrest/main" executable="./build.sh" failifexecutionfails="true" failonerror="true">
</exec>
</target>
<target name="build-via-ant">
<property name="forrest.path" location="build/forrest"/>
<exec osfamily="windows" dir="${root-dir}" executable="cmd" failifexecutionfails="true" failonerror="true">
<arg value="/c"/>
<arg value="ant.bat"/>
<arg value="${target}" />
<env key="FORREST_HOME" value="${forrest.path}"/>
</exec>
<exec osfamily="unix" dir="${root-dir}" executable="ant" failifexecutionfails="true" failonerror="true">
<arg value="${target}" />
<env key="FORREST_HOME" value="${forrest.path}"/>
</exec>
</target>
<target name="setup-release-base-url">
<property name="release-base-url" value="http://www.apache.org/dist/manifoldcf"/>
</target>
<target name="setup-archive-base-url">
<property name="archive-base-url" value="http://archive.apache.org/dist/manifoldcf"/>
</target>
<target name="transfer-root-files">
<mkdir dir="build/site"/>
<copy todir="build/site" file=".htaccess"/>
<copy todir="build/site" file="doap_ManifoldCF.rdf"/>
</target>
<target name="download-release" depends="setup-release-base-url">
<mkdir dir="build/releases"/>
<get src="${release-base-url}/apache-manifoldcf-${release-version}/apache-manifoldcf-${release-version}-bin.zip" dest="build/releases/apache-manifoldcf-${release-version}-bin.zip"/>
</target>
<target name="download-archive" depends="setup-archive-base-url">
<mkdir dir="build/releases"/>
<get src="${archive-base-url}/apache-manifoldcf-${release-version}/apache-manifoldcf-${release-version}-bin.zip" dest="build/releases/apache-manifoldcf-${release-version}-bin.zip"/>
</target>
<target name="download-legacy-archive" depends="setup-archive-base-url">
<mkdir dir="build/releases"/>
<get src="${archive-base-url}/apache-manifoldcf-${release-version}-bin.zip" dest="build/releases/apache-manifoldcf-${release-version}-bin.zip"/>
</target>
<target name="install-release" depends="download-release">
<mkdir dir="build/publish/release"/>
<!-- unpack -->
<unzip src="build/releases/apache-manifoldcf-${release-version}-bin.zip" dest="build/releases/apache-manifoldcf-${release-version}-bin"/>
<!-- copy -->
<mkdir dir="build/site/release"/>
<copy todir="build/site/release/release-${release-version}">
<fileset dir="build/releases/apache-manifoldcf-${release-version}-bin/apache-manifoldcf-${release-version}/doc"/>
</copy>
</target>
<target name="install-legacy-archive" depends="download-legacy-archive">
<mkdir dir="build/publish/release"/>
<!-- unpack -->
<unzip src="build/releases/apache-manifoldcf-${release-version}-bin.zip" dest="build/releases/apache-manifoldcf-${release-version}-bin"/>
<!-- copy -->
<mkdir dir="build/site/release"/>
<copy todir="build/site/release/release-${release-version}">
<fileset dir="build/releases/apache-manifoldcf-${release-version}-bin/apache-manifoldcf-${release-version}/doc"/>
</copy>
</target>
<target name="install-archive" depends="download-archive">
<mkdir dir="build/publish/release"/>
<!-- unpack -->
<unzip src="build/releases/apache-manifoldcf-${release-version}-bin.zip" dest="build/releases/apache-manifoldcf-${release-version}-bin"/>
<!-- copy -->
<mkdir dir="build/site/release"/>
<copy todir="build/site/release/release-${release-version}">
<fileset dir="build/releases/apache-manifoldcf-${release-version}-bin/apache-manifoldcf-${release-version}/doc"/>
</copy>
</target>
<target name="checkout-trunk-release">
<antcall target="checkout-source-via-svn">
<param name="root-dir" value="build/releases"/>
<param name="svn-url" value="http://svn.apache.org/repos/asf/manifoldcf/trunk"/>
<param name="dir-name" value="trunk"/>
</antcall>
</target>
<target name="build-trunk-release" depends="checkout-trunk-release">
<antcall target="build-via-ant">
<param name="root-dir" value="build/releases/trunk"/>
<param name="target" value="make-core-deps"/>
</antcall>
<antcall target="build-via-ant">
<param name="root-dir" value="build/releases/trunk"/>
<param name="target" value="make-deps"/>
</antcall>
<antcall target="build-via-ant">
<param name="root-dir" value="build/releases/trunk"/>
<param name="target" value="doc"/>
</antcall>
<antcall target="build-via-ant">
<param name="root-dir" value="build/releases/trunk"/>
<param name="target" value="javadoc"/>
</antcall>
</target>
<target name="install-trunk-release" depends="build-trunk-release">
<mkdir dir="build/site/release"/>
<copy todir="build/site/release/trunk">
<fileset dir="build/releases/trunk/dist/doc"/>
</copy>
</target>
<target name="get-releases-doc"> <!-- depends="install-trunk-release"-->
<antcall target="install-release">
<param name="release-version" value="2.9.1"/>
</antcall>
<antcall target="install-archive">
<param name="release-version" value="2.8.1"/>
</antcall>
<antcall target="install-release">
<param name="release-version" value="1.10"/>
</antcall>
</target>
<target name="setup-maven-url">
<property name="maven-base-url" value="http://repo1.maven.org/maven2"/>
</target>
<target name="download-via-maven" depends="setup-maven-url">
<get src="${maven-base-url}/${project-path}/${artifact-name}/${artifact-version}/${artifact-name}-${artifact-version}.${artifact-type}" dest="${target}/${artifact-name}.${artifact-type}"/>
</target>
<target name="downloaded-condition">
<available file="lib/commons-logging.jar" property="commons-logging-found"/>
<available file="lib/commons-io.jar" property="commons-io-found"/>
<available file="lib/fop.jar" property="fop-found"/>
<available file="lib/xmlgraphics-commons.jar" property="xmlgraphics-commons-found"/>
<condition property="downloaded">
<and>
<isset property="commons-logging-found"/>
<isset property="commons-io-found"/>
<isset property="fop-found"/>
<isset property="xmlgraphics-commons-found"/>
</and>
</condition>
</target>
<target name="downloaded-check" depends="downloaded-condition" unless="downloaded">
<echo message="Run 'make-core-deps' target first"/>
</target>
<target name="get-forrest-root" depends="build-forrest">
<!--property environment="env"/>
<echo message="${env.FORREST_HOME}"/>
<property name="forrest-root" value="${env.FORREST_HOME}"/-->
<property name="forrest-root" value="build/forrest"/>
</target>
<target name="calculate-forrest-condition" depends="get-forrest-root">
<available file="${forrest-root}" property="forrestAvailable"/>
</target>
<target name="forrest-check" depends="calculate-forrest-condition" unless="forrestAvailable">
<echo message="Site cannot be built without Apache Forrest installed"/>
</target>
<target name="calculate-dejavu-condition">
<available file="fonts/dejavu-fonts-ttf-2.37.zip" property="dejavuAvailable"/>
</target>
<target name="dejavu-check" depends="calculate-dejavu-condition" unless="dejavuAvailable">
<echo message="Dejavu fonts cannot be built without dejavu-fonts-ttf-2.37.zip"/>
</target>
<target name="calculate-ipa-condition">
<available file="fonts/IPAGTTC00303.zip" property="ipaAvailable"/>
</target>
<target name="ipa-check" depends="calculate-ipa-condition" unless="ipaAvailable">
<echo message="IPA fonts cannot be built without IPAGTTC00303.zip"/>
</target>
<target name="download-fop">
<mkdir dir="lib"/>
<antcall target="download-via-maven"><param name="target" value="lib"/>
<param name="project-path" value="org/apache/xmlgraphics"/>
<param name="artifact-version" value="1.0"/>
<param name="artifact-name" value="fop"/>
<param name="artifact-type" value="jar"/>
</antcall>
</target>
<target name="download-xmlgraphics-commons">
<mkdir dir="lib"/>
<antcall target="download-via-maven"><param name="target" value="lib"/>
<param name="project-path" value="org/apache/xmlgraphics"/>
<param name="artifact-version" value="1.4"/>
<param name="artifact-name" value="xmlgraphics-commons"/>
<param name="artifact-type" value="jar"/>
</antcall>
</target>
<target name="download-avalon-framework">
<property name="avalon.path" value="org/apache/avalon/framework"/>
<property name="avalon.version" value="4.3.1"/>
<mkdir dir="lib"/>
<antcall target="download-via-maven"><param name="target" value="lib"/><param name="project-path" value="${avalon.path}"/><param name="artifact-version" value="${avalon.version}"/>
<param name="artifact-name" value="avalon-framework-api"/>
<param name="artifact-type" value="jar"/>
</antcall>
<antcall target="download-via-maven"><param name="target" value="lib"/><param name="project-path" value="${avalon.path}"/><param name="artifact-version" value="${avalon.version}"/>
<param name="artifact-name" value="avalon-framework-impl"/>
<param name="artifact-type" value="jar"/>
</antcall>
</target>
<target name="download-commons">
<mkdir dir="lib"/>
<antcall target="download-via-maven"><param name="target" value="lib"/>
<param name="project-path" value="commons-io"/>
<param name="artifact-version" value="1.3.2"/>
<param name="artifact-name" value="commons-io"/>
<param name="artifact-type" value="jar"/>
</antcall>
<antcall target="download-via-maven"><param name="target" value="lib"/>
<param name="project-path" value="commons-logging"/>
<param name="artifact-version" value="1.1.1"/>
<param name="artifact-name" value="commons-logging"/>
<param name="artifact-type" value="jar"/>
</antcall>
</target>
<target name="setup-local-forrest" depends="forrest-check" if="forrestAvailable">
<mkdir dir="tmp/forrest"/>
<copy todir="tmp/forrest">
<fileset dir="${forrest-root}"/>
</copy>
<chmod dir="tmp/forrest/bin" perm="ugo+rx" includes="forrest"/>
<chmod dir="tmp/forrest/tools/ant/bin" perm="ugo+rx" includes="ant"/>
<!-- Replace the fop jar with a more up-to-date version -->
<delete file="tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf/lib/fop-0.95.jar"/>
<delete file="tmp/forrest/build/plugins/lib/fop-0.95.jar"/>
<copy todir="tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf/lib">
<fileset dir="lib">
<include name="fop*.jar"/>
</fileset>
</copy>
<!-- Same with the XML Graphics jar -->
<delete file="tmp/forrest/lib/core/xmlgraphics-commons-1.3.1.jar"/>
<copy todir="tmp/forrest/lib/core">
<fileset dir="lib">
<include name="xmlgraphics-commons*.jar"/>
</fileset>
</copy>
<!-- Replace the file tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf/output.xmap with our own patched version -->
<delete file="tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf/output.xmap"/>
<copy todir="tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf">
<fileset dir="pdf">
<include name="output.xmap"/>
<include name="config.xml"/>
</fileset>
</copy>
<dirname file="build.xml" property="project-path"/>
<replace file="tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf/output.xmap" token="{root}" value="${project-path}"/>
<replace file="tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf/config.xml" token="{root}" value="${project-path}"/>
<delete file="tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl"/>
<copy todir="tmp/forrest/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets">
<fileset dir="pdf">
<include name="document-to-fo.xsl"/>
</fileset>
</copy>
</target>
<target name="build-dejavu-fonts" depends="dejavu-check" if="dejavuAvailable">
<mkdir dir="tmp/font/dejavu-fonts"/>
<unzip src="fonts/dejavu-fonts-ttf-2.37.zip" dest="tmp/font/dejavu-fonts"/>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="tmp/font/dejavu-fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf"/>
<arg value="tmp/font/DejaVuSans.xml"/>
</java>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="tmp/font/dejavu-fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Oblique.ttf"/>
<arg value="tmp/font/DejaVuSans-Oblique.xml"/>
</java>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="tmp/font/dejavu-fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf"/>
<arg value="tmp/font/DejaVuSans-Bold.xml"/>
</java>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="tmp/font/dejavu-fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif.ttf"/>
<arg value="tmp/font/DejaVuSerif.xml"/>
</java>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="tmp/font/dejavu-fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Italic.ttf"/>
<arg value="tmp/font/DejaVuSerif-Italic.xml"/>
</java>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="tmp/font/dejavu-fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Bold.ttf"/>
<arg value="tmp/font/DejaVuSerif-Bold.xml"/>
</java>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="tmp/font/dejavu-fonts/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf"/>
<arg value="tmp/font/DejaVuSansMono.xml"/>
</java>
</target>
<target name="build-ipa-fonts" depends="ipa-check" if="ipaAvailable">
<mkdir dir="tmp/font/ipa-fonts"/>
<unzip src="fonts/IPAGTTC00303.zip" dest="tmp/font/ipa-fonts"/>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="-ttcname"/>
<arg value="IPAPGothic"/>
<arg value="tmp/font/ipa-fonts/IPAGTTC00303/ipag.ttc"/>
<arg value="tmp/font/ipapgothic.xml"/>
</java>
<java classname="org.apache.fop.fonts.apps.TTFReader" fork="true">
<classpath>
<fileset dir="lib">
<include name="fop*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
<include name="avalon*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
</fileset>
</classpath>
<arg value="-ttcname"/>
<arg value="IPAGothic"/>
<arg value="tmp/font/ipa-fonts/IPAGTTC00303/ipag.ttc"/>
<arg value="tmp/font/ipagothic.xml"/>
</java>
</target>
<target name="dependencies-check" depends="ipa-check,dejavu-check,forrest-check,downloaded-check">
<condition property="dependenciesAvailable">
<and>
<isset property="ipaAvailable"/>
<isset property="dejavuAvailable"/>
<isset property="forrestAvailable"/>
<isset property="downloaded"/>
</and>
</condition>
</target>
<target name="build" depends="setup-local-forrest,build-ipa-fonts,build-dejavu-fonts,get-releases-doc,transfer-root-files,dependencies-check" if="dependenciesAvailable">
<dirname file="tmp/forrest/LICENSE.txt" property="forrest-dir"/>
<echo message="${forrest-dir}"/>
<exec executable="cmd.exe" dir="." searchpath="true" failonerror="true" osfamily="windows">
<arg line="/c .\tmp\forrest\bin\forrest.bat site"/>
<env key="JAVA_TOOL_OPTIONS" value="-Dfile.encoding=UTF8"/>
<env key="FORREST_HOME" value="${forrest-dir}"/>
</exec>
<exec executable="./tmp/forrest/bin/forrest" dir="." searchpath="true" failonerror="true" osfamily="unix">
<arg line="site"/>
<env key="JAVA_TOOL_OPTIONS" value="-Dfile.encoding=UTF8"/>
<env key="FORREST_HOME" value="${forrest-dir}"/>
</exec>
</target>
<target name="download-dejavu-fonts">
<mkdir dir="fonts"/>
<get src="http://versaweb.dl.sourceforge.net/project/dejavu/dejavu/2.37/dejavu-fonts-ttf-2.37.zip" dest="fonts"/>
</target>
<target name="download-ipa-fonts">
<mkdir dir="fonts"/>
<!-- http://ossipedia.ipa.go.jp/ipafont/download.html?ruleagreement=%E5%90%8C%E6%84%8F%E3%81%99%E3%82%8B%2FAccept -->
<!-- get src="http://ossipedia.ipa.go.jp/ipafont/IPAGTTC00303.php" dest="fonts/IPAGTTC00303.zip"/ -->
<!-- get src="http://info.openlab.ipa.go.jp/ipafont/fontdata/IPAGTTC00303.zip" dest="fonts"/ -->
<!-- get src="http://ossipedia.ipa.go.jp/ipafont/ipafont/IPAGTTC00303.zip" dest="fonts"/ -->
<get src="http://jaist.dl.sourceforge.jp/ipafonts/51867/IPAGTTC00303.zip" dest="fonts"/>
</target>
<target name="make-core-deps" depends="download-dejavu-fonts,download-ipa-fonts,download-commons,download-avalon-framework,download-xmlgraphics-commons,download-fop">
</target>
<target name="clean-core-deps">
<delete dir="fonts"/>
<delete dir="lib"/>
</target>
<target name="help">
<echo level="info">
ManifoldCF site build file. Use this file to build the ManifoldCF
site docs.
Useful targets are:
clean - Clean the build and distribution areas
build - Build the site
make-core-deps - Download and build core dependencies
clean-core-deps - Clean up core dependencies
Use Apache Forrest version forrest-0.9-dev or higher.
</echo>
</target>
</project>