Commits

Jan Lahoda committed fbb6692

Findbugs support.

Comments (0)

Files changed (11)

 ^nbproject/private$
 ^nbbuild$
 ^.ditz-config$
-
+^external$
 <project name="org.netbeans.modules.jackpot30.api" default="netbeans" basedir=".">
     <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.api.</description>
     <import file="nbproject/build-impl.xml"/>
+    <import file="${suite.dir}/findbugs-import.xml"/>
 </project>

borrowedtests/build.xml

 <project name="org.netbeans.modules.jackpot30.test.borrowed" default="netbeans" basedir=".">
     <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.test.borrowed.</description>
     <import file="nbproject/build-impl.xml"/>
+    <import file="${suite.dir}/findbugs-import.xml"/>
 
     <target name="test" />
     <target name="test-coverage" />
 <project name="jackpot30" basedir=".">
     <description>Builds the module suite jackpot30.</description>
     <import file="nbproject/build-impl.xml"/>
+    
+    <target name="findbugs" depends="-init">
+        <subant target="findbugs" buildpath="${modules}" inheritall="false"/>
+    </target>
+    
 </project>
 <project name="org.netbeans.modules.jackpot30.code" default="netbeans" basedir=".">
     <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.code.</description>
     <import file="nbproject/build-impl.xml"/>
+    <import file="${suite.dir}/findbugs-import.xml"/>
 </project>

external/findbugs/build.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 1997-2009 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
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. 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
+nbbuild/licenses/CDDL-GPL-2-CP.  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):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun
+Microsystems, Inc. All Rights Reserved.
+
+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 do not 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 basedir="." default="findbugs" name="external/findbugs">
+    
+    <description>Prepares FindBugs libraries</description>
+    
+<!--    <property name="nbroot" value="../../.."/>-->
+    
+    <!-- findbugs.jar checksum -->
+    <property name="findbugs.md5" value="e53fd07dec19607139665c89206797a6"/>
+    
+<!--    <import file="${nbroot}/nbbuild/templates/projectized.xml"/>-->
+
+    <target name="findbugs-init">
+        
+        <condition property="findbugs.downloaded">
+            <and>
+                <available file="lib/annotations.jar"/>
+                <available file="lib/findbugs.jar"/>
+                <available file="lib/jsr305.jar"/>
+                
+                <checksum file="lib/findbugs.jar" property="${findbugs.md5}"/>
+            </and>
+        </condition>
+        
+        <property name="findbugs.name" value="findbugs-1.3.7"/>
+        
+        <property name="lib.dir" location="lib"/>
+        <property name="plugin.dir" location="plugin"/>
+        <property name="build.dir" location="build"/>
+        <property name="binary.zip" location="findbugs-1.3.7.zip"/>
+    </target>
+    
+<!--    <target name="findbugs" depends="findbugs-init,findbugs-clean,-init-proxy" unless="findbugs.downloaded">-->
+    <target name="findbugs" depends="findbugs-init,findbugs-clean" unless="findbugs.downloaded">
+        
+        <echo>Preparing FindBugs libraries...</echo>
+        
+        <get dest="${binary.zip}"
+                src="http://surfnet.dl.sourceforge.net/sourceforge/findbugs/findbugs-1.3.7.zip"/>
+        
+        <mkdir dir="${build.dir}"/>
+        <unzip src="${binary.zip}" dest="${build.dir}"/>
+        
+        <mkdir dir="${lib.dir}"/>
+        <copy todir="${lib.dir}" overwrite="true">
+            <fileset dir="${build.dir}/${findbugs.name}/lib">
+                <include name="annotations.jar"/>
+                <include name="asm-3.1.jar"/>
+                <include name="asm-analysis-3.1.jar"/>
+                <include name="asm-commons-3.1.jar"/>
+                <include name="asm-tree-3.1.jar"/>
+                <include name="asm-util-3.1.jar"/>
+                <include name="asm-xml-3.1.jar"/>
+                <include name="commons-lang-2.4.jar"/>
+                <include name="bcel.jar"/>
+                <include name="dom4j-1.6.1.jar"/>
+                <include name="findbugs.jar"/>
+                <include name="findbugs-ant.jar"/>
+                <include name="jaxen-1.1.1.jar"/>
+                <include name="jFormatString.jar"/>
+                <include name="jsr305.jar"/>
+            </fileset>
+        </copy>
+        
+        <mkdir dir="${plugin.dir}"/>
+        <copy todir="${plugin.dir}" overwrite="true">
+            <fileset dir="${build.dir}/${findbugs.name}/plugin">
+                <include name="coreplugin.jar"/>
+            </fileset>
+        </copy>        
+        
+        <delete file="${binary.zip}"/>
+        <delete dir="${build.dir}"/>
+    </target>
+   
+    <target name="findbugs-clean" depends="findbugs-init" unless="findbugs.downloaded">
+        <delete dir="${lib.dir}"/>
+        <delete dir="${plugin.dir}"/>
+        <delete dir="${build.dir}"/>
+        <delete file="${binary.zip}"/>
+    </target>
+    
+</project>
 <project name="org.netbeans.modules.jackpot30.file" default="netbeans" basedir=".">
     <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.file.</description>
     <import file="nbproject/build-impl.xml"/>
+    <import file="${suite.dir}/findbugs-import.xml"/>
 </project>

findbugs-import.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 1997-2009 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
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. 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
+nbbuild/licenses/CDDL-GPL-2-CP.  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):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun
+Microsystems, Inc. All Rights Reserved.
+
+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 do not 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="findbugs" basedir=".">
+
+    <target name="findbugs-init" depends="build-init">       
+        <property name="findbugs.home" location="${suite.dir}/external/findbugs"/>
+        <ant dir="${findbugs.home}" inheritall="false"/>
+    </target>
+    
+    <target name="findbugs" depends="build-init,jar,findbugs-init">
+        <property name="report.dir" location="${suite.dir}/build/findbugs"/>
+        <mkdir dir="${report.dir}"/>
+        <property name="report.file" location="${report.dir}/${code.name.base.dashes}.xml"/>
+        <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${findbugs.home}/lib/findbugs-ant.jar"/>
+
+        <path id="findbugs.class.path.ref">
+            <path path="${module.run.classpath}"/>
+            <path path="${cp.extra}"/>
+            <path path="${cluster}/${module.jar}"/>
+        </path>
+        <pathconvert refid="findbugs.class.path.ref" property="findbugs.class.path"/>
+
+        <echo>Findbugs module: ${code.name.base.dashes}</echo>
+        <findbugs home="${findbugs.home}"
+              output="xml"
+              outputFile="${report.file}"
+              failOnError="true"
+              jvmargs="-Xmx256m">
+            <auxClasspath path="${findbugs.class.path}" />
+            <sourcePath path="${src.dir}" />
+            <class location="${build.classes.dir}" />
+        </findbugs>
+        <condition property="findbugs.error" value="true">
+            <isfileselected file="${report.file}">
+                <size value="0"/>
+            </isfileselected>
+        </condition>
+        <antcall target="findbugs.delete"/>
+    </target>
+    
+    <target name="findbugs.delete" if="findbugs.error">
+        <delete file="${report.file}" failonerror="false"/>
+    </target>
+
+</project>

hintsimpl/build.xml

 <project name="org.netbeans.modules.jackpot30.hintsimpl" default="netbeans" basedir=".">
     <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.hintsimpl.</description>
     <import file="nbproject/build-impl.xml"/>
+    <import file="${suite.dir}/findbugs-import.xml"/>
     <target name="test-coverage" />
     <target name="coverage-report" />
 </project>
 ant -Ddist.base=$DIST_BASE -Dnbplatform.default.harness.dir=$PWD/nbbuild/netbeans/harness -Dnbplatform.default.netbeans.dest.dir=$PWD/nbbuild/netbeans nbms || exit
 gzip <build/updates/updates.xml >build/updates/updates.xml.gz
 
+ant -Ddist.base=$DIST_BASE -Dnbplatform.default.harness.dir=$PWD/nbbuild/netbeans/harness -Dnbplatform.default.netbeans.dest.dir=$PWD/nbbuild/netbeans findbugs || exit
+
 echo -e '--- !ditz.rubyforge.org,2008-03-06/config\nissue_dir: issues' >.ditz-config
 ditz html build/issues

transformer/build.xml

 <project name="org.netbeans.modules.jackpot30.transformers" default="netbeans" basedir=".">
     <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.transformers.</description>
     <import file="nbproject/build-impl.xml"/>
+    <import file="${suite.dir}/findbugs-import.xml"/>
 </project>