Source code file content

Revision: 7733

Use addOrReplace instead of add while adding RM headers. See JIRA issue WSIT-1675.
» Project Revision History

» Checkout URL

svn / tags / 1.6.1 / wsit / build-shared.xml

Size: 8324 bytes, 1 line
<?xml version="1.0"?>

<!--
 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.
-->

<project name="Metro shared build targets and macros">
    <description>Contains targets and macros that are used by more than one subproject.
                 See properties.xml for shared properties and paths.</description>
    
    <import file="properties.xml"/>

    <macrodef name="updateManifestWithVersion"
              description="updates a jar manifest file with the version information">
        <attribute name="file" />
        <attribute name="class-path" default="" />
        <sequential>
            <manifest mode="update" file="@{file}">
                <attribute name="Build-Id" value="${build.id}" />
                <attribute name="Build-Version" value="${build.version}" />
                <attribute name="Major-Version" value="${release.impl.version}" />
                <attribute name="Class-Path" value="@{class-path}" />
            </manifest>
        </sequential>
    </macrodef>
    
    <macrodef name="create-OSGi-bundle"
              description="Run the bnd tool on a JAR file">

        <attribute name="jarname"/>
        <attribute name="dist-image-dir" default="${dist.image.wsit.lib.dir}"/>
        <sequential>
            <taskdef resource="aQute/bnd/ant/taskdef.properties"
                     classpath="${bnd.jar}"/>
            <mkdir dir="${build.dir}/bnd"/>
            <copy file="${basedir}/etc/bnd/@{jarname}.bnd" todir="${build.dir}/bnd">
                <filterset>
                    <filter token="RELEASE_VERSION" value="${release.impl.version}"/>
                </filterset>
            </copy>
            <bnd classpath="../@{dist-image-dir}/@{jarname}.jar"
                 output="../${dist.image.wsit.v3.dir}"
                 files="${build.dir}/bnd/@{jarname}.bnd"/>
        </sequential>
    </macrodef>

    <target name="maven-tasks"
            description="Import the Ant tasks from the Maven 2 Antlib and define a default Maven 2 repository">
        <typedef resource="org/apache/maven/artifact/ant/antlib.xml">
            <classpath>
                <pathelement location="../etc/lib/maven-artifact-ant-2.0.4-dep.jar" />
            </classpath>
        </typedef>
        <remoteRepository id="maven.repository" url="http://www.ibiblio.org/maven2/"/>
    </target>
    
    <target name="pmd" depends="init, maven-tasks"
            description="Run PMD on all source code">
        <!-- Download PMD from Maven repository -->
        <dependencies pathId="pmd.classpath" useScope="runtime">
            <remoteRepository refid="maven.repository"/>
            <dependency groupId="pmd" artifactId="pmd" version="3.7"/>
        </dependencies>
        <typedef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
            <classpath refid="pmd.classpath"/>
        </typedef>
        <pmd targetjdk="${javac.target}">
            <ruleset>basic</ruleset>
            <ruleset>braces</ruleset>
            <ruleset>clone</ruleset>
            <ruleset>codesize</ruleset>
            <ruleset>coupling</ruleset>
            <ruleset>../wsit-design.xml</ruleset>
            <ruleset>finalizers</ruleset>
            <ruleset>imports</ruleset>
            <ruleset>logging-java</ruleset>
            <ruleset>../wsit-naming.xml</ruleset>
            <ruleset>optimizations</ruleset>
            <ruleset>strictexception</ruleset>
            <ruleset>strings</ruleset>
            <ruleset>sunsecure</ruleset>
            <ruleset>unusedcode</ruleset>
            <formatter type="html" toFile="${build.dir}/pmd.html"/>
            <fileset dir="${src.dir}">
                <include name="**/*.java"/> <!-- include all classes -->
                <!--include name="com/sun/xml/ws/policy/**/*.java"/--> <!-- include policy classes only -->
                
                <exclude name="**/tx/webservice/member/**/*.java"/> <!-- ignore generated tx code -->
            </fileset>
        </pmd>
    </target>
    
    <target name="findbugs.base" depends="init, maven-tasks, compile"
            description="Check out the findbugs task and define base properties">
        <!-- Download findbugs from Maven repository -->
        <dependencies pathId="findbugs.classpath"
                      useScope="runtime">
            <remoteRepository refid="maven.repository"/>
            <dependency groupId="net.sourceforge.findbugs"
                        artifactId="findbugs"
                        version="1.3.2"/>
        </dependencies>
        <typedef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
            <classpath refid="findbugs.classpath"/>
        </typedef>
        <!-- We need to pass a classpath property into the findbugs task             -->
        <!-- Convert the path that was created by the depencies task into a property -->
        <pathconvert property="findbugs.classpath">
            <path refid="findbugs.classpath"/>
        </pathconvert>
    </target>

    <target name="findbugs.html" depends="findbugs.base"
            description="Run findbugs and produce a HTML formatted result">
        <findbugs output="html" outputFile="${build.dir}/findbugs.html"
                  stylesheet="fancy.xsl"
                  classpath="${findbugs.classpath}"
                  jvmargs="-Xmx256m"
                  pluginlist="${user.home}/.m2/repository/net/sourceforge/findbugs/coreplugin/1.3.2/coreplugin-1.3.2.jar"
                  excludefilter="findbugs-exclude.xml">
            <class location="${build.classes.dir}"/>
            <auxClasspath>
                <path path="${run.classpath}"/>
            </auxClasspath>
            <sourcePath path="${src.dir}"/>
        </findbugs>
    </target>

    <target name="findbugs.xml" depends="findbugs.base"
            description="Run findbugs and produce a XML formatted result">
        <findbugs output="xml" outputFile="${build.dir}/findbugs.xml"
                  classpath="${findbugs.classpath}"
                  jvmargs="-Xmx256m"
                  pluginlist="${user.home}/.m2/repository/net/sourceforge/findbugs/coreplugin/1.3.2/coreplugin-1.3.2.jar"
                  excludefilter="findbugs-exclude.xml">
            <class location="${build.classes.dir}"/>
            <auxClasspath>
                <path path="${run.classpath}"/>
            </auxClasspath>
            <sourcePath path="${src.dir}"/>
        </findbugs>
    </target>

    <target name="findbugs" depends="findbugs.html"/>

</project>
Terms of Use; Privacy Policy; Copyright ©2013-2015 (revision 20150226.965aeb8)
 
 
Close
loading
Please Confirm
Close