Source code file content

Revision: 7631

new version of management-api published proper maven source bundle
» Project Revision History

» Checkout URL

svn / tags / 1.6.1 / wsit / build.xml

Size: 23350 bytes, 1 line
<?xml version="1.0" encoding="UTF-8"?>

<!--
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
 Copyright 1997-2008 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.
-->

<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="WSIT" default="main" basedir=".">
    <description>Builds, tests, and runs the project WSIT.</description>
    <import file="nbproject/build-impl.xml"/>
    <import file="properties.xml"/>

    <taskdef name="installerBuilder"
        classname="com.sun.tools.xjc.installer.builder.BuilderTask">
        <classpath>
            <fileset dir="${etc.lib.dir}" includes="installer-builder.jar, sfx4j-1.0.jar"/>
        </classpath>
    </taskdef>

    <target name="-do-jar-without-manifest" depends="image, bundle">
        <mkdir dir="${dist.dir}"/>
        <zip basedir="${dist.image.dir}" destfile="${dist.dir}/${install.name}.zip"/>
        <installerBuilder classFile="${dist.dir}/${install.name}-installer.jar" licenseFile="LICENSE.txt" zipFile="${dist.dir}/${install.name}.zip"/>
    </target>
    
    <target name="installer">
        <installerBuilder classFile="${dist.dir}/${install.name}-installer.jar" licenseFile="LICENSE.txt" zipFile="${dist.dir}/${install.name}.zip"/>
    </target>

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

    <target name="main" depends="dist"
        description="Create the wsit tool and runtime jars and installers."/>
    
    <target name="bundle" depends="init, image"
            description="Create the Metro OSGi bundle for GlassFish V3.">

        <taskdef resource="aQute/bnd/ant/taskdef.properties"
                 classpath="${bnd.jar}"/>

        <mkdir dir="${build.dir}/bnd"/>
        <copy file="${basedir}/etc/bnd/webservices.bnd" todir="${build.dir}/bnd">
            <filterset>
                <filter token="RELEASE_VERSION" value="${release.impl.version}"/>
            </filterset>
        </copy>
        
        <mkdir dir="${dist.image.wsit.v3.dir}"/>
        <bnd classpath="rt/${osgi.build.dir}/webservices-api.jar, rt/${osgi.build.dir}/webservices-rt.jar, tools/${osgi.build.dir}/webservices-tools.jar"
             failok="false"
             output="${dist.image.wsit.v3.dir}/webservices.jar"
             files="${build.dir}/bnd/webservices.bnd"/>

        <copy todir="${dist.image.wsit.v3.dir}">
            <fileset dir="${lib.osgi.dir}">
                <include name="*.jar"/>
            </fileset>
        </copy>
    </target>
    
    <target name="image" description="Create the Metro tool and runtime jars.">
        <filter token="release.impl.version" value="${release.impl.version}"/>
        <filter token="release.impl.version.suffix" value="${release.impl.version.suffix}"/>
        <copy todir="${dist.image.wsit.dir}" filtering="true">
            <fileset dir="${basedir}" includes="CDDL*.*"/>
            <fileset dir="${basedir}" includes="LICENSE.txt"/>
            <fileset dir="${etc.dir}" includes="metro-on-*.*"/>
        </copy>
        <generate-release-notes target="${dist.image.wsit.dir}/docs"/>
        <!-- generate samples -->
        <unzip src="lib/jaxws-samples.zip" dest="${dist.image.wsit.dir}/samples" />
        <replace dir="${dist.image.wsit.dir}/samples">
            <replacefilter token="env.JAXWS_HOME" value="env.METRO_HOME" />
        </replace>
        <!-- copy over shell scripts -->
        <unzip src="lib/jaxws-bin.zip" dest="${dist.image.wsit.dir}/bin" />
        <replace dir="${dist.image.wsit.dir}/bin">
            <replacefilter token="JAXWS_HOME" value="METRO_HOME" />
            <replacefilter token="jaxws-tools.jar" value="webservices-tools.jar" />
        </replace>
    </target>
    
    <target name="-javadoc-build" depends="init"/>
    
    <target name="src-zip">
        <ant dir="${rt.dir}" target="src-zip"/>
        <ant dir="${tools.dir}" target="src-zip"/>
    </target>
    
    <macrodef name="integrate-jaxws">
        
        <attribute name="jaxws.base.url"/>
        
        <sequential>
            
            <!-- JAX-WS 2.1 JARs -->

            <!-- Unzip the JARs -->
            <delete dir="${tmpdir}"/>
            <mkdir dir="${tmpdir}"/>
            <get src="@{jaxws.base.url}/artifact/jax-ws-sources/jaxws-ri/build/jaxws-ri.zip"
                    dest="${tmpdir}/jaxws-ri.zip"/>
            <unzip src="${tmpdir}/jaxws-ri.zip" dest="${tmpdir}"/>

            <!-- unzip the JAR source zips -->
            <get src="@{jaxws.base.url}/artifact/jax-ws-sources/jaxws-ri/build/jaxws-libs.src.zip"
                    dest="${tmpdir}/jaxws-libs.src.zip"/>
            <unzip src="${tmpdir}/jaxws-libs.src.zip" dest="${tmpdir}"/>

            <!-- copy to relevant directories -->
            <copy todir="${lib.runtime.dir}" overwrite="true" verbose="${verbose}">
                <fileset dir="${tmpdir}/jaxws-ri/lib" includes="*.jar" excludes="jaxb-xjc.*, *-tools.*"/>
                <fileset dir="${tmpdir}" includes="*.zip" excludes="jaxb-xjc.*, *-tools.*"/>
            </copy>
            <copy todir="${lib.tooltime.dir}" overwrite="true" verbose="${verbose}">
                <fileset dir="${tmpdir}/jaxws-ri/lib" includes="jaxb-xjc.*, *-tools.*"/>
                <fileset dir="${tmpdir}" includes="jaxb-xjc.*, *-tools.*"/>
            </copy>
            <zip file="lib/jaxws-samples.zip">
                <fileset dir="${tmpdir}/jaxws-ri/samples" />
            </zip>
            <zip file="lib/jaxws-bin.zip">
                <fileset dir="${tmpdir}/jaxws-ri/bin" />
            </zip>

            <!-- retrieve the JAX-WS source zips -->
            <get src="@{jaxws.base.url}/artifact/jax-ws-sources/jaxws-ri/dist/jaxws-ri/lib/jaxws-rt.src.zip"
                    dest="${lib.runtime.dir}/jaxws-rt.src.zip"/>
            <get src="@{jaxws.base.url}/artifact/jax-ws-sources/jaxws-ri/dist/jaxws-ri/lib/jaxws-tools.src.zip"
                    dest="${lib.tooltime.dir}/jaxws-tools.src.zip"/>

            <!-- Local transport JAR and Source -->
            <get src="@{jaxws.base.url}/artifact/jax-ws-sources/jaxws-ri/transports/local/build/jaxws-local-transport.jar"
                    dest="${lib.runtime.dir}/jaxws-local-transport.jar"/>
            <get src="@{jaxws.base.url}/artifact/jax-ws-sources/jaxws-ri/transports/local/build/jaxws-local-transport-src.zip"
                    dest="${lib.runtime.dir}/jaxws-local-transport-src.zip"/>
            
            <!-- release notes source -->
            <get src="@{jaxws.base.url}/artifact/jax-ws-sources/jaxws-ri/build/release-notes-src.zip"
                    dest="lib/releasenotes/release-notes-src.zip"/>
        </sequential>
        
    </macrodef>

    <target name="integrate-jaxws-hudson"
            description="integrates latest JAX-WS 2.1.8 bits in WSIT, meant for internal consumption only">

        <integrate-jaxws jaxws.base.url="http://hudson-sca.us.oracle.com/job/jaxws-ri-2.1.8/lastSuccessfulBuild"/>
        
    </target>

    <target name="integrate-jaxws-bleedingedge-hudson"
            description="integrates latest JAX-WS 2.1.3 bleedingedge bits in WSIT, meant for internal consumption only">
                
        <integrate-jaxws jaxws.base.url="http://hudson-sca.us.oracle.com/job/jaxws-2.1.x-bleedingedge/lastSuccessfulBuild"/>
        
    </target>
    
    <target name="integrate-jaxb-osgi-hudson"
        description="integrates latest JAXB 2.x OSGi bundle for GlassFish V3">
        <get src="http://hudson-sca.us.oracle.com/job/jaxb-ri-2.1/793/artifact/jaxb2-sources/jaxb-ri/osgi/build/jaxb-osgi.jar"
             dest="${lib.osgi.dir}/jaxb.jar" />
    </target>

    <target name="integrate-xwss30-hudson"
            description="integrate the last successful XWSS 3.0 Hudson build">
        <get src="http://hudson-sca.us.oracle.com/job/XWSS30-METRO-1_4-BRANCH/lastSuccessfulBuild/artifact/xwss/xwss-ri/dist/wsit/lib/xws-security.jar"
             dest="lib/runtime/xws-security.jar" />
        <get src="http://hudson-sca.us.oracle.com/job/XWSS30-METRO-1_4-BRANCH/lastSuccessfulBuild/artifact/xwss/xwss-ri/dist/wsit/xws-security.src.zip"
             dest="lib/runtime/xws-security.src.zip" />
    </target>

    <target name="integrate-jaxrpc"
            description="integrate the last successful jaxrpc with jcaps fixes build">
        <get src="http://hudson-sca.us.oracle.com/job/jaxrpc-caps6-branch/lastSuccessfulBuild/artifact/build/lib/jaxrpc-impl.jar"
             dest="lib/runtime/jaxrpc-impl.jar" />
        <get src="http://hudson-sca.us.oracle.com/job/jaxrpc-caps6-branch/lastSuccessfulBuild/artifact/build/lib/jaxrpc-spi.jar"
             dest="lib/runtime/jaxrpc-spi.jar" />
    </target>
    
    <target name="integrate-policy-hudson"
            description="integrates the last successful policy Hudson build">
                
        <get src="http://hudson-sca.us.oracle.com/job/policy-core_METRO-1_6-BRANCH/4/artifact/target/policy.jar"
             dest="${basedir}/lib/runtime/policy.jar" />
        <get src="http://hudson-sca.us.oracle.com/job/policy-core_METRO-1_6-BRANCH/4/artifact/target/policy-src.zip"
             dest="${basedir}/lib/runtime/policy-src.zip" />
        
    </target>

    <target name="runtests">
        <ant antfile="run-ql-tests.xml"/>
    </target>

    <target name="create-wsit-integration-zip" depends="dist, src-zip"
            description="Create an archive dist/metro-integration/metro-integration.zip
                that contains all libraries and their source code that go into the Metro
                stack. Right now this target is not entirely accomplishing this task
                and only bundles the combined webservices-*.jar instead of the individual
                libraries that went into these jars.">
        <property name="metro.integration.dir" value="${dist.dir}/metro-integration"/>
        <delete dir="${dist.dir}/metro-integration" quiet="true"/>
        <mkdir dir="${dist.dir}/metro-integration"/>

        <copy todir="${metro.integration.dir}" >
            <fileset dir="${dist.image.wsit.lib.dir}"/>
        </copy>
        <copy todir="${metro.integration.dir}" >
            <fileset dir="${rt.dir}/build">
                <include name="*src.zip"/>
            </fileset>
        </copy>
        <copy todir="${metro.integration.dir}" >
            <fileset dir="${tools.dir}/build/">
                <include name="*src.zip"/>
            </fileset>
        </copy>
        <copy todir="${metro.integration.dir}">
            <fileset dir="${lib.runtime.dir}">
                <include name="xws-security.jar"/>
                <include name="trust-jaxbbindings.jar"/>
                <include name="secconv-jaxbbindings.jar"/>
            </fileset>
        </copy>
        <zip destfile="${metro.integration.dir}/metro-integration.zip">
            <fileset dir="${metro.integration.dir}"/>
        </zip>
    </target>
    
    <target name="-post-compile-test"
            description="Run unit tests of dependent projects">
        <ant dir="${rt.dir}"
             target="test"
             inheritAll="false"/>
    </target>

    <target name="integrate-htmlmacro-hudson"
            description="integrate the last successful htmlmacro Hudson build">
        <get
          src="http://hudson-sca.us.oracle.com/job/htmlmacro/lastSuccessfulBuild/artifact/htmlmacro/build/htmlmacro.zip"
          dest="${lib.releasenotes.dir}/htmlmacro.zip"/>
        <mkdir dir="${lib.releasenotes.dir}/htmlmacro"/>
        <unzip src="${lib.releasenotes.dir}/htmlmacro.zip" dest="${lib.releasenotes.dir}/htmlmacro"/>
        <copy todir="${lib.releasenotes.dir}" overwrite="true">
            <fileset dir="${lib.releasenotes.dir}/htmlmacro/" includes="*.zip,*.jar"/>
        </copy>
        <delete dir="${lib.releasenotes.dir}/htmlmacro"/>
        <delete file="${lib.releasenotes.dir}/htmlmacro.zip"/>
    </target>

    <macrodef name="generate-release-notes">
        <attribute name="target" /><!-- where to put the generated docs? -->
        <sequential>
            <mkdir dir="@{target}"/>
            <copy todir="@{target}">
                <fileset dir="docs/releasenotes" includes="style/*, Copyright.txt" />
            </copy>
            <taskdef name="htmlmacro" classname="com.sun.wts.tools.htmlmacro.HtmlMacroTask">
                <classpath>
                    <fileset dir="lib/releasenotes" />
                </classpath>
            </taskdef>
            <mkdir dir="build/release-notes-src"/>
            <unzip src="lib/releasenotes/release-notes-src.zip" dest="build/release-notes-src"/>
            <copy todir="build/release-notes-src" overwrite="true">
                <fileset dir="docs/releasenotes" />
            </copy>
            <htmlmacro destdir="@{target}">
                <documents dir="build/release-notes-src" includes="*.html" />
                <tags dir="docs/releasenotes/tags" includes="**/*.tag" />
                <property key="IMPL_VERSION" value="${release.impl.version}"/>
                <property key="UNDERSCORE_VERSION" value="${release.underscore.version}" />
                <property key="IMPL_VERSION_SUFFIX" value="${release.impl.version.suffix}"/>
                <property key="DATE" value="${DSTAMP}"/>
                <!-- Product name so that we can switch between JAX-WS RI and Metro -->
                <property key="PRODUCT_SHORT_NAME" value="Metro"/>
                <property key="PRODUCT_NAME" value="Metro ${release.impl.version} ${release.impl.version.suffix}"/>
                <!-- Used in various places to refer to installation dir -->
                <property key="HOME" value="METRO_HOME" />
            </htmlmacro>
        </sequential>
    </macrodef>
    
    <target name="test-docs"
            description="Generate documentation. Useful for checking the output during authoring">
        <generate-release-notes target="build/releasenotes"/>
    </target>


    

    <target name="generate-bundle-for-licensee" depends="init">
        <property name="wsit.ws.dir" value="${basedir}"/>
        <property name="source.drop.dir" value="build/source-bundle"/>
        <property name="source.dist.dir.name" value="wsit-sourcebundle-${BUILD_TAG}"/>


        <property name="ws.source.dir" value="${source.drop.dir}"/>
        <echo message="wsit.ws.dir => ${wsit.ws.dir}" />
        <echo message="ws.source.dir => ${ws.source.dir}" />
        <mkdir dir="${ws.source.dir}" />
        <delete dir="${ws.source.dir}" />

        <echo message="Copying wsit sources"/>
        <mkdir dir="${ws.source.dir}/wsit/rt" />

        <copy todir="${ws.source.dir}/wsit" file ="${wsit.ws.dir}/build.xml"/>
        <copy todir="${ws.source.dir}/wsit" file ="${wsit.ws.dir}/properties.xml"/>
        <copy todir="${ws.source.dir}/wsit/rt">
            <fileset dir="${wsit.ws.dir}/rt"/>
        </copy>

        <copy todir="${ws.source.dir}/wsit/tools">
            <fileset dir="${wsit.ws.dir}/tools"/>
        </copy>

        <copy todir="${ws.source.dir}/wsit/lib/">
            <fileset dir="${wsit.ws.dir}/lib"/>
        </copy>

        <copy todir="${ws.source.dir}/wsit/docs">
            <fileset dir="${wsit.ws.dir}/docs"/>
        </copy>


        <copy todir="${ws.source.dir}/wsit">
            <fileset dir="${wsit.ws.dir}">
                <include name="*.html"/>
                <include name="*.txt"/>
            </fileset>
        </copy>
         
        <copy todir="${ws.source.dir}/wsit/nbproject">
            <fileset dir="${wsit.ws.dir}/nbproject"/>
        </copy>
        <copy todir="${ws.source.dir}/wsit/etc">
            <fileset dir="${wsit.ws.dir}/etc"/>
        </copy>
        <delete>
            <fileset dir="${wsit.ws.dir}" includes="**/CVS" />
        </delete>


        <zip destfile="${source.drop.dir}/wsit-licensee-bundle.zip"
              basedir="${ws.source.dir}"
                 />
    </target>

   

    <target name="push-to-maven-prepare" depends="dist">
        <taskdef resource="maven-repository-importer.properties">
            <classpath>
                <pathelement path="${etc.lib.dir}/maven-repository-importer-1.0.jar" />
            </classpath>
        </taskdef>
        <delete dir="build/maven-repo" /><!-- clean it -->
        <maven-repository-importer destdir="build/maven-repo" version="1.2-SNAPSHOT">
            <artifact jar="${dist.image.wsit.lib.dir}/webservices-api.jar"  pom="webservices-api.pom"  />
            <!--This is taken from dist.image.wsit.v3.dir because we decided for TP2
                to have webservices-rt without jaxrpc-spi and jaxrpc-impl.jar
            -->
            <artifact jar="${dist.image.wsit.v3.dir}/webservices-rt.jar"  pom="webservices-rt.pom"  />
            <artifact jar="${dist.image.wsit.lib.dir}/webservices-tools.jar"  pom="webservices-tools.pom"  />
        </maven-repository-importer>
    </target>

    <target name="push-to-maven" depends="push-to-maven-prepare">
        <!-- import to CVS-->
        <tstamp />
        <echo>importing to CVS...</echo>
        <cvs dest="build/maven-repo">
            <commandline>
                <argument value="-d:pserver:${user.name}@java-net-cvs:/cvs" />
                <argument line="-z9 import -ko -W *.jar -kb -m" />
                <argument value="deploying new jars to the java.net maven repository" />

                <argument value="metro/repo" />
                <argument line="deployment-to-maven-repository t${DSTAMP}${TSTAMP}" />
            </commandline>
        </cvs>
    </target>

    <target name="package-for-hk2" depends="dist">
        <!-- run it with "-Dmaven-target=deploy" to deploy to the repository -->
        <!-- run it with "-Dmaven-target=deploy -DupdateReleaseInfo=true" to deploy releases -->
        <property name="maven-target" value="install" />
        <property name="mavendir" value="maven-hk2"/>
        <property name="webservices.rt.target.dir" value="${mavendir}/webservices-rt/target/classes"/>
        <property name="webservices.api.target.dir" value="${mavendir}/webservices-api/target/classes"/>
        <property name="webservices.tools.target.dir" value="${mavendir}/webservices-tools/target/classes"/>

        <mkdir dir="${webservices.rt.target.dir}"/>
        <mkdir dir="${webservices.api.target.dir}"/>
        <mkdir dir="${webservices.tools.target.dir}"/>

        <unjar src="${dist.image.wsit.v3.dir}/webservices-rt.jar"
            dest="${webservices.rt.target.dir}"/>
        <unjar src="${dist.image.wsit.lib.dir}/webservices-api.jar"
            dest="${webservices.api.target.dir}"/>
        <unjar src="${dist.image.wsit.lib.dir}/webservices-tools.jar"
            dest="${webservices.tools.target.dir}"/>

        <exec command="mvn -U ${maven-target}" dir="maven-hk2" />
    </target>
   
    <!-- 

    GLASSFISH UPDATE CENTER SCRIPTS
    
    Prerequisities:
    1. install latest Update Center v2.x Toolkit (http://wiki.updatecenter.java.net/Wiki.jsp?page=Download) into <wsit-sandbox>/ext/pkg-toolkit
    2. Setup the Pyhton environment:
        cd <wsit-sandbox>
        export PKG_TOOLKIT_DIR=ext/pkg-toolkit
        PYTHONPATH=$PKG_TOOLKIT_DIR/pkg/vendor-packages:$PKG_TOOLKIT_DIR/pkg/bin:`pwd`
        export PYTHONPATH
    3. cd to <wsit-sandbox> directory (if not already there)
    4. update module.revision property value in this build.xml
    4. run the uc2 ant target
    ===============

    -->

    <target name="-set-uc2-properties" description="Sets properties needed for UC2 push">
        <property name="module.dir" value="${basedir}/ucmodule/glassfish/modules"/>
        <property name="metro.hudson.job.name" value="wsit-javanet" />
        <loadresource property="metro.hudson.pushed.build.number">
            <url url="http://hudson-sca.us.oracle.com/job/${metro.hudson.job.name}/lastSuccessfulBuild/buildNumber" />
        </loadresource>
        <property name="module.revision" value="3" />

        <property environment="env" />
        <property name="uc2.repo" value="http://eflat.sfbay.sun.com:60000"/>
    </target>

    <target name="-clean-uc2" description="Clean UC related things">
        <delete dir="${basedir}/ucmodule"/>
    </target>
    
    <target name="prepare-uc2" depends="-clean-uc2, -set-uc2-properties" description="Prepare GlassFish Update Center Module">
        <mkdir dir="${module.dir}"/>
      
        <get src="file://${user.home}/sandbox/java.net/metro-1_5/dist/image/metro/for_v3/jaxb.jar"
      dest="${module.dir}/jaxb.jar" />
        <get src="file://${user.home}/sandbox/java.net/metro-1_5/dist/image/metro/for_v3/webservices.jar"
      dest="${module.dir}/webservices.jar" />
        <get src="file://${user.home}/dev/glassfish/glassfishv3-prelude/glassfish/modules/jsr109-impl.jar"
      dest="${module.dir}/jsr109-impl.jar" />

        <copy file="${basedir}/LICENSE.txt" toFile="${module.dir}/Metro-LICENSE.txt" />
        
    </target>
    
    <target name="publish-uc2" depends="-set-uc2-properties">
        <echo message="Publishing Metro ${release.impl.version},0-${module.revision} to UC2 at ${uc2.repo}" />
        <exec executable="python">
            <arg line="ext/pkg-toolkit/pkg/bin/makepkgs.py -s ${uc2.repo} -v ${release.impl.version},0-${module.revision} -b ${basedir}/ucmodule uc2"/>
            <!--arg line="ext/pkg-toolkit/pkg/bin/makepkgs.py -s ${uc2.repo} -b ${basedir}/ucmodule uc2"/-->
        </exec>
    </target>
    
    <target name="uc2" depends="prepare-uc2,publish-uc2" />
</project>
Terms of Use; Privacy Policy; Copyright ©2013-2015 (revision 20150626.29986a4)
 
 
Close
loading
Please Confirm
Close