Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 59 additions & 45 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Authors:

==================================================================== -->
<project default="usage" basedir=".">

<!-- Xerces Java directories -->
<property name="build.dir" value="./build"/>
<property name="data.dir" value="./data"/>
Expand Down Expand Up @@ -59,7 +59,7 @@ Authors:
<property file="build.properties"/>
<property file=".ant.properties"/>
<property file="${user.home}/.ant.properties"/>
<property file="default.properties"/>
<property file="default.properties"/>

<target name="init">
<property name='parser.Name' value='Xerces-J'/>
Expand Down Expand Up @@ -179,10 +179,10 @@ Authors:

<copy file="${src.dir}/org/apache/xerces/jaxp/javax.xml.parsers.SAXParserFactory"
tofile="${build.dest}/META-INF/services/javax.xml.parsers.SAXParserFactory"/>

<copy file="${src.dir}/org/apache/xerces/jaxp/datatype/javax.xml.datatype.DatatypeFactory"
tofile="${build.dest}/META-INF/services/javax.xml.datatype.DatatypeFactory"/>

<copy file="${src.dir}/org/apache/xerces/jaxp/validation/javax.xml.validation.SchemaFactory"
tofile="${build.dest}/META-INF/services/javax.xml.validation.SchemaFactory"/>

Expand All @@ -198,11 +198,11 @@ Authors:
<!-- Prepares the source code -->
<!-- =================================================================== -->
<target name="prepare-src" depends="prepare-common">
<!-- Do not include this file in xercesImpl.jar. It prevents applications further down the
classpath from overriding the parser's default and may also cause an incompatible mix
of classes to be loaded leading to a failure such as a NoSuchMethodError. -->
<!-- <copy file="${src.dir}/org/apache/xerces/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration"
<!-- Do not include this file in xercesImpl.jar. It prevents applications further down the
classpath from overriding the parser's default and may also cause an incompatible mix
of classes to be loaded leading to a failure such as a NoSuchMethodError. -->
<!-- <copy file="${src.dir}/org/apache/xerces/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration"
tofile="${build.dest}/META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration"/> -->

<copy file="${src.dir}/org/apache/xerces/dom/org.w3c.dom.DOMImplementationSourceList"
Expand All @@ -219,7 +219,7 @@ Authors:
javax.xml.parsers.ConvertToURI.java">
</fileset>
</copy>

<!-- create English message bundles from the default ones -->
<copy file="${src.dir}/org/apache/xerces/impl/msg/DatatypeMessages.properties"
tofile="${build.src}/org/apache/xerces/impl/msg/DatatypeMessages_en.properties"/>
Expand Down Expand Up @@ -326,7 +326,7 @@ Authors:
<filter token="java.version" value="${java.version}"/>
<filter token="java.vendor" value="${java.vendor}"/>
<filter token="impl.name" value="${parser.Name} ${parser.Version}"/>
<filter token="impl.version" value="${parser.Version}"/>
<filter token="impl.version" value="${parser.Version}"/>
<copy todir="${build.dir}" file="${src.dir}/manifest.xerces" filtering="true"/>
<jar jarfile="${build.dir}/${jar.parser}"
basedir="${build.dest}"
Expand Down Expand Up @@ -395,7 +395,7 @@ Authors:
<!-- =================================================================== -->
<!-- Prepares the docs -->
<!-- =================================================================== -->
<target name="prepare-docs" depends="init">
<target name="prepare-docs" depends="init">
<mkdir dir="${build.docs}"/>
<mkdir dir="${build.dir}/xdocs"/>
<copy todir="${build.dir}/xdocs">
Expand All @@ -422,7 +422,7 @@ Authors:
<!-- first process the files that need two-phase transformations
to produce files in the document syntax -->
<xslt destdir="build/intermediate"
basedir="build/xdocs"
basedir="build/xdocs"
includes="faq-*.xml"
style="docs/style/stylesheets/faqs2document.xsl"
extension=".xml">
Expand All @@ -444,14 +444,14 @@ Authors:
<outputproperty name="method" value="xml"/>
</xslt>
<xslt destdir="build/intermediate"
basedir="build/xdocs"
basedir="build/xdocs"
includes="properties.xml,features.xml"
style="docs/style/stylesheets/settings2document.xsl"
extension=".xml">
<outputproperty name="method" value="xml"/>
</xslt>
<xslt destdir="build/intermediate"
basedir="build/xdocs"
basedir="build/xdocs"
includes="releases.xml"
style="docs/style/stylesheets/releases2document.xsl"
extension=".xml">
Expand All @@ -460,13 +460,13 @@ Authors:

<!-- now process all the XML documents to produce HTML documents -->
<xslt destdir="build/docs"
basedir="build/intermediate"
basedir="build/intermediate"
includes="faq*.xml,features.xml,properties.xml,releases.xml"
filenameparameter="sourceFilePath"
style="docs/style/stylesheets/document2html.xsl">
</xslt>
<xslt destdir="build/docs"
basedir="build/xdocs"
basedir="build/xdocs"
filenameparameter="sourceFilePath"
includes="api.xml, charter.xml, dom.xml, dom3.xml, download.xml, install.xml, jira.xml, limitations.xml, releases.xml, sax.xml, security.xml, source-repository.xml, xml-schema.xml, samples*.xml, xni*.xml"
style="docs/style/stylesheets/document2html.xsl">
Expand All @@ -484,37 +484,37 @@ Authors:
</copy>
<copy todir="build/docs/graphics">
<fileset dir="docs/style/graphics"/>
</copy>
</copy>
</target>


<target name="javadoc-replace" unless="additional.param">
<replace token="@xerces.internal" dir="${build.src}">
<replacevalue><![CDATA[<dl><dt><strong>INTERNAL:</strong></dt><dd>Usage of this class is not supported. It may be altered or removed at any time.</dd></dl>]]></replacevalue>
</replace>

<replace token="@xerces.experimental" dir="${build.src}">
<replacevalue><![CDATA[<dl><dt><strong>EXPERIMENTAL:</strong></dt><dd>This class should not be considered stable. It is likely to be altered or replaced in the future.</dd></dl>]]></replacevalue>
</replace>
</target>

<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadocs" depends="prepare-src">
<target name="javadocs" depends="prepare-src">

<condition property="additional.param" value=" -taglet org.apache.xerces.util.ExperimentalTaglet -taglet org.apache.xerces.util.InternalTaglet -tagletpath ${tools.dir}/bin/xerces2taglets.jar">
<available classname="com.sun.tools.doclets.Taglet"/>
</condition>

<antcall target="javadoc-replace" />

<condition property="additional.param" value="">
<not>
<available classname="com.sun.tools.doclets.Taglet"/>
</not>
</condition>

<mkdir dir='${build.dir}/docs/javadocs/api'/>
<javadoc packagenames='javax.xml.*,org.w3c.*,org.xml.*'
locale='en_US'
Expand All @@ -523,7 +523,12 @@ Authors:
windowtitle='XML Standard API' doctitle='XML Standard API'
bottom='${copyright}'
additionalparam='-quiet ${additional.param}'
/>
failonerror='no'
failonwarning='no'
>
<!-- There's no point linting packages that are not in the project src -->
<arg value="-Xdoclint:none"/>
</javadoc>
<mkdir dir='${build.dir}/docs/javadocs/xni'/>
<javadoc packagenames='org.apache.xerces.xni.*'
locale='en_US'
Expand All @@ -533,7 +538,9 @@ Authors:
doctitle='Xerces Native Interface'
bottom='${copyright}'
additionalparam='-quiet ${additional.param}'
/>
>
<arg value="-Xdoclint:html,accessibility"/>
</javadoc>
<mkdir dir='${build.dir}/docs/javadocs/xs'/>
<javadoc packagenames='org.apache.xerces.xs, org.apache.xerces.xs.datatypes'
locale='en_US'
Expand All @@ -543,7 +550,9 @@ Authors:
doctitle='XML Schema API'
bottom='${copyright}'
additionalparam='-quiet ${additional.param}'
/>
>
<arg value="-Xdoclint:html"/>
</javadoc>

<mkdir dir='${build.dir}/docs/javadocs/xerces2'/>
<javadoc packagenames='org.apache.xerces.dom.*,
Expand All @@ -562,7 +571,10 @@ Authors:
doctitle='Xerces2 Implementation'
bottom='${copyright}'
additionalparam='-quiet ${additional.param}'
/>
>
<!-- The org.apache.xerces packages are the ones that need the most attention -->
<arg value="-Xdoclint:html,missing"/>
</javadoc>
<mkdir dir='${build.dir}/docs/javadocs/other'/>
<javadoc packagenames='org.apache.html.*,
org.apache.wml.*,
Expand All @@ -573,7 +585,9 @@ Authors:
windowtitle='Other Classes' doctitle='Other Classes'
bottom='${copyright}'
additionalparam='-quiet ${additional.param}'
/>
>
<arg value="-Xdoclint:html"/>
</javadoc>
</target>

<!-- =================================================================== -->
Expand All @@ -591,7 +605,7 @@ Authors:

<copy todir="${distsrc.dir}/src" >
<fileset
dir="${src.dir}"
dir="${src.dir}"
includes="org/**, dom3/**, javax/**, manifest.xerces"
excludes="**/CVS*, **/.#*, **/*.class
**/v1/** **/v2/**"
Expand All @@ -601,7 +615,7 @@ Authors:

<copy todir="${distsrc.dir}/data" >
<fileset
dir="${data.dir}"
dir="${data.dir}"
excludes="**/CVS*, **/.#*"
/>
</copy>
Expand All @@ -615,7 +629,7 @@ Authors:

<copy todir="${distsrc.dir}/samples" >
<fileset
dir="${samples.dir}"
dir="${samples.dir}"
excludes="**/CVS*, **/*.#*"
/>
</copy>
Expand Down Expand Up @@ -653,7 +667,7 @@ Authors:

<copy todir="${disttools.dir}" >
<fileset
dir="${tools.dir}"
dir="${tools.dir}"
includes="**/*.txt, **/*.html, **/*.bat, **/*.jar, **/*.zip, **/*.opt"
excludes="**/CVS*, **/.#*, **/*.class"
/>
Expand Down Expand Up @@ -1025,7 +1039,7 @@ Authors:
<filter token="java.version" value="${java.version}"/>
<filter token="java.vendor" value="${java.vendor}"/>
<filter token="impl.name" value="${parser.Name} ${parser.Version}"/>
<filter token="impl.version" value="${parser.Version}"/>
<filter token="impl.version" value="${parser.Version}"/>
<copy todir="${build.dir}" file="${src.dir}/manifest.xerces" filtering="true"/>
<jar jarfile="${build.dir}/dtd-${jar.parser}"
basedir="${build.dest}"
Expand Down Expand Up @@ -1072,7 +1086,7 @@ Authors:

<copy file="${src.dir}/org/apache/xerces/dom/org.apache.xerces.dom.DOMImplementationSourceImpl"
tofile="${build.dest}/META-INF/services/org.w3c.dom.DOMImplementationSourceList"/>

<!-- delete META-INF/services files for DatatypeFactory/SchemaFactory
since no implementation is provided in this jar -->
<delete file="${build.dest}/META-INF/services/javax.xml.datatype.DatatypeFactory"/>
Expand Down Expand Up @@ -1200,7 +1214,7 @@ Authors:
token="return ((XSComplexTypeDecl) type).isDOMDerivedFrom(" value="return false;"/>
<replace file="${build.dir}/src/org/apache/xerces/dom/ElementNSImpl.java"
token="typeNamespaceArg, typeNameArg, derivationMethod);" value=""/>

<!-- HACK: Remove references to schema DOM from DOMUtil -->
<replace file="${build.dir}/src/org/apache/xerces/util/DOMUtil.java"
token="import org.apache.xerces.impl.xs.opti.ElementImpl;" value=""/>
Expand All @@ -1218,7 +1232,7 @@ Authors:
token="((org.apache.xerces.impl.xs.opti.NodeImpl)node).setReadOnly(false, false);" value="return;"/>
<replace file="${build.dir}/src/org/apache/xerces/util/DOMUtil.java"
token="return ((org.apache.xerces.impl.xs.opti.NodeImpl)node).getReadOnly();" value="return false;"/>

<!-- HACK: Remove references to schema validation support from org.apache.xerces.jaxp -->
<replace file="${build.dir}/src/org/apache/xerces/jaxp/SAXParserImpl.java"
token="import org.apache.xerces.impl.xs.XMLSchemaValidator;" value=""/>
Expand All @@ -1244,7 +1258,7 @@ Authors:
token="(XSGrammarPoolContainer) grammar, fSchemaValidationManager);" value=""/>
<replace file="${build.dir}/src/org/apache/xerces/jaxp/SAXParserImpl.java"
token="fSAXParser.fUnparsedEntityHandler.reset();" value=""/>

<replace file="${build.dir}/src/org/apache/xerces/jaxp/DocumentBuilderImpl.java"
token="import org.apache.xerces.impl.xs.XMLSchemaValidator;" value=""/>
<replace file="${build.dir}/src/org/apache/xerces/jaxp/DocumentBuilderImpl.java"
Expand All @@ -1269,7 +1283,7 @@ Authors:
token="(XSGrammarPoolContainer) grammar, fSchemaValidationManager);" value=""/>
<replace file="${build.dir}/src/org/apache/xerces/jaxp/DocumentBuilderImpl.java"
token="fUnparsedEntityHandler.reset();" value=""/>

<replace file="${build.dir}/src/org/apache/xerces/jaxp/SAXParserFactoryImpl.java"
token="return grammar;" value="throw new UnsupportedOperationException();"/>
<replace file="${build.dir}/src/org/apache/xerces/jaxp/SAXParserFactoryImpl.java"
Expand Down Expand Up @@ -1529,7 +1543,7 @@ Authors:
<filter token="java.version" value="${java.version}"/>
<filter token="java.vendor" value="${java.vendor}"/>
<filter token="impl.name" value="${parser.Name} ${parser.Version}"/>
<filter token="impl.version" value="${parser.Version}"/>
<filter token="impl.version" value="${parser.Version}"/>
<copy todir="${build.dir}" file="${src.dir}/manifest.xerces" filtering="true"/>
<jar jarfile="${build.dir}/schema11-${jar.parser}"
basedir="${build.dest}"
Expand All @@ -1548,7 +1562,7 @@ Authors:
</manifest>
<metainf dir="." includes="LICENSE,NOTICE"/>
</jar>
</target>
</target>

<!-- =================================================================== -->
<!-- Builds xercesImpl, xml-apis and sample jars with Schema 1.1 support -->
Expand All @@ -1568,10 +1582,10 @@ Authors:
<target name="xjavac-jar" depends="prepare">
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>

<copy file="${tools.dir}/src/XJavac.java"
tofile="${build.src}/org/apache/xerces/util/XJavac.java"/>

<javac srcdir="${build.src}"
destdir="${build.dest}"
source="${javac.source}"
Expand All @@ -1583,7 +1597,7 @@ Authors:
optimize="${optimize}"
includeAntRuntime="false"
includeJavaRuntime="false"/>

<jar jarfile="${build.dir}/${jar.xjavac}"
basedir="${build.dest}"
compress="true"
Expand Down