Library projects
The Android SDK Plugin for SBT allows you to package your code in the *.aar
apklib iformat.
Configuration
To enable library project packaging, the sbt project definition needs to be adjusted as follows.
import android.Plugin._
object Build extends sbt.Buil
{
val main = Project( "my-aar-project", file( "." ), settings = androidBuildAar )
.settings(
organization := "com.example",
version := "1.0.0"
)
}
You are now able to publish the project locally via sbt publishLocal
. This allows you to reference the application as an sbt library dependency via "com.example" %% "my-aar-project" % "1.0.0"
on your development machine. To make it publicly available, the sbt-sonatype plugin provides a convenient deployment process.
Further reading
- sbt-sonatype
GitHub repository