Build Tool
You need to decide which build tool should manage your dependencies, compile and deploy your application and deliver your signed APKs. The most popular solutions are sbt and Gradle. Both tools have a community developed plugin for Scala on Android development.
Comparison
sbt (Android SDK Plugin for SBT) | Gradle (gradle-android-scala-plugin) | |
Mixed Scala and Java projects | Yes | Yes |
Linting (limited to bytecode) | Yes | No |
MultiDex | Yes | Yes |
ProGuard caching | Yes | Unknown |
Continuous compilation | Yes | No * |
Scala compiler plugins (e.g. macro paradise) | Yes | No * |
Custom annotation processing | No | No |
sbt and Gradle, and their respective plugins for Scala on Android, are reliable and mature tools. Pointing the finger on one of them and declaring it as the better choice is not possible from an objective point of view. Gradle on one hand is the default build system for Android. It works well with Android Studio and there is plenty of documentation for Android specific niceties. sbt on the other hand is the standard build tool for Scala. It is written in Scala and also configured by the user in this language. sbt comes with advanced features to leverage the capabilities of this ecosystem.
At the end of the day the choice of whether to use sbt or Gradle is a matter of taste and previous experiences. Measured by GitHub stars and commits, the Android SDK Plugin for SBT is the more popular tool. For this very reason, this documentation is focusing on sbt and contains several chapters that are specific to this setup. It is therefore advised to take the sbt path in order to follow further instructions.
Further reading
- Android SDK Plugin for SBT
"An easy-to-use sbt plugin for working with all Android projects"
- gradle-android-scala-plugin
"Adds Scala language support to official Gradle Android plugin"
- sbt vs. Gradle
A StackOverflow discussion
- The Ins and Outs of Gradle
An analysis of the Gradle build system and its integration with Android Studio