findbugs-import.xml
author Jan Lahoda <jlahoda@netbeans.org>
Sat, 25 Aug 2012 08:06:43 +0200
branchremote-usages-to-find-usages
changeset 858 610a3830e451
parent 772 85bb885bccd9
permissions -rw-r--r--
Merging changes between remote-usages-to-find-usages heads
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <!--
     3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4 
     5 Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
     6 
     7 
     8 The contents of this file are subject to the terms of either the GNU
     9 General Public License Version 2 only ("GPL") or the Common
    10 Development and Distribution License("CDDL") (collectively, the
    11 "License"). You may not use this file except in compliance with the
    12 License. You can obtain a copy of the License at
    13 http://www.netbeans.org/cddl-gplv2.html
    14 or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    15 specific language governing permissions and limitations under the
    16 License.  When distributing the software, include this License Header
    17 Notice in each file and include the License file at
    18 nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    19 particular file as subject to the "Classpath" exception as provided
    20 by Sun in the GPL Version 2 section of the License file that
    21 accompanied this code. If applicable, add the following below the
    22 License Header, with the fields enclosed by brackets [] replaced by
    23 your own identifying information:
    24 "Portions Copyrighted [year] [name of copyright owner]"
    25 
    26 Contributor(s):
    27 
    28 The Original Software is NetBeans. The Initial Developer of the Original
    29 Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun
    30 Microsystems, Inc. All Rights Reserved.
    31 
    32 If you wish your version of this file to be governed by only the CDDL
    33 or only the GPL Version 2, indicate your decision by adding
    34 "[Contributor] elects to include this software in this distribution
    35 under the [CDDL or GPL Version 2] license." If you do not indicate a
    36 single choice of license, a recipient has the option to distribute
    37 your version of this file under either the CDDL, the GPL Version 2 or
    38 to extend the choice of license to its licensees as provided above.
    39 However, if you add GPL Version 2 code and therefore, elected the GPL
    40 Version 2 license, then the option applies only if the new code is
    41 made subject to such option by the copyright holder.
    42 -->
    43 <project name="findbugs" basedir=".">
    44 
    45     <property name="bootclasspath.prepend" value="${nbplatform.active.dir}/java/modules/ext/nb-javac-api.jar" />
    46 
    47     <target name="findbugs-init" depends="build-init">       
    48         <property name="findbugs.home" location="${suite.dir}/external/findbugs"/>
    49         <ant dir="${findbugs.home}" inheritall="false"/>
    50     </target>
    51     
    52     <target name="findbugs" depends="build-init,jar,findbugs-init">
    53         <property name="report.dir" location="${suite.dir}/build/findbugs"/>
    54         <mkdir dir="${report.dir}"/>
    55         <property name="report.file" location="${report.dir}/${code.name.base.dashes}.xml"/>
    56         <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${findbugs.home}/lib/findbugs-ant.jar"/>
    57 
    58         <path id="findbugs.class.path.ref">
    59             <path path="${module.run.classpath}"/>
    60             <path path="${cp.extra}"/>
    61             <path path="${cluster}/${module.jar}"/>
    62         </path>
    63         <pathconvert refid="findbugs.class.path.ref" property="findbugs.class.path"/>
    64 
    65         <echo>Findbugs module: ${code.name.base.dashes}</echo>
    66         <findbugs home="${findbugs.home}"
    67               output="xml"
    68               outputFile="${report.file}"
    69               failOnError="true"
    70               jvmargs="-Xmx256m">
    71             <auxClasspath path="${findbugs.class.path}" />
    72             <sourcePath path="${src.dir}" />
    73             <class location="${build.classes.dir}" />
    74         </findbugs>
    75         <condition property="findbugs.error" value="true">
    76             <isfileselected file="${report.file}">
    77                 <size value="0"/>
    78             </isfileselected>
    79         </condition>
    80         <antcall target="findbugs.delete"/>
    81     </target>
    82     
    83     <target name="findbugs.delete" if="findbugs.error">
    84         <delete file="${report.file}" failonerror="false"/>
    85     </target>
    86 
    87     <target name="-prepare-scripted-tests" depends="-check-scripted-tests" if="has.scripted.tests">
    88         <mkdir dir="build/test/scripted" />
    89         <copy todir="build/test/scripted">
    90             <fileset dir="test/scripted"/>
    91         </copy>
    92         <copy todir="build/test/scripted">
    93             <fileset dir="../test/scripted"/>
    94         </copy>
    95         <chmod dir="build/test/scripted" perm="u+x" includes="**/*" />
    96     </target>
    97     
    98     <target name="-check-scripted-tests" depends="build-init">
    99         <condition property="has.scripted.tests" value="true">
   100             <available file="test/scripted/config" />
   101         </condition>
   102     </target>
   103     
   104     <target name="-jackpot-check-cp-exists" depends="init">
   105         <condition property="jackpot.cp.defined">
   106             <isreference refid="cp"/>
   107         </condition>
   108     </target>
   109     
   110     <target name="jackpot" depends="init,-jackpot-check-cp-exists" if="jackpot.cp.defined">
   111 	<fail unless="jackpot.home">${jackpot.home} must be specified</fail>
   112         <taskdef name="jackpot" classname="org.netbeans.modules.jackpot30.cmdline.ant.JackpotTask" classpath="${jackpot.home}/jackpot-ant.jar"/>
   113 
   114         <echo>Running Jackpot on module: ${code.name.base.dashes}</echo>
   115         <jackpot jackpotHome="${jackpot.home}" source="${javac.source}">
   116             <src>
   117                 <pathelement path="${src.dir}" />
   118             </src>
   119             <classpath>
   120                 <path refid="cp"/>
   121             </classpath>
   122         </jackpot>
   123     </target>
   124 </project>