4 ms·
One of my responsibilities on a medium-sized Scala team was managing the builds. Naturally, this meant learning the wonderful world of SBT. SBT is the "Simple
by chickenbane 10y ago
One of my responsibilities on a medium-sized Scala team was managing the builds. Naturally, this meant learning the
wonderful world of SBT. SBT is the "Simple Build Tool", but it's misnamed; in a way, I think SBT is the quintessential
Scala program:
* SBT features its own DSL (Scala is, after all, the Scalable Language), which also includes infuriating operators such
as "<++="
* There's a affinity towards elegance at the expense of basic understandability. A good example to illustrate this is
the design of SBT is recursive; that is, your SBT build is an SBT program that must be built before your program is
built. Then you may write a meta-SBT-build program to build your SBT build, and so on. I'm very sure SBT developers
are quite proud of this architecture, but my team members universally thought this was pointless and confusing.
* It's slow, and trying to speed it up is an engineering spike in and of itself.
* As Scala doesn't bother to maintain binary compatibility across point releases, the SBT and plugin ecosystem has to
use an older version of Scala. So now your SBT plugin code is probably using a different compiler than your
Scala application code.
* In exchange for the steep learning curve, you are rewarded with a powerful feature set that was definitely
innovative: incremental, parallel, and continuous builds, a REPL, a great SBT plugin community, etc.
After learning and using Make, Maven, and now Gradle, I have mainly learned one lesson: never write a build system.
- rdubz 10y agopost author here, this is good perspective, thanks. * The "<++=" operators are much-maligned but I've seen them ~0 times in 6 months; I may have come in to SBT-land just as they were being finally phased out, I think I did see them in the beginning a bit. * Agreed that the recursiveness of the build is presented somewhat confusingly and navel-gazingly! * Speed-wise, I imagine you're talking about reloading projects, either in the SBT CLI or IntelliJ? That's pretty fair, I've had to adjust my IJ workflow a bit to not trigger full-project-refreshes as often (e.g. disabling auto-import). If you're talking about e.g. compilation or other tasks being slow, I'd be surprised and interested to hear more, though. * re: SBT plugins being stuck on 2.10, I was also a bit daunted to read that early on, but at this point I've written several SBT plugins and it's basically never been an issue or introduced any friction; curious to hear if it's caused problems for you. * Agreed that there is a steep learning curve and some payoff that reasonable people may value differently, and also to not write a build system :)
- merb 10y ago`<++=` is deprecated and will be removed.