Source code file content

Revision: 4179

removing obsolete branches/tags
» Project Revision History

» Checkout URL

version2 / tags / jaxb-2_1_13-tag / jaxb-ri / build.xml

Size: 37283 bytes, 1 line
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
 Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 
 The contents of this file are subject to the terms of either the GNU
 General Public License Version 2 only ("GPL") or the Common Development
 and Distribution License("CDDL") (collectively, the "License").  You
 may not use this file except in compliance with the License. You can obtain
 a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
 or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
 language governing permissions and limitations under the License.
 
 When distributing the software, include this License Header Notice in each
 file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
 Sun designates this particular file as subject to the "Classpath" exception
 as provided by Sun in the GPL Version 2 section of the License file that
 accompanied this code.  If applicable, add the following below the License
 Header, with the fields enclosed by brackets [] replaced by your own
 identifying information: "Portions Copyrighted [year]
 [name of copyright owner]"
 
 Contributor(s):
 
 If you wish your version of this file to be governed by only the CDDL or
 only the GPL Version 2, indicate your decision by adding "[Contributor]
 elects to include this software in this distribution under the [CDDL or GPL
 Version 2] license."  If you don't indicate a single choice of license, a
 recipient has the option to distribute your version of this file under
 either the CDDL, the GPL Version 2 or to extend the choice of license to
 its licensees as provided above.  However, if you add GPL Version 2 code
 and therefore, elected the GPL Version 2 license, then the option applies
 only if the new code is made subject to such option by the copyright
 holder.
-->

<!-- Use the following doctypedecl for DTD aware editing.  Comment out b/c
     it presumably causes Ant problems for some users.
<!DOCTYPE project PUBLIC "-//ANT//DTD project//EN" "project.dtd">
-->

<project name="jaxb" basedir="." default="compile">
    <description>
        JAXB-RI Master Project
        ======================
 
        This project is organized into multiple sub-projects.  Each sub-project is
        responsible for building itself.
        The build files are setup such that you can build the sub-
        projects independently or all together.

        For example, building the runtime sub-project causes all of runtime sources 
        in jaxb-ri/runtime/src to be compiled into jaxb-ri/runtime/build/classes.

        To build the entire project, simply run 'ant' in the jaxb-ri directory.
        To build a sub-project, simply cd into the directory and run 'ant'.

        To create a distribution of the entire project, simply run 'ant dist' in
        the jaxb-ri directory.

        Use parse-ipr (http://parse-ipr.dev.java.net/) to set up the classpath for
        debugging.

    </description>

    <import file="nbproject/build-impl.xml"/>
    <!--

    There exist several targets which are by default empty and which can be
    used for execution of your tasks. These targets are usually executed
    before and after some main targets. They are:

      -pre-init:                 called before initialization of project properties
      -post-init:                called after initialization of project properties
      -pre-compile:              called before javac compilation
      -post-compile:             called after javac compilation
      -pre-compile-single:       called before javac compilation of single file
      -post-compile-single:      called after javac compilation of single file
      -pre-compile-test:         called before javac compilation of JUnit tests
      -post-compile-test:        called after javac compilation of JUnit tests
      -pre-compile-test-single:  called before javac compilation of single JUnit test
      -post-compile-test-single: called after javac compilation of single JUunit test
      -pre-jar:                  called before JAR building
      -post-jar:                 called after JAR building
      -post-clean:               called after cleaning build products

    (Targets beginning with '-' are not intended to be called on their own.)

    Example of inserting an obfuscator after compilation could look like this:

        <target name="-post-compile">
            <obfuscate>
                <fileset dir="${build.classes.dir}"/>
            </obfuscate>
        </target>

    For list of available properties check the imported
    nbproject/build-impl.xml file.


    Another way to customize the build is by overriding existing main targets.
    The targets of interest are:

      -init-macrodef-javac:     defines macro for javac compilation
      -init-macrodef-junit:     defines macro for junit execution
      -init-macrodef-debug:     defines macro for class debugging
      -init-macrodef-java:      defines macro for class execution
      -do-jar-with-manifest:    JAR building (if you are using a manifest)
      -do-jar-without-manifest: JAR building (if you are not using a manifest)
      run:                      execution of project
      -javadoc-build:           Javadoc generation
      test-report:              JUnit report generation

    An example of overriding the target for project execution could look like this:

        <target name="run" depends="JAXB_2.1-impl.jar">
            <exec dir="bin" executable="launcher.exe">
                <arg file="${dist.jar}"/>
            </exec>
        </target>

    Notice that the overridden target depends on the jar target and not only on
    the compile target as the regular run target does. Again, for a list of available
    properties which you can use, check the target you are overriding in the
    nbproject/build-impl.xml file.

    -->

    <!-- initialize build properties -->
    <property file="${basedir}/build.properties" />

    <import file="build-taskdefs.xml" />

    <target name="init-standalone">
        <!-- this property is used by "xjc -version" and is also set in each of the
             generated ObjectFactory classes.  It should be set via the RE build
             scripts via 'ant -Dbuild.id="b08"' otherwise the current date and time
             will be used -->
        <tstamp>
            <format property="now" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
        </tstamp>
        <property name="build.id" value="${now}(${user.name})" />
        <property name="build.version" value="${release.impl.version}-${build.id}-${release.impl.version.suffix}" />
        <echo message="The build id is: ${build.version}" />
    </target>

    <target name="jar" depends="compile"/>

    <!-- compile all of the sources into <project>/build/classes-->
    <target name="compile"
            depends="init-standalone"
            description="compile runtime, and xjc sub-projects">
        <ant dir="apgen"               target="compile" />
        <ant dir="runtime"             target="compile" />
        <ant dir="runtime-fi"          target="compile" />
        <ant dir="runtime-staxex"      target="compile" />
        <ant dir="runtime-deprecated"  target="compile" />
        <ant dir="xjc"                 target="compile" />
        <ant dir="tools"               target="compile" />
    </target>

  <!--
  Invoke j2se-integration target with property ${jaxb.version.in.jdk} set
  to right target version
  -->

  <target name="j2se-integration" depends="init-standalone"
          description="prepare renamed source code for J2SE integration">
    <property name="jaxb.version.in.jdk" value="JAXB 2.0 in JDK 1.6"/>
    
    <ant dir="apgen" target="compile" />
    <subant target="j2se-integration">
      <fileset file="runtime/build.xml" />
      <fileset file="runtime-fi/build.xml" />
      <fileset file="runtime-staxex/build.xml" />
      <fileset file="xjc/build.xml" />
    </subant>

    <!-- exclude ant tasks -->
    <delete file="j2se-integration/xjc/src/com/sun/tools/internal/xjc/XJC2Task.java"/>
    <!-- move META-INF/services to tools/META-INF/services -->
    <move file="j2se-integration/xjc/src/META-INF/services/com.sun.tools.xjc.Plugin"
          tofile="j2se-integration/tools/etc/META-INF/services/sun.tools.xjc.Plugin"/>
    <delete dir="j2se-integration/xjc/src/META-INF"/>
	
	<!-- delete binary doc-files -->
	<delete>
		<fileset dir="j2se-integration/runtime/src/com/sun/xml/internal/bind/v2/doc-files" includes="*.gif,*.png,*.sxd,*.vsd"/>
		<fileset dir="j2se-integration/xjc/src/com/sun/tools/internal/xjc/reader/xmlschema/doc-files" includes="*.gif,*.png,*.sxd,*.vsd"/>
	</delete>
	    
    <!-- insert the RI version number into the file prolog message that
        is placed at the head of every generated file and the output
        message for "xjc -version"  and
        message for "schemagen -version" -->
    <replace dir="j2se-integration/xjc/src/com/sun/tools/internal/xjc" includes="MessageBundle*.properties">
      <replacefilter token="@@BUILD_VERSION@@" value="${jaxb.version.in.jdk}"/>
    </replace>
    <replace dir="j2se-integration/xjc/src/com/sun/tools/internal/jxc" includes="MessageBundle*.properties">
      <replacefilter token="@@BUILD_VERSION@@" value="${jaxb.version.in.jdk}"/>
    </replace>

  </target>


  <target name="architecture-document"
            description="generate architecture documents (which is just a glorified javadoc)">
      <arch-doc destdir="${jaxb.root}/build/javadoc" title="JAXB RI">
        <params>
          <packageset dir="${jaxb.root}/javadoc"/>
          <group title="Root Architecture Document" packages="jaxb" />

          <packageset dir="${runtime.src}"/>
          <packageset dir="${runtime.root}/arch-doc"/>
          <group title="Runtime API for JAX-WS" packages="com.sun.xml.bind.api" />
          <group title="Runtime" packages="com.sun.xml.bind*" />

          <packageset dir="${xjc.src}"/>
          <group title="XJC API for JAX-WS" packages="com.sun.tools.xjc.api" />
          <group title="XJC" packages="com.sun.tools.xjc*:com.sun.tools.jxc*" />
        </params>
      </arch-doc>
    </target>




    <!-- task that generates a manifest file -->
    <macrodef name="createManifest">
      <attribute name="extensionName"/>
      <attribute name="file"/>
      <sequential>
        <copy tofile="@{file}"
              file="./MANIFEST.MF"
              overwrite="yes"/>
        <replace file="@{file}">
            <replacefilter token="@@@@SPEC_VERSION@@@@"
                           value="${release.spec.version}" />
            <replacefilter token="@@@@IMPL_VERSION@@@@"
                           value="${release.impl.version}"/>
            <replacefilter token="@@@@VENDOR_ID@@@@"
                           value="com.sun"/>
            <replacefilter token="@@@@EXTENSION_NAME@@@@"
                           value="@{extensionName}"/>
            <replacefilter token="@@@@BUILD_ID@@@@"
                           value="${build.id}"/>
        </replace>
      </sequential>
    </macrodef>


    <!-- generate a distribution -->
    <target name="dist"
            depends="compile,integrate-1.0-compiler"
            description="create a distribution in jaxb-ri/dist">
        <mkdir dir="${jaxb.dist}" />
        <mkdir dir="${jaxb.dist}/bin" />
        <mkdir dir="${jaxb.dist}/lib" />

        <parallel>
          <!-- copy redist jars -->
          <sequential>
              <copy todir="${jaxb.dist}/lib">
                  <fileset dir="${jaxb.libs.redist}">
                       <include name="**/*.jar"/>
                       <include name="**/*.zip"/>
                  </fileset>
              </copy>
          </sequential>


          <!-- JAXB 2.0 runtime jar-->
          <!-- generate jaxb-impl.jar for 2.0 runtime -->
          <sequential>
              <createManifest file="${runtime.root}/build/manifest.rt" extensionName="com.sun.xml.bind" />
              <!--taskdef name="stripper" classname="org.kohsuke.stripper.StripperTask">
                <classpath>
                  <pathelement path="${jaxb.libs.util}/stripper.jar"/>
                </classpath>
              </taskdef>
              <stripper remove="basicDebugInfo compilerInfo">
                <source dir="${runtime.classes}" includes="**/*.class" />
              </stripper-->
              <manifest mode="update" file="${runtime.root}/build/manifest.rt">
                <attribute name="Class-Path" value="jaxb-api.jar activation.jar jsr173_1.0_api.jar jaxb1-impl.jar" /> <!-- added for JES4 script compatibility -->
                <section name="com.sun.xml.bind.v2.runtime">
                  <attribute name="Implementation-Version" value="${build.version}" />
                </section>
              </manifest>
              <jar jarfile="${jaxb.dist}/lib/jaxb-impl.jar"
                   manifest="${runtime.root}/build/manifest.rt"
                   duplicate="fail">
                  <fileset dir="${runtime.classes}"/>
                  <fileset dir="${runtime-fi.classes}"/>
                  <fileset dir="${runtime-staxex.classes}"/>
                  <fileset dir="${runtime.src}" includes="META-INF/**/*" />
                  <zipgroupfileset dir="${jaxb.libs.runtime2}" includes="*.jar" />
              </jar>
          </sequential>


          <!-- JAXB 1.0 runtime jar -->
          <!-- generate jaxb1-impl.jar for 1.0 runtime -->
          <!-- include the contents of the old jaxb-libs.jar -->
          <sequential>
              <createManifest file="${runtime.root}/build/manifest.rt1" extensionName="com.sun.xml.bind" />
              <mkdir dir="${jaxb.root}/build/jaxb-1-impl-rejar"/>
              <unzip dest="${jaxb.root}/build/jaxb-1-impl-rejar">
                <fileset dir="${jaxb.libs.runtime}" includes="*.jar" />
              </unzip>
              <jar jarfile="${jaxb.dist}/lib/jaxb1-impl.jar"
                   manifest="${runtime.root}/build/manifest.rt1">
                  <!-- can't use zipgroupfileset because of the duplicate version.properties -->
                  <fileset dir="${jaxb.root}/build/jaxb-1-impl-rejar"/>
                  <fileset dir="${runtime-deprecated.classes}"/>
              </jar>
              <delete dir="${jaxb.root}/build/jaxb-1-impl-rejar"/>
          </sequential>


          <!-- generate jaxb-xjc.jar: xjc, and schemagen subprojects -->
          <sequential>
              <createManifest file="${xjc.root}/manifest.xjc" extensionName="com.sun.tools.xjc" />

              <!-- the manifest classpath isn't quite like any of the path structures
                   supported by Ant, so build the list the old fashioned way.

                   and yes, it's OK to have new lines and spaces inbetween.
              -->
              <property name="manifest.classpath"
                value="jaxb-api.jar jaxb-impl.jar jsr173_1.0_api.jar activation.jar" />
              <echo file="${xjc.root}/manifest.xjc" append="true"
>Main-Class: com.sun.tools.xjc.XJCFacade
Class-Path: ${manifest.classpath}

</echo>
              <copy todir="${xjc.classes}">
                <fileset dir="${xjc.src}" includes="com/sun/tools/xjc/runtime/*.java" />
                <mapper type="glob" from="*.java" to="*.java_" />
              </copy>

              <mkdir dir="${jaxb.root}/build/jaxb-xjc-rejar"/>
              <unzip dest="${jaxb.root}/build/jaxb-xjc-rejar">
                <fileset dir="${jaxb.libs.compiler}" includes="*.jar" />
              </unzip>
              <jar jarfile="${jaxb.dist}/lib/jaxb-xjc.jar"
                   manifest="${xjc.root}/manifest.xjc"
                   duplicate="fail">
                  <!-- can't use zipgroupfileset because of the duplicate LICENSE.txt -->
                  <fileset dir="${jaxb.root}/build/jaxb-xjc-rejar"/>
                  <fileset dir="${xjc.classes}"/>
                  <metainf dir="${xjc.src}/META-INF" />
                  <!-- bundle the 1.0 compiler in the side directory -->
                  <zipfileset dir="${xjc10.classes}/.." />
              </jar>
              <delete dir="${jaxb.root}/build/jaxb-xjc-rejar"/>
          </sequential>


          <!-- copy bin scripts -->
          <sequential>
              <copy file="${jaxb.root}/tools/bin/xjc.bat" todir="${jaxb.dist}/bin"/>
              <copy file="${jaxb.root}/tools/bin/xjc.sh"  todir="${jaxb.dist}/bin"/>
              <copy file="${jaxb.root}/tools/bin/schemagen.bat" todir="${jaxb.dist}/bin"/>
              <copy file="${jaxb.root}/tools/bin/schemagen.sh"  todir="${jaxb.dist}/bin"/>
              <chmod file="${jaxb.dist}/bin/xjc.sh" perm="ugo+rx"/>
              <chmod file="${jaxb.dist}/bin/schemagen.sh" perm="ugo+rx"/>
          </sequential>
        </parallel>
    </target>

    <target name="dist-zip" depends="dist"
        description="run dist then package the image to jaxb-ri.zip">

        <zip destfile="${jaxb.root}/jaxb-ri.zip">
            <zipfileset dir="${jaxb.dist}" prefix="jaxb-ri" />
        </zip>
    </target>

    <target name="dist-zip-with-src" depends="src-zip, dist-zip"/>

    <target name="src-zip" depends="init-standalone,dist"
            description="source zip files for JAXB RI jar files into the dist dir.">
      <mkdir dir="tmp" />
      <parallel>                 
        <sequential>
          <zip zipfile="${jaxb.dist}/lib/jaxb-impl.src.zip">
            <fileset dir="${runtime.src}"/>
            <fileset dir="${runtime-fi.src}"/>
            <fileset dir="${runtime-staxex.src}"/>
            <fileset dir="${runtime.root}/build/src" />
            <zipfileset src="${jaxb.libs}/src/txw2-src.zip" />
            <zipfileset src="${jaxb.libs}/src/istack-commons-runtime-src.zip" />
          </zip>
        </sequential>
        <sequential>
          <mkdir dir="tmp_xjc" />
          <copy todir="tmp_xjc">
            <fileset dir="${xjc.src}"/>
          </copy>
          <replace dir="tmp_xjc/com/sun/tools/xjc" includes="MessageBundle*.properties">
            <replacefilter token="@@BUILD_VERSION@@" value="${build.version}"/>
          </replace>
          <replace dir="tmp_xjc/com/sun/tools/jxc" includes="MessageBundle*.properties">
            <replacefilter token="@@BUILD_VERSION@@" value="${build.version}"/>
          </replace>
          <replace dir="tmp_xjc/com/sun/tools/xjc" includes="MessageBundle*.properties">
            <replacefilter token="@@JAXB_JDK_VERSION@@" value="${release.impl.version}"/>
          </replace>
          <unjar src="${jaxb.libs}/src/dtd-parser-1.0-src.zip" dest="tmp" />
          <zip zipfile="${jaxb.dist}/lib/jaxb-xjc.src.zip">
            <fileset dir="tmp_xjc"/>
            <fileset dir="${xjc.gensrc}"/>
            <fileset dir="${xjc.root}/facade"/>
            <zipfileset src="${jaxb.libs}/src/codemodel.src.zip" />
            <zipfileset src="${jaxb.libs}/src/resolver-src.zip" />
            <zipfileset src="${jaxb.libs}/src/xsom-src.zip" />
            <zipfileset src="${jaxb.libs}/src/istack-commons-tools-src.zip" />
            <zipfileset src="${jaxb.libs}/src/relaxngDatatype-src.zip" />
            <zipfileset src="${jaxb.libs}/src/rngom-src.zip" />
            <fileset dir="tmp/dtd-parser-1.0/src"/>
          </zip>
        </sequential>
        <sequential>
              <mkdir dir="${jaxb.root}/build/jaxb-1-impl-src"/>
              <unzip dest="${jaxb.root}/build/jaxb-1-impl-src">
                <fileset dir="${jaxb.libs.src}" includes="iso-relax-src.zip"/>
                <fileset dir="${jaxb.libs.src}" includes="msv-src.zip"/>
                <fileset dir="${jaxb.libs.src}" includes="relangDatatype-src.zip"/>
                <fileset dir="${jaxb.libs.src}" includes="xsdlib-src.zip"/>
              </unzip>
              <zip zipfile="${jaxb.dist}/lib/jaxb1-impl-src.zip">
                  <fileset dir="${jaxb.root}/build/jaxb-1-impl-src"/>
                  <fileset dir="${runtime-deprecated.src}"/>
              </zip>
              <delete dir="${jaxb.root}/build/jaxb-1-impl-src"/>
        </sequential>
      </parallel>
      <delete dir="tmp" />
      <delete dir="tmp_xjc" />
    </target>

    <target name="hudson" depends="clean, dist-zip-with-src"
            description="Target to be invoked on Hudson">
    </target>

  <target name="licensee-zip"
          description="licensee bundle. Dumbed down version of the workspace bundle">
    <mkdir dir="build"/>
    <zip zipfile="build/jaxb-ri.licensee.zip">
      <fileset dir="." excludes="dist/**, **/build/**, sandbox/**" />
    </zip>
  </target>




    <target name="bin-installer"
            description="generate the binary distribution installer with the license click-through"
            depends="dist">

        <tstamp />

        <property name="bin.installer.stage" value="${jaxb.root}/build/bin-installer" />
        <property name="bin.installer.className" value="JAXB2_${DSTAMP}" />
        <property name="bin.installer.jar" value="${jaxb.root}/build/${bin.installer.className}.jar" />

        <mkdir dir="${bin.installer.stage}"/>
        <zip destfile="${bin.installer.stage}/package.zip">
            <zipfileset dir="${jaxb.dist}" prefix="jaxb-ri-${DSTAMP}" />
        </zip>

        <!-- build installer -->
        <ant dir="tools/installer" />
        <ant dir="tools/installer-builder" />

        <taskdef name="installerBuilder" classname="com.sun.tools.xjc.installer.builder.BuilderTask">
            <classpath>
                <fileset dir="${jaxb.libs.util}" includes="*.jar"/>
            </classpath>
        </taskdef>

        <installerBuilder
          jarFile="${bin.installer.jar}"
          licenseFile="${jaxb.root}/docs/license.txt"
          zipFile="${bin.installer.stage}/package.zip" />

        <echo>binary installer produced at ${bin.installer.jar}</echo>
    </target>



    <patternset id="src-includes"
                description="This pattern set defines which files will be in/excluded in the src bundle">
        <include name="**/*.java"/>
        <include name="**/*.properties"/>
    </patternset>

    <target name="src-installer"
            description="generate the source code distribution installer with the license click-through"
            depends="dist">

        <tstamp />

        <property name="src.installer.stage" value="${jaxb.root}/build/src-installer" />
        <property name="src.installer.className" value="JAXB2_src_${DSTAMP}" />
        <property name="src.installer.class" value="${jaxb.root}/build/${src.installer.className}.jar" />
        <property name="src.installer.tmp" value="${jaxb.root}/build/src-tmp" />

        <!-- create jaxb-src.zip -->
        <mkdir dir="${src.installer.stage}"/>
        <zip destfile="${src.installer.stage}/package.zip" duplicate="fail" whenempty="fail">
            <zipfileset src="${jaxb.libs.redist}/jaxb-api-src.zip" prefix="jaxb-ri-${DSTAMP}/src" />
            <zipfileset dir="${xjc.src}" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="${xjc.gensrc}" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="${runtime.root}/arch-doc" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="${runtime.src}" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="runtime/build/src" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="${jaxb.root}" includes="src-installer-build.xml"
                fullpath="jaxb-ri-${DSTAMP}/build.xml"/>
            <!-- additional jar files -->
            <zipfileset dir="${jaxb.libs.runtime}" includes="*.jar" prefix="jaxb-ri-${DSTAMP}/lib" />
            <zipfileset dir="${jaxb.libs.runtime2}" includes="*.jar" prefix="jaxb-ri-${DSTAMP}/lib" />
            <zipfileset dir="${jaxb.libs.compiler}" includes="*.jar" prefix="jaxb-ri-${DSTAMP}/lib" excludes="relaxngDatatype.jar" />
            <zipfileset dir="${jaxb.libs}/redist"  includes="*.jar" prefix="jaxb-ri-${DSTAMP}/lib" />
            <zipfileset dir="${jaxb.libs}/src" prefix="jaxb-ri-${DSTAMP}/lib">
                <include name="xsom-src.zip"/>
            </zipfileset>
        </zip>

        <!-- test the generated source bundle -->
        <delete dir="${src.installer.tmp}" failonerror="false" />
        <mkdir dir="${src.installer.tmp}" />
        <unzip dest="${src.installer.tmp}" src="${src.installer.stage}/package.zip"/>
        <ant dir="${src.installer.tmp}/jaxb-ri-${DSTAMP}" inheritAll="false" inheritRefs="false"/>

        <!-- delete the srctmp dir -->
        <delete dir="${src.installer.tmp}"/>

        <!-- build installer -->
        <ant dir="tools/installer" />
        <ant dir="tools/installer-builder" />

        <taskdef name="installerBuilder" classname="com.sun.tools.xjc.installer.builder.BuilderTask">
            <classpath>
                <fileset dir="${jaxb.libs.util}" includes="*.jar"/>
            </classpath>
        </taskdef>

        <installerBuilder
          classFile="${src.installer.class}"
          licenseFile="${jaxb.root}/docs/license.txt"
          zipFile="${src.installer.stage}/package.zip" />

        <echo>source installer produced at ${src.installer.class}</echo>
    </target>

    <target name="installers"
            depends="bin-installer,src-installer"
            description="build both the binary and the source installer" />

    <!-- clean all of the builds -->
    <target name="clean"
            description="clean dist, build, and each sub-project">
        <parallel>
          <!-- clean dist, and srcbundle -->
          <delete dir="${jaxb.dist}" />
          <delete dir="${srcbundle.dist}" />
          <delete dir="j2se-integration" />

          <!-- clean sub-projects -->
          <ant dir="runtime"            target="clean" />
          <ant dir="runtime-fi"         target="clean" />
          <ant dir="runtime-staxex"     target="clean" />
          <ant dir="runtime-deprecated" target="clean" />
          <ant dir="xjc"                target="clean" />
          <ant dir="tools"              target="clean"/>
          <ant dir="apgen"              target="clean" />
          <ant dir="reflection"         target="clean" />
        </parallel>
    </target>


    <target name="check.os">
      <condition property="is.unix">
        <os family="unix"/>
      </condition>
    </target>

    <!-- assumes wspack target has been run -->
    <target name="create.pkg" depends="check.os" if="is.unix">
      <ant dir="pkg" target="deploy-pkg"/>
    </target>

    <!-- assumes wspack target has been run -->
    <target name="create.rpm" depends="check.os" if="is.unix">
      <ant dir="rpm" target="deploy-rpm"/>
    </target>

    <!-- assumes wspack target has been run -->
    <target name="create.hpux" depends="check.os" if="is.unix">
      <ant dir="hpux" target="deploy-hpux"/>
    </target>

    <!-- assumes dist or wspack target has been run -->
    <target name="create.zip" description="Create JAXB zip file distribution for JES">
      <!-- The zip build directory -->
      <property name="zip.build.dir"    value="${basedir}/build/zip"/>

      <!-- The zip distribution directory -->
      <property name="zip.release.dir"    value="${basedir}/zip-dist"/>

      <property name="zip.release"    value="1"/>
 
      <!-- make build and output directories -->
      <mkdir dir="${zip.build.dir}"/>
      <mkdir dir="${zip.release.dir}"/>

      <!-- copy files into the right directory structure -->
        <copy todir="${zip.build.dir}" overwrite="yes">
          <fileset dir="${basedir}/zip">
            <include name="filelist.txt"/>
            <include name="version"/>
          </fileset>
        </copy>
        <copy tofile="${zip.build.dir}/jaxb2/bin/xjc.bat"       file="${basedir}/tools/bin/xjc.zip.bat" />
        <copy tofile="${zip.build.dir}/jaxb2/bin/schemagen.bat" file="${basedir}/tools/bin/schemagen.zip.bat" />
        <copy todir="${zip.build.dir}/jaxb2/lib">
          <fileset dir="${jaxb.dist}/lib">
            <include name="jaxb-api.jar"/>
            <include name="jaxb-impl.jar"/>
            <include name="jaxb-xjc.jar"/>
            <include name="jaxb1-impl.jar"/>
          </fileset>
        </copy>

      <!-- replace parameters in version file  -->
      <replace file="${zip.build.dir}/version" value="${release.impl.version}">
        <replacetoken>@jaxb.version@</replacetoken>
      </replace>
      <!-- replace date stamp... 1st specify correct format  -->
      <tstamp>
        <format property="pkg.datestamp" pattern="yyyyMMdd"/>
      </tstamp>
      <replace file="${zip.build.dir}/version" value="${pkg.datestamp}">
        <replacetoken>@datestamp@</replacetoken>
      </replace>
      <replace file="${zip.build.dir}/version" value="${zip.release}">
        <replacetoken>@zip.release@</replacetoken>
      </replace>

      <!-- make zip file -->
      <zip destfile="${zip.release.dir}/jaxb2.zip" basedir="${zip.build.dir}" />
    </target>
    
    <target name="release-engineering"
            description="target for Sun RE builds"
            depends="src-zip,bin-installer,src-installer,licensee-zip" />


    <target name="project.dtd" description="create DTD for DTD-aware editing">
      <antstructure output="project.dtd"/>
    </target>


    <target name = "integrate-1.0-compiler"
            description="extract XJC 1.0">
      <mkdir dir="${xjc10.classes}"/>
      <unjar src="${jaxb.libs.compiler10}/jaxb1-xjc.jar" dest="${xjc10.classes}"/>
      <delete dir="${xjc10.classes}/META-INF/MANIFEST.MF"/>
    </target>


    <target name="integrate-fi">
      <get src="http://hudson.sfbay/job/fi-1.2/lastSuccessfulBuild/artifact/fi/FastInfoset/dist/FastInfoset.jar"
           dest="tools/lib/util/FastInfoset.jar" />
      <get src="http://hudson.sfbay/job/fi-1.2/lastSuccessfulBuild/artifact/fi/FastInfoset/dist/FastInfoset.src.zip"
           dest="tools/lib/src/FastInfoset.src.zip" />
    </target>

    <target name="integrate-dtdparser">
      <!--<get src="http://hudson.sfbay/job/dtd-parser/lastSuccessfulBuild/artifact/dtd-parser/dtd-parser/target/distributions/dtd-parser-1.0.zip"
           dest="tools/lib/rebundle/compiler/dtd-parser-1.0.jar" />-->
      <get src="http://hudson.sfbay/job/dtd-parser/lastSuccessfulBuild/artifact/dtd-parser/dtd-parser/target/distributions/dtd-parser-1.0-src.zip"
           dest="tools/lib/src/dtd-parser-1.0-src.zip" />
    </target>

    <target name="integrate-stax-ex-hudson"
            description="integrate the last successful stax-ex Hudson build">
      <get src="http://hudson.sfbay/job/stax-ex/lastSuccessfulBuild/artifact/stax-ex/stax-ex/target/stax-ex.jar"
           dest="tools/lib/util/stax-ex.jar" />
      <get src="http://hudson.sfbay/job/stax-ex/lastSuccessfulBuild/artifact/stax-ex/stax-ex/target/stax-ex-src.zip"
           dest="tools/lib/util/stax-ex-src.zip" />
    </target>

    <target name="integrate-api" description="Integrate JAXB 2.1 API from Hudson">
        <get src="http://hudson.sfbay/job/jsr222-mirror-2.1/lastSuccessfulBuild/artifact/jsr222-mirror/dist/jaxb-api.jar"
             dest="tools/lib/redist/jaxb-api.jar" />
        <get src="http://hudson.sfbay/job/jsr222-mirror-2.1/lastSuccessfulBuild/artifact/jsr222-mirror/dist/jaxb-api-src.zip"
             dest="tools/lib/redist/jaxb-api-src.zip" />
        <get src="http://hudson.sfbay/job/jsr222-mirror-2.1/lastSuccessfulBuild/artifact/jsr222-mirror/dist/jaxb-api-doc.zip"
             dest="tools/lib/redist/jaxb-api-doc.zip" />
    </target>

    <target name="integrate-xsom">
        <get src="http://hudson.sfbay/job/xsom/lastSuccessfulBuild/artifact/jaxb2-sources/xsom/build/xsom.jar"
             dest="tools/lib/rebundle/compiler/xsom.jar" />
        <get src="http://hudson.sfbay/job/xsom/lastSuccessfulBuild/artifact/jaxb2-sources/xsom/build/xsom-src.zip"
             dest="tools/lib/src/xsom-src.zip" />
    </target>

    <target name="integrate-maven-repository-importer">
        <get src="http://hudson.sfbay/job/maven-repository-importer/lastSuccessfulBuild/artifact/build/maven-repository-importer.jar"
             dest="tools/lib/util/maven-repository-importer.jar" />
    </target>

    <target name="integrate-txw2">
        <get src="http://hudson.sfbay/job/txw2/lastSuccessfulBuild/artifact/jaxb2-sources/txw2/build/txw2.jar"
             dest="tools/lib/rebundle/runtime2/txw2.jar" />
        <get src="http://hudson.sfbay/job/txw2/lastSuccessfulBuild/artifact/jaxb2-sources/txw2/build/txwc2.jar"
             dest="tools/lib/util/txwc2.jar" />
        <get src="http://hudson.sfbay/job/txw2/lastSuccessfulBuild/artifact/jaxb2-sources/txw2/build/txw2-src.zip"
             dest="tools/lib/src/txw2-src.zip" />
        <get src="http://hudson.sfbay/job/txw2/lastSuccessfulBuild/artifact/jaxb2-sources/txw2/build/txw2c-src.zip"
             dest="tools/lib/src/txw2c-src.zip" />
    </target>

    <target name="integrate-rngom">
        <get src="http://hudson.sfbay/job/rngom/lastSuccessfulBuild/artifact/rngom/rngom/build/rngom.jar"
             dest="tools/lib/rebundle/compiler/rngom.jar" />
        <get src="http://hudson.sfbay/job/rngom/lastSuccessfulBuild/artifact/rngom/rngom/build/rngom-src.zip"
             dest="tools/lib/src/rngom-src.zip" />
    </target>

    <target name="integrate-zehpyr">
        <get src="http://hudson.sfbay/job/zephyr/lastSuccessfulBuild/artifact/dist/sjsxp-1_0/sjsxp.jar"
             dest="tools/lib/util/sjsxp.jar" />
        <get src="http://hudson.sfbay/job/zephyr/lastSuccessfulBuild/artifact/dist/sjsxp-src-1_0.zip"
             dest="tools/lib/src/sjsxp-src.zip" />
    </target>

    <target name="integrate-istack-commons">
        <property name="istack.commons.runtime" value="http://hudson.sfbay/job/istack-commons/lastSuccessfulBuild/artifact/runtime/build" />
        <property name="istack.commons.tools" value="http://hudson.sfbay/job/istack-commons/lastSuccessfulBuild/artifact/tools/build" />
        <property name="istack.commons.test" value="http://hudson.sfbay/job/istack-commons/lastSuccessfulBuild/artifact/test/build" />

        <get src="${istack.commons.tools}/istack-commons-tools.jar"
             dest="tools/lib/rebundle/compiler/istack-commons-tools.jar" />
        <get src="${istack.commons.tools}/istack-commons-tools-src.zip"
             dest="tools/lib/src/istack-commons-tools-src.zip" />

        <get src="${istack.commons.runtime}/istack-commons-runtime.jar"
             dest="tools/lib/rebundle/runtime2/istack-commons-runtime.jar" />
        <get src="${istack.commons.runtime}/istack-commons-runtime-src.zip"
             dest="tools/lib/src/istack-commons-runtime-src.zip" />

      <get src="${istack.commons.test}/istack-commons-test.jar"
           dest="tools/lib/util/istack-commons-test.jar" />
      <get src="${istack.commons.test}/istack-commons-test-src.zip"
           dest="tools/lib/src/istack-commons-test-src.zip" />
    </target>

    <target name="integrate-package-rename-task">
        <get src="http://hudson.sfbay/job/package-rename-task/lastSuccessfulBuild/artifact/target/package-rename-task.jar"
             dest="tools/lib/util/package-rename-task.jar"/>
    </target>

    <target name="integrate-htmlmacro">
        <get src="http://hudson.sfbay/job/htmlmacro/lastSuccessfulBuild/artifact/htmlmacro/build/htmlmacro.zip"
             dest="build/htmlmacro.zip"/>
        <unzip src="build/htmlmacro.zip" dest="tools/htmlmacro">
          <patternset>
            <include name="htmlmacro.*" />
            <include name="tags/**/*" />
          </patternset>
        </unzip>
    </target>

    <target name="integrate-codemodel">
        <property name="codemodel-version" value="2.2-SNAPSHOT" />
        <get src="http://hudson.sfbay/job/codemodel/lastSuccessfulBuild/artifact/codemodel/codemodel/target/codemodel-${codemodel-version}.jar"
             dest="tools/lib/rebundle/compiler/codemodel.jar" />
        <get src="http://hudson.sfbay/job/codemodel/lastSuccessfulBuild/artifact/codemodel/codemodel-annotation-compiler/target/codemodel-annotation-compiler-${codemodel-version}.jar"
             dest="tools/lib/util/codemodel-annotation-compiler.jar" />
             
        <get src="http://hudson.sfbay/job/codemodel/lastSuccessfulBuild/artifact/codemodel/codemodel/target/codemodel-${codemodel-version}-sources.jar"
             dest="tools/lib/src/codemodel.src.zip" />
        <get src="http://hudson.sfbay/job/codemodel/lastSuccessfulBuild/artifact/codemodel/codemodel-annotation-compiler/target/codemodel-annotation-compiler-${codemodel-version}-sources.jar"
             dest="tools/lib/src/codemodel-annotation-compiler.src.zip" />

    </target>
    
    
</project>
Terms of Use; Privacy Policy; Copyright ©2013-2016 (revision 20160708.bf2ac18)
 
 
Close
loading
Please Confirm
Close