| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- ***** BEGIN LICENSE BLOCK ***** | |
| - Version: MPL 1.1/GPL 2.0 | |
| - | |
| - The contents of this file are subject to the Mozilla Public License Version | |
| - 1.1 (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.mozilla.org/MPL/ | |
| - | |
| - Software distributed under the License is distributed on an "AS IS" basis, | |
| - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| - for the specific language governing rights and limitations under the | |
| - License. | |
| - | |
| - The Original Code is Rhino code, released May 6, 1999. | |
| - | |
| - The Initial Developer of the Original Code is | |
| - Netscape Communications Corporation. | |
| - Portions created by the Initial Developer are Copyright (C) 1997-1999 | |
| - the Initial Developer. All Rights Reserved. | |
| - | |
| - Contributor(s): | |
| - | |
| - Alternatively, the contents of this file may be used under the terms of | |
| - the GNU General Public License Version 2 or later (the "GPL"), in which | |
| - case the provisions of the GPL are applicable instead of those above. If | |
| - you wish to allow use of your version of this file only under the terms of | |
| - the GPL and not to allow others to use your version of this file under the | |
| - MPL, indicate your decision by deleting the provisions above and replacing | |
| - them with the notice and other provisions required by the GPL. If you do | |
| - not delete the provisions above, a recipient may use your version of this | |
| - file under either the MPL or the GPL. | |
| - | |
| - ***** END LICENSE BLOCK ***** --> | |
| <project name="xmlimplsrc" basedir=".." default="compile"> | |
| <property file="build.properties"/> | |
| <path id="xmlimpl.classpath"> | |
| <pathelement location="${xbean.jar}"/> | |
| <pathelement location="${jsr173.jar}"/> | |
| </path> | |
| <target name="compile" unless="without-xmlimpl"> | |
| <available property="xbean-present?" file="${xbean.jar}" /> | |
| <antcall target="xbean-get" /> | |
| <condition property="xmlimpl-compile?"> | |
| <and> | |
| <available file="${xbean.jar}" /> | |
| <!-- | |
| Does not work under JDK 1.3 due to incompatible classes | |
| <available classname="javax.xml.namespace.QName" | |
| classpathref="xmlimpl.classpath"/> | |
| <available classname="org.apache.xmlbeans.XmlCursor" | |
| classpathref="xmlimpl.classpath"/> | |
| <available classname="org.apache.xmlbeans.XmlException" | |
| classpathref="xmlimpl.classpath"/> | |
| <available classname="org.apache.xmlbeans.XmlObject" | |
| classpathref="xmlimpl.classpath"/> | |
| <available classname="org.apache.xmlbeans.XmlOptions" | |
| classpathref="xmlimpl.classpath"/> | |
| --> | |
| </and> | |
| </condition> | |
| <antcall target="do-compile" /> | |
| <antcall target="do-not-compile" /> | |
| </target> | |
| <target name="do-compile" if="xmlimpl-compile?"> | |
| <echo>Compiling E4X implementation using ${xbean.jar}</echo> | |
| <javac srcdir="xmlimplsrc" | |
| destdir="${classes}" | |
| includes="org/**/*.java" | |
| deprecation="on" | |
| debug="${debug}" | |
| classpathref="xmlimpl.classpath" | |
| failonerror="${xmlimpl.compile.failonerror}" | |
| target="${target-jvm}" | |
| source="${source-level}" | |
| > | |
| </javac> | |
| </target> | |
| <target name="do-not-compile" unless="xmlimpl-compile?"> | |
| <echo> | |
| Skipping compilation of E4X implementation due to lack of | |
| javax.xml.namespace.*, org.apache.xmlbeans.* classes | |
| </echo> | |
| </target> | |
| <target name="copy-source"> | |
| <mkdir dir="${dist.dir}/xmlimplsrc"/> | |
| <copy todir="${dist.dir}/xmlimplsrc"> | |
| <fileset dir="xmlimplsrc" | |
| includes="**/*.java,**/*.properties,**/*.xml" | |
| /> | |
| </copy> | |
| </target> | |
| <target name="clean"> | |
| <delete includeEmptyDirs="true"> | |
| <fileset dir="${classes}" | |
| includes="org/mozilla/javascript/xmlimpl/**"/> | |
| </delete> | |
| </target> | |
| <target name="xbean-get" unless="xbean-present?"> | |
| <property | |
| name="xbean.url" | |
| value="http://www.apache.org/dist/xml/xmlbeans/xmlbeans-current.zip" | |
| /> | |
| <property name="xbean.tmp" location="${build.dir}/tmp-xbean" /> | |
| <property name="xbean.zip" location="${xbean.tmp}/xbean.zip" /> | |
| <mkdir dir="${xbean.tmp}"/> | |
| <get src="${xbean.url}" dest="${xbean.zip}" ignoreerrors="true" /> | |
| <available property="xbean-zip-present?" file="${xbean.zip}" /> | |
| <antcall target="xbean-unzip" /> | |
| </target> | |
| <target name="xbean-unzip" if="xbean-zip-present?"> | |
| <unzip src="${xbean.zip}" dest="${xbean.tmp}"> | |
| <patternset includes="xmlbeans-*/lib/xbean.jar" /> | |
| </unzip> | |
| <mkdir dir="${lib}" /> | |
| <copy tofile="${xbean.jar}"> | |
| <fileset dir="${xbean.tmp}" includes="xmlbeans-*/lib/xbean.jar" /> | |
| </copy> | |
| <delete dir="${xbean.tmp}" /> | |
| </target> | |
| </project> |