blob: 42a49ed2b1b8fa75af3b8d58c1cd20bed64377b8 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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="XML Build" default="build" basedir=".">
<description>Build for XML component</description>
<property name="hy.module" value="xml" />
<property name="hy.hdk" location="${basedir}/../../deploy" />
<property name="depends.dir" location="${basedir}/../../depends" />
<import file="${hy.hdk}/build/ant/properties.xml" />
<import file="${hy.hdk}/build/ant/depends.xml" />
<target name="build" depends="check-depends"/>
<target name="clean" depends="-clean-java" />
<target name="check-depends" depends="-check,-extract,-copy-jars" />
<target name="-extract"
depends="-extract-props,-extract-xerces,-fix-xalan-manifest"/>
<target name="-check">
<check-one-file src="${xalan.url}" dest="${xalan.orig.jar}" />
<check-one-file src="${xerces.url}" dest="${xerces.zip}" />
</target>
<target name="-extract-props">
<uptodate property="xerces.uptodate"
srcfile="${xerces.zip}"
targetfile="${xerces.dir}/xercesImpl.jar" />
<uptodate property="xalan.uptodate"
srcfile="${xalan.orig.jar}"
targetfile="${xalan.jar}" />
</target>
<target name="-extract-xerces" unless="xerces.uptodate">
<unzip src="${xerces.zip}" dest="${xerces.dir}.tmp" />
<copy todir="${xerces.dir}" flatten="yes">
<fileset dir="${xerces.dir}.tmp/xerces-2_10_0">
<include name="resolver.jar" />
<include name="xercesImpl.jar" />
<include name="xml-apis.jar" />
</fileset>
</copy>
<delete dir="${xerces.dir}.tmp" />
<touch file="${xerces.dir}/xercesImpl.jar" />
</target>
<target name="-fix-xalan-manifest" unless="xalan.uptodate">
<unjar src="${xalan.orig.jar}" dest="${xalan.dir}.tmp" />
<delete file="${xalan.jar}" />
<replace file="${xalan.dir}.tmp/META-INF/MANIFEST.MF"
token="Class-Path: xercesImpl.jar xml-apis.jar serializer.jar"
value="" />
<jar destfile="${xalan.jar}" basedir="${xalan.dir}.tmp"
manifest="${xalan.dir}.tmp/META-INF/MANIFEST.MF" />
<delete dir="${xalan.dir}.tmp" />
</target>
<target name="fetch-depends">
<mkdir dir="${xalan.dir}" />
<download-one-file src="${xalan.url}" dest="${xalan.orig.jar}"
md5="${xalan.md5}" />
<mkdir dir="${xerces.dir}" />
<download-one-file src="${xerces.url}" dest="${xerces.zip}"
md5="${xerces.md5}" />
</target>
<target name="-copy-jars" unless="skip.java.build">
<copy todir="${hy.jdk}/jre/lib/boot">
<fileset dir="${depends.jars}">
<patternset includes="${xalan.base}/xalan.jar" />
<patternset includes="${xerces.base}/*.jar" />
</fileset>
<fileset dir="depends/manifests"/>
</copy>
</target>
<target name="test" />
<target name="-clean-java" unless="skip.java.build">
<delete dir="${hy.jdk}/jre/lib/boot/${xalan.base}" />
<delete dir="${hy.jdk}/jre/lib/boot/${xerces.base}" />
</target>
</project>