Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster » How do you run findbugs in buckminster build?
How do you run findbugs in buckminster build? [message #771947] Wed, 28 December 2011 16:05 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 393
Registered: November 2009
Senior Member
Hello,

I want to run findbugs during buckminster build but not sure what is the best way to do it. I want to run findbugs only against my plugins, so do I execute findbugs ant task after build or after each of my plugins is build? How do you do it?

Thanks,
Alex
Re: How do you run findbugs in buckminster build? [message #772435 is a reply to message #771947] Thu, 29 December 2011 19:33 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 393
Registered: November 2009
Senior Member
I ended up doing the following, define a target that goes through plugins directory after buckminster build and call <findbugs> task for each jar that I am interested in analyzing:

       <target name="run_findbugs">
		<!-- run findbugs against asm-util -->
		<findbugs home="${findbugs.home}"
                output="xml:withMessages"
                timeout="90000000"
                reportLevel="experimental"
                workHard="true"
                effort="max"
                adjustExperimental="true"
                jvmargs="${jvmargs}"
                failOnError="true"
                outputFile="${findbugs.buckminster}/out.xml"
                projectName="Findbugs"
                debug="false">
			<class location="${plugin}" />
		</findbugs>
	</target>

	<target name="analyzePlugins">
		<mkdir dir="${findbugs.buckminster}"/>
		<for param="file">
			<path>
			 <fileset dir="${PATH_TO_PLUGINS_DIRECTORY">
					<include name="${SELECTOR}.**" />
				</fileset>
			</path>
			<sequential>
				<antcall target="run_findbugs">
					<param name="plugin" value="@{file}" />
				</antcall>
			</sequential>
		</for>
	</target>


This works, however for each analysis I get this set of errors:
[ant] The following classes needed for analysis were missing:
[ant]   org.eclipse.jface.action.Action
[ant]   org.eclipse.ui.cheatsheets.ICheatSheetAction
[ant]   org.eclipse.core.resources.IFile
[ant]   org.eclipse.ui.IWorkbenchWindow
[ant]   org.eclipse.core.resources.ResourcesPlugin
[ant]   org.eclipse.ui.PlatformUI
[ant]   org.eclipse.core.resources.IWorkspaceRoot
[ant]   org.eclipse.swt.widgets.Display
[ant]   org.eclipse.core.resources.IProject
[ant]   org.eclipse.core.resources.IWorkspace
[ant]   org.eclipse.ui.IWorkbenchPage
[ant]   org.eclipse.ui.IEditorPart
[ant]   org.eclipse.ui.ide.IDE
[ant]   org.eclipse.ui.PartInitException
[ant]   org.eclipse.ui.IWorkbench
[ant]   org.eclipse.ui.cheatsheets.ICheatSheetManager
[ant] Missing classes: 15
[ant] Calculating exit code...
[ant] Setting 'missing class' flag (2)
[ant] Exit code set to: 2
[ant] Java Result: 2

So dependencies are missing. I wonder if p2 or target platform can some how be referenced for finbugs.
Re: How do you run findbugs in buckminster build? [message #772779 is a reply to message #772435] Fri, 30 December 2011 15:08 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 393
Registered: November 2009
Senior Member
This is helpful http://spektom.blogspot.com/2010/11/run-findbugs-from-your-eclipse-rcp.html

[Updated on: Fri, 30 December 2011 15:34]

Report message to a moderator

Re: How do you run findbugs in buckminster build? [message #772849 is a reply to message #772779] Fri, 30 December 2011 19:18 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 393
Registered: November 2009
Senior Member
This is ant project I ended up with if anybody is interested http://pastebin.com/raw.php?i=rU68Ra1d

[Updated on: Fri, 30 December 2011 19:48]

Report message to a moderator

Re: How do you run findbugs in buckminster build? [message #772912 is a reply to message #772849] Fri, 30 December 2011 23:37 Go to previous message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3232
Registered: July 2009
Senior Member
Thanks for sharing all the work you've put into this. The recipe for a successful community is that people do exactly
that. Share experiences.

- thomas

On 2011-12-30 20:18, Alex Kravets wrote:
> This is a ant project I ended up with if anybody is interested http://pastebin.com/raw.php?i=rU68Ra1d
Previous Topic:Qualifier replacement when SCM is Git
Next Topic:Unwanted bundles in the final product (optional dependencies)
Goto Forum:
  


Current Time: Mon Dec 22 05:52:20 GMT 2014

Powered by FUDForum. Page generated in 0.01719 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software