Scala on Android

The comprehensive documentation

  • Information reliability Sustainable Won't become outdated
  • Last edit Sat Aug 29 13:30:02 2015 +0200
  • Edit on GitHub

Library projects

The Android SDK Plugin for SBT allows you to package your code in the *.aar apklib iformat.

  • Information reliability Sustainable Won't become outdated
  • Last edit Sat Aug 29 13:35:00 2015 +0200
  • Edit on GitHub

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

Comments