> Hi,
>
> I've just converted my FindBugs sbt plugin from sbt 0.7.x to sbt
> 0.10.x by looking at the existing plugins referenced in the sbt wiki,
> and also by reading the wiki (and the sbt source, sometimes). - Now,
> my initial tests show that the plugin should work.
>
> However, I'm still not sure at all if what I did is the correct way to
> write a plugin for the new sbt... - so I'd appreciate a lot if anyone
> could perhaps take a look at my code and tell me what's good and
> what's bad, or what's "idiomatic" for sbt 0.10.x and what's plain
> stupid... - I've got a feeling that I've done a few stupid things
> because I don't know the new sbt well enough yet. For example, the
> error handling in my command line executor looks like a hack. How
> should tasks do their error handling?
Sure, I'll take a look, but it might be a for a few days. Remind me if you don't hear back in the next week.
> Also: Should I use packages for my classes at all?
Yes. Think of plugins as libraries for your build.
> I already know that tests against my plugin are missing: I'm not sure
> how to best test more than a few trivial things concerning my plugin.
> However, I haven't yet looked at how other plugin coders do their
> testing.
Generally, the scripted plugin is the easiest, although it is more functional testing than unit testing. You can see how Artyom does it in the web plugin:
https://github.com/siasia/xsbt-web-plugin/
> My plugin adds a task named "findbugs" which calls the FindBugs static
> code analysis (only useful for Java code, of course). This task has a
> few settings, like the output path for the results, or how to format
> the FindBugs report. - You can find it at https://bitbucket.org/jmhofer/findbugs4sbt
>
> Thanks in advance for any input!
I didn't see you link to your writeup here, so I'll add it:
http://jmhofer.johoop.de/?p=210
I'll try to remember to add some comments there as well when I get a chance.
-Mark