I have Xerces 1.4.4 building for Microsoft .NET
using the Beta1 J# compiler.  I didn't have to modify 
the source code except for 2 files that the J#
compiler cannot handle yet.  (XPath.java and
Token.java; These bugs have been reported to 
Microsoft.)  Other than that, I only had 
to add a few lines to the build.xml (attached).

Is .NET support something the Xerces-J community
is interested in pursuing.  I have to do Xerces on
.NET anyway for work but I wanted to know if you want 
to incorporate .NET support into the mainline 
distributions.





=====
Chris Maeda ([EMAIL PROTECTED])

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
<?xml version="1.0"?>

<!-- ===================================================================

Build file for Xerces-Java

Notes:
   This is a build file for use with the Jakarta Ant build tool.

Installation Instructions:
   To install Ant on your system, you need to checkout the
   "jakarta-tools" CVS module. Then you should place the files
     - ant.jar
     - projectx-tr2.jar
     - javac.jar
   in your classpath.

Build Instructions:
   To build, run

     java org.apache.tools.ant.Main <target>

   on the directory where this file is located with the target you want.
   There is also a batch file called "build.bat" to invoke Ant from a
   Windows command line shell. On the UNIX platform, use "build.sh" shell
   script to invoke Ant.

Most useful targets:

 - jar -> creates the "xerces.jar" file in "./build"
 - jars -> creates the "xerces.jar" and xercesSamples.jar files in "./build"
 - docs -> creates the HTML documentation in "./build/docs"
 - javadocs - crates the javadocs in "./build/javadocs"
 - dist -> creates the complete distribution
 - site -> regenerates the web site

Note:

  In order to regenerate the web site, you must have the "xml-site" and "xml-xerces"
  CVS modules checked-out in the same directory, or this won't work. for example

    xml.apache.org/xml-site
    xml.apache.org/xml-xerces
    ...

  Have fun!

Authors:
  Stefano Mazzocchi <[EMAIL PROTECTED]>
  Anupam Bagchi     <[EMAIL PROTECTED]>

Copyright:
  Copyright (c) 2000 The Apache Software Foundation.

   $Id: build.xml,v 1.49.2.2 2001/11/13 20:13:51 neilg Exp $

==================================================================== -->

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

  <target name="init">
    <property name="name" value="xerces"/>
    <property name="Name" value="Xerces-J"/>
    <property name="version" value="1.4.4"/>
    <property name="version_postfix" value=".1.4.4"/>
    <property name="appendit" value="1_4_4"/>
    <property name="year" value="1999-2001"/>
    <property name="copyright" value="Copyright &#169; ${year} Apache XML Project. All Rights Reserved."/>

    <echo message= "---------------- ${Name} ${version} [${year}] ---------------"/>
    <property name="debug" value="off"/>
    <property name="optimize" value="on"/>
    <property name="deprecation" value="off"/>

    <property name="src.dir" value="./src"/>
    <property name="docs.dir" value="./docs"/>
    <property name="data.dir" value="./data"/>
    <property name="samples.dir" value="./samples"/>
    <property name="tests.dir" value="./tests"/>
    <property name="tools.dir" value="./tools"/>
    <property name="docs.book" value="${docs.dir}/docs-book.xml"/>
    <property name="version.file" value="org/apache/xerces/framework/Version.java"/>

    <property name="packages" value="org.*"/>

    <property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
    <property name="doc.generator.package" value="${tools.dir}/stylebook-1.0-b2.jar"/>
    <property name="doc.style" value="${tools.dir}/style-apachexml"/>
    <property name="doc.style.jar" value="${tools.dir}/style-apachexml.jar"/>

    <property name="build.dir" value="./build"/>
    <property name="build.src" value="${build.dir}/src"/>
    <property name="build.dest" value="${build.dir}/classes"/>
    <property name="build.docs" value="${build.dir}/docs/html"/>
    <property name="build.samples" value="${build.dir}/samples"/>
    <property name="build.tests" value="${build.dir}/tests"/>
    <property name="build.data" value="${build.dir}/data"/>
    <property name="build.javadocs" value="${build.dir}/docs/html/apiDocs"/>
    <property name="compilation.classpath" value="${build.dest}"/>

    <property name="distsrc.dir" value="${build.dir}/${name}-${appendit}"/>
    <property name="distbin.dir" value="${build.dir}/${name}-${appendit}"/>

    <filter token="year" value="${year}"/>
    <filter token="version" value="${version}"/>
    <filter token="date" value="${TODAY}"/>
    <filter token="log" value="true"/>
    <filter token="verbose" value="true"/>

  </target>

  <!-- =================================================================== -->
  <!-- Help on usage                                                       -->
  <!-- =================================================================== -->
  <target name="usage">
    <echo message=""/>
    <echo message=""/>
    <echo message="${Name} Build instructions"/>
    <echo message="-------------------------------------------------------------"/>
    <echo message=""/>
    <echo message=" available targets are:"/>
    <echo message=""/>
    <echo message="   compile  --> compiles the source code"/>
    <echo message="   jar      --> generates the xerces.jar file"/>
    <echo message="   samples  --> compiles the samples source code"/>
    <echo message="   tests    --> compiles the tests source code"/>
    <echo message="   sampjar  --> generates the xercesSamples.jar file"/>
    <echo message="   jars     --> generates the xerces and xercesSamples jar files"/>
    <echo message="   docs     --> generates the HTML documentation"/>
    <echo message="   javadocs --> generates the API documentation (needs Java 1.2 or higher)"/>
    <echo message="   pack-src --> generates the source distributions of Xerces-Java (zip and tar.gz)"/>
    <echo message="   pack-bin --> generates the binary distributions of Xerces-Java (zip and tar.gz)"/>
    <echo message="   all      --> generates the binary and source distributions of Xerces-Java"/>
    <echo message="   test     --> runs a sanity test on the sample files"/>
    <echo message="   clean    --> cleans up all generated files and directories"/>
    <echo message="   usage    --> provides help on using the build tool (default)"/>
    <echo message=""/>
    <echo message=" See comments inside the build.xml file for more details."/>
    <echo message="-------------------------------------------------------------"/>
    <echo message=""/>
    <echo message=""/>
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the build directory                                        -->
  <!-- =================================================================== -->
  <target name="prepare" depends="init">
    <mkdir dir="${build.dir}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the source code                                            -->
  <!-- =================================================================== -->
  <target name="prepare-src" depends="prepare">
    <!-- create directories -->
    <mkdir dir="${build.src}"/>
    <mkdir dir="${build.dest}"/>
    <mkdir dir="${build.dest}/META-INF"/>
    <mkdir dir="${build.dest}/META-INF/services"/>

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

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

    <!-- copy src files -->
    <copy todir="${build.src}">
        <fileset 
            dir="${src.dir}"
            includes="**/Makefile, **/Makefile.incl, javax/**, org/**" 
            excludes="**/classfiles_updated **/CVS* **/.#*
                       **/SchemaImporter.java **/RevalidatingDOMParser.java
                       **/DatatypeContentModel.java **/ComplexTypeInfo.java
                       **/DTDImporter.java ">
        </fileset>
    </copy>
    
    
    <delete dir="${build.src}/whiteboard"/>

    <!-- substitute tokens as needed -->
    <replace file="${build.src}/${version.file}" token="@@version@@" value="${version}"/>
    <!-- <replace file="${build.src}/${version.file}" token="@@year@@" value="${year}"/> -->
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the source directory                                       -->
  <!-- =================================================================== -->
  <target name="compile" depends="prepare-src">
    <copy todir="${build.dest}">
      <fileset dir="${build.src}"
        includes="**/*.res, **/*.properties">
      </fileset>
    </copy>
    <javac srcdir="${build.src}"
           excludes="**/RevalidatingDOMParser.java "
           classpath="${compilation.classpath}"
           destdir="${build.dest}"
           debug="${debug}"
           deprecation="${deprecation}"
           optimize="${optimize}" 
           includeAntRuntime="false"/> 
  </target>

  <!-- =================================================================== -->
  <!-- Creates the class package                                           -->
  <!-- =================================================================== -->
  <target name="jar" depends="compile">
    <jar jarfile="${build.dir}/${name}.jar"
         basedir="${build.dest}"
         compress="false"
         includes="org/**, javax/**,META-INF/**, org/apache/xerces/utils/regex/*.properties"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the samples                                                -->
  <!-- =================================================================== -->
  <target name="samples" depends="compile">
    <mkdir dir="${build.samples}"/>
    <copy todir="${build.samples}" >
        <fileset dir="${samples.dir}" />
    </copy>
    <javac srcdir="${build.samples}"
           destdir="${build.dest}"
           classpath="${build.dir}/${name}.jar"
           debug="${debug}"
           includeAntRuntime="false"/> 
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the tests                                                  -->
  <!-- =================================================================== -->
  <target name="tests" depends="samples">
    <mkdir dir="${build.tests}"/>
    <copy todir="${build.tests}">
        <fileset dir="${tests.dir}" excludes="io/**"
        />
    </copy>
    <javac srcdir="${build.tests}"
           destdir="${build.dest}"
           classpath="${build.dir}/${name}.jar"
           debug="${debug}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the samples package                                         -->
  <!-- =================================================================== -->
  <target name="sampjar" depends="samples">
    <jar jarfile="${build.dir}/${name}Samples.jar"
         basedir="${build.dest}"
         compress="false"
         includes="dom/**,sax/**,ui/**,util/**"/>
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the docs                                                   -->
  <!-- =================================================================== -->
  <target name="prepare-docs" depends="init">
    <mkdir dir="${build.docs}"/>
    <unjar src="${doc.style.jar}"
        dest="${doc.style}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Generate HTML docs                                                  -->
  <!-- =================================================================== -->
  <target name="docs" depends="prepare, prepare-docs">
    <echo message="Building docs for ${Name} ${version} ..." />
    <java fork="yes"
          classpath="${java.class.path}:${doc.generator.package}"
          classname="${doc.generator}"
          args="targetDirectory=${build.docs} ${docs.book} ${doc.style}"/>
    <delete dir="${doc.style}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the API documentation                                       -->
  <!-- =================================================================== -->
  <target name="javadocs" depends="prepare-src">
    <mkdir dir="${build.javadocs}"/>
    <javadoc packagenames="${packages}"
             sourcepath="${build.src}"
             destdir="${build.javadocs}"
             author="true"
             version="true"
             use="true"
             windowtitle="${Name} API"
             doctitle="${Name}"
             bottom="${copyright}" />
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the source distribution                                    -->
  <!-- =================================================================== -->
  <target name="pack-src" depends="init">
    <echo message="Building the source distribution files (zip,tar)"/>
    <delete dir="${distbin.dir}"/>

    <mkdir dir="${distsrc.dir}"/>
    <mkdir dir="${distsrc.dir}/src"/>
    <mkdir dir="${distsrc.dir}/data"/>
    <mkdir dir="${distsrc.dir}/docs"/>
    <mkdir dir="${distsrc.dir}/samples"/>

    <copy todir="${distsrc.dir}/src" >
        <fileset
            dir="${src.dir}"  
            includes="**/Makefile, **/Makefile.incl, org/**, javax/**"
            excludes="**/CVS*, **/.#*, **/*.class"
        />
    </copy>


    <copy todir="${distsrc.dir}/data" >
        <fileset
            dir="${data.dir}"  
            excludes="**/CVS*, **/.#*"
        />
    </copy>

    <copy todir="${distsrc.dir}/docs" >
        <fileset
            dir="${docs.dir}" 
            excludes="**/CVS*, **/*.#*, pdf/**, html/**, **/apiDocs*"
        />
    </copy>

    <copy todir="${distsrc.dir}/samples" >
        <fileset
            dir="${samples.dir}"  
            excludes="**/CVS*, **/*.#*"
        />
    </copy>

    <copy file="Makefile" tofile="${distsrc.dir}/Makefile"/>
    <copy file="LICENSE" tofile="${distsrc.dir}/LICENSE"/>
    <copy file="README" tofile="${distsrc.dir}/README"/>
    <copy file="Readme.html" tofile="${distsrc.dir}/Readme.html"/>
    <copy file="STATUS" tofile="${distsrc.dir}/STATUS"/>
    <copy file="build.xml" tofile="${distsrc.dir}/build.xml"/>
    <copy file="${basedir}/build.sh" tofile="${distsrc.dir}/build.sh" />
    <chmod file="${distsrc.dir}/build.sh" perm="ugo+rx" />
    <copy file="${basedir}/build.bat" tofile="${distsrc.dir}/build.bat" />

    <zip zipfile="${build.dir}/${Name}-src${version_postfix}.zip" basedir="${build.dir}"
         includes="${name}-${appendit}/**" excludes="*.class"/>

    <tar tarfile="${build.dir}/${Name}-src${version_postfix}.tar" basedir="${build.dir}"
         includes="${name}-${appendit}/**" excludes="*.class"/>
    <gzip zipfile="${build.dir}/${Name}-src${version_postfix}.tar.gz"
          src="${build.dir}/${Name}-src${version_postfix}.tar" />
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the binary distribution                                    -->
  <!-- =================================================================== -->
  <target name="pack-bin" depends="jar, sampjar, javadocs, docs">

    <echo message="Building the binary distribution files (zip,tar)"/>
    <delete dir="${distbin.dir}"/>
    <mkdir dir="${distbin.dir}"/>
    <mkdir dir="${distbin.dir}/data"/>
    <mkdir dir="${distbin.dir}/docs"/>
    <mkdir dir="${distbin.dir}/docs/html"/>
    <mkdir dir="${distbin.dir}/docs/html/apiDocs"/>
    <mkdir dir="${distsrc.dir}/samples"/>


    <copy todir="${distbin.dir}/data" >
        <fileset
            dir="${data.dir}"
            excludes="**/CVS*, **/*.#*"
        />
    </copy>

    <copy todir="${distbin.dir}/docs/html" >
        <fileset dir="${build.docs}" />
    </copy>

    <copy todir="${distbin.dir}/docs/html/apiDocs" >
        <fileset dir="${build.javadocs}" />
    </copy>

    <copy file="${build.dir}/${name}.jar" tofile="${distbin.dir}/${name}.jar"/>
    <copy file="${build.dir}/${name}Samples.jar" tofile="${distbin.dir}/${name}Samples.jar"/>

    <copy file="LICENSE" tofile="${distbin.dir}/LICENSE"/>
    <copy file="Readme.html" tofile="${distbin.dir}/Readme.html"/>

    <copy todir="${distsrc.dir}/samples" >
        <fileset
            dir="${samples.dir}"
            excludes="**/CVS*, **/*.#*"
        />
    </copy>


    <zip zipfile="${build.dir}/${Name}-bin${version_postfix}.zip" basedir="${build.dir}"
         includes="${name}-${appendit}/**" excludes="*.class"/>
    <tar tarfile="${build.dir}/${Name}-bin${version_postfix}.tar" basedir="${build.dir}"
         includes="${name}-${appendit}/**" excludes="*.class"/>
    <gzip zipfile="${build.dir}/${Name}-bin${version_postfix}.tar.gz"
          src="${build.dir}/${Name}-bin${version_postfix}.tar" />

  </target>

  <!-- =================================================================== -->
  <!-- Do a sanity test using xercesSamples.jar                            -->
  <!-- =================================================================== -->
  <target name="test" depends="sampjar">
    <echo message="Performing sanity test for ${Name} ${version} ..." />
    <echo message="Using classpath=&apos;${build.dir}/${name}Samples.jar;${build.dir}/${name}.jar&apos;" />
    <echo message="Running SAXCount ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar;"
          classname="sax.SAXCount"
          args="${data.dir}/personal.xml"/>
    <echo message="Running SAX2Count ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar;"
          classname="sax.SAX2Count"
          args="${data.dir}/personal.xml"/>
    <echo message="Running SAXWriter ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar"
          classname="sax.SAXWriter"
          args="${data.dir}/personal.xml"/>
    <echo message="Running DOMCount ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar"
          classname="dom.DOMCount"
          args="${data.dir}/personal.xml"/>
    <echo message="Running DOMWriter ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar"
          classname="dom.DOMWriter"
          args="${data.dir}/personal.xml"/>
    <echo message="Running DOMFilter ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar"
          classname="dom.DOMFilter"
          args="-p dom.wrappers.DOMParser ${data.dir}/personal.xml"/>
    <!-- The following are samples but not command-line applications.
    <echo message="Running IteratorView ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar"
          classname="dom.traversal.IteratorView"
          args="${data.dir}/personal.xml"/>
    <echo message="Running TreeWalkerView ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar"
          classname="dom.traversal.TreeWalkerView"
          args="${data.dir}/personal.xml"/>
    <echo message="Running TreeViewer ..." />
    <java fork="yes"
          classpath="${build.dir}/${name}Samples.jar:${build.dir}/${name}.jar"
          classname="dom.TreeViewer"
          args="${data.dir}/personal.xml"/>
     -->
  </target>

  <!-- =================================================================== -->
  <!-- Builds both xerces and sample jar files                             -->
  <!-- =================================================================== -->
  <target name="jars" depends="jar, sampjar">
  </target>

  <!-- =================================================================== -->
  <!-- Builds and packages sources and binary distributions                -->
  <!-- =================================================================== -->
  <target name="all" depends="pack-src, pack-bin">
  </target>

  <!-- =================================================================== -->
  <!-- Cleans everything                                                   -->
  <!-- =================================================================== -->
  <target name="clean" depends="init">
    <delete file="${name}.jar"/>
    <delete file="${name}Samples.jar"/>
    <delete dir="${build.dir}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Experimental Microsoft .NET Support                                 -->
  <!-- =================================================================== -->
  <target name="dotnet" depends="prepare-src,dotnet-patches">
    <exec dir="${build.src}" executable="jc.exe">
      <arg value="/target:library"/>   <!-- output an assembly -->
      <arg value="/recurse:*.java"/>   <!-- compile all java files in build.src -->
      <arg value="/x:all"/>            <!-- disable Microsoft language extensions -->
      <!-- NOTE: output location is relative to the directory of the exec command -->
      <arg value="/out:..\xerces.dll"/>
    </exec>
  </target>

  <!-- J# Beta 1 compiler crashes on 2 files in Xerces 1.4.4.
       Copy patched files into build tree as a workaround until Beta 2.
       -->
  <target name="dotnet-patches" depends="prepare-src">
    <copy todir="${build.src}/org/apache/xerces/utils/regex" overwrite="yes">
      <fileset dir="./dotnet/org/apache/xerces/utils/regex"/>
    </copy>
    <copy todir="${build.src}/org/apache/xerces/validators/schema/identity" overwrite="yes">          
      <fileset dir="./dotnet/org/apache/xerces/validators/schema/identity"/>
    </copy>
  </target>

</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to