DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > A few short notes on converting SBT plugins to 0.10.x

A few short notes on converting SBT plugins to 0.10.x

Joachim Hofer user avatar by
Joachim Hofer
·
Jun. 11, 11 · Java Zone · Interview
Like (0)
Save
Tweet
4.46K Views

Join the DZone community and get the full member experience.

Join For Free

I just finished converting my FindBugs SBT plugin “findbugs4sbt“ to SBT 0.10.x.

FindBugs? What’s that? – Go have a look at its website, and then use it, always! One caveat though: It doesn’t support Scala source code. So use it with all your Java projects.

SBT? What’s that? – It’s a Scala-based build tool called “Simple Build Tool”, and it’s cool. Have a look at it and try it out!

Anyway, if you already know about SBT and think about moving over to the new 0.10.x version, or if you even think about hacking your own plugin for it (please do!), the following quick notes may be of interest to you…

  • Read the SBT wiki page about plugins first. It’s not perfect, but it’s a good start, and you could always help improving it.
  • SBT 0.10.x has changed so much that it’s a rewrite, mostly. Give up your hope of “simply converting” your plugin.
  • However, the new settings system seems well thought-out. Forget the trait- and override-based system of 0.7.x. You know you want to.
  • You want to take a look at this SBT source file. Believe me. You just don’t know yet that you do. Knowing the settings keys is absolutely vital for hacking plugins.
  • Take a good long look at all the existing plugins‘ source code. They’re all doing different things in different ways, and all in all, there’s a lot to learn from them.
  • Quick, learn the difference between SBT tasks and commands. In my humble opinion, task plugins are probably easier to write than command plugins.
  • Don’t be afraid to read and ask questions in the SBT Google Group.
  • Don’t use SBT 0.9.9. It’s the one slow version of SBT, and I used it for most of my plugin conversion, so that you don’t have to, too. :)
  • Please don’t put everything into one plugin source file. There are other people out there who want to learn how to create their own SBT plugins, and they want to be able to read and understand your code.
  • Browse the SBT API documentation and use the stuff that’s already in there. It’s a lot, even if it’s perhaps not so easy to find your way around in there (at least it hasn’t been for me).
  • Maybe, you want to consider comparing the sbt-0.7.x and the default branch of my findbugs4sbt plugin, if you want to convert something task-based and are after a “before” vs “after” comparison.

So there you have it, a few of my insignificant and unordered plugin conversion impressions. I hope you’ve had fun reading them.

 

From http://jmhofer.johoop.de/?p=210

IT

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • The Importance of Semantics for Data Lakehouses
  • 3 Reasons Why You Should Centralize Developer Tools, Processes, and People
  • Common Types Of Network Security Vulnerabilities In 2022
  • How Low Code Demands More Creativity From Developers

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo