30 sbt plugins in 15 minutes

  • eugene yokota (@eed3si9n)

earldouglas/xsbt-web-plugin

An sbt plugin for building Scala Web applications

spray/sbt-revolver

  • Starting and stopping your application in the background of your interactive SBT shell
  • With JRebel sbt-revolver supports hot reloading
> re-start %args% --- %jvmArgs%

sbt/sbt-appengine

deploy your webapp to appengine using sbt.

> appengineDeploy

softprops/coffeescripted-sbt

pour some coffee for scala

> coffee

sbt/sbt-jshint-plugin

Allows jslint to be used from within sbt.

By default linting occurs as part of your project’s test task. Both src/main/assets/**/*.js and src/test/assets/**/*.js sources are linted.

sbt/sbt-man

Looks up scaladoc.

> man Traversable /:
[man] scala.collection.Traversable
[man] def /:[B](z: B)(op: (B ⇒ A ⇒ B)): B
[man] Applies a binary operator to a start value and all elements of this
collection, going left to right. Note: /: is alternate syntax for foldLeft;
z /: xs is the same as xs foldLeft z. Note: will not terminate for infinite-
sized collections. Note: might return different results for different runs,
unless the underlying collection type is ordered. or the operator is
associative and commutative. 

sbt/sbt-scalariform

sbt plugin adding support for source code formatting using Scalariform

ScalariformKeys.preferences := ScalariformKeys.preferences.value
  .setPreference(AlignSingleLineCaseStatements, true)
  .setPreference(DoubleIndentClassDeclaration, true)
  .setPreference(PreserveDanglingCloseParenthesis, true)

steppenwells/sbt-sh

plugin to run shell commands from within the sbt shell

> sh git status
# On branch master...

sbt/git

A GIT plugin for SBT

> git status
# On branch master...

softprops/sbt-growl-plugin

Growling sbt test results so you don’t have to

sbt/sbt-buildinfo

I know this because build.sbt knows this.

sourceGenerators in Compile <+= buildInfo

buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)

Generates

package hello

case object BuildInfo {
  val name = "helloworld"
  val version = "0.1-SNAPSHOT"
  val scalaVersion = "2.9.2"
  val sbtVersion = "0.12.0"
}

sbt/sbt-boilerplate

sbt plugin for generating scala.Tuple/Function related boilerplate code

[#def applyFunc[P1, R](input: Tuple1[P1], func: (P1) => R): R =
  func(input._1)#
]

This expands to:

def applyFunc[P1, R](input: Tuple1[P1], func: (P1) => R): R =
  func(input._1)
def applyFunc[P2, R](input: Tuple2[P2], func: (P2) => R): R =
  func(input._2)
def applyFunc[P3, R](input: Tuple3[P3], func: (P3) => R): R =
  func(input._3)
....

eed3si9n/scalaxb

scalaxb is an XML data binding tool for Scala.

sourceGenerators in Compile <+= scalaxb in Compile

sbt/sbt-site

Site generation for SBT

> previewSite

sbt/sbt-ghpages

ghpages support

> ghpagesPushSite

sbt/sbt-unidoc

sbt plugin to create a unified API document across projects

> unidoc
...
[info] Generating Scala API documentation for main sources to /unidoc-sample/target/scala-2.10/unidoc...
[info] Scala API documentation generation successful.

scoverage/sbt-scoverage

SBT plugin for scoverage

> clean
> scoverage:test

sbt/sbt-pom-reader

Translates xml -> awesome. Maven-ish support for sbt

sbt/sbt-pgp

PGP plugin for SBT 0.12+

> publishSigned

xerial/sbt-sonatype

publishing Scala/Java projects to the Maven central

> publishSigned
> sonatypeRelease

softprops/bintray-sbt

fresh packages delivered from your sbt console

> bintray::changeCredentials
> bintray::whoami
> publish

sbt/sbt-release

A release plugin for sbt

> release

sbt/sbt-proguard

Proguard sbt plugin

> proguard:proguard

sbt/sbt-assembly

Deploy fat JARs. Restart processes.

Pack your class files and all your dependencies into a single JAR file:

> assembly

sbt/sbt-native-packager

creates native packages:

> stage
> universal:package-zip-tarball
> universal:package-xz-tarball
> universal:package-bin
> windows:package-bin
> windows:package-msi
> debian:package-bin
> rpm:package-bin

sbt/sbt-osgi

sbt plugin for creating OSGi bundles

> osgiBundle

softprops/ls-sbt

a scala card catalog (http://ls.implicit.ly/)

> lsWriteVersion
> lsycn

pfn/android-sdk-plugin

An easy-to-use sbt plugin for working with all Android projects

> android:package

jrudolph/sbt-cross-building

Enable cross-building of sbt plugins

> ^ compile
> ^^0.11.0

scripted-plugin

Runs scripted test

> scripted

jrudolph/sbt-dependency-graph

sbt plugin to create a dependency graph for your project.

> dependency-graph
> dependency-tree
> dependency-license-info

rtimush/sbt-updates

SBT plugin that can check maven repositories for dependency updates

> dependency-updates
[info] Found 3 dependency updates for test-project
[info]   ch.qos.logback:logback-classic : 0.8   -> 0.8.1 -> 0.9.30 -> 1.0.13
[info]   org.scala-lang:scala-library   : 2.9.1 -> 2.9.3 -> 2.10.3
[info]   org.slf4j:slf4j-api            : 1.6.4 -> 1.6.6 -> 1.7.5

sbt/sbt-dirty-money

clean Ivy2 cache

> show cleanCacheFiles
> cleanCache
> show cleanLocalFiles
> cleanLocal
> cleanCache "net.databinder.dispatch" % "dispatch-json4s"