Skip to content

Instantly share code, notes, and snippets.

@jvliwanag
Created July 10, 2014 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvliwanag/30c94dd7fdbc09230792 to your computer and use it in GitHub Desktop.
Save jvliwanag/30c94dd7fdbc09230792 to your computer and use it in GitHub Desktop.
sample android build.sbt
import android.Keys._
android.Plugin.androidBuild
name := "zap-android"
scalaVersion := "2.11.0"
platformTarget in Android := "android-14"
useProguard in Android := true
proguardCache in Android ++= Seq(
ProguardCache("org.scaloid") % "org.scaloid"
)
proguardOptions in Android ++= Seq(
"-keep public class zap2.user.android.** { public protected *; }",
// Play - http://developer.android.com/google/play-services/setup.html#Proguard
"-keep class * extends java.util.ListResourceBundle { protected Object[][] getContents(); }",
"-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { " +
"public static final *** NULL; }",
"-keepnames @com.google.android.gms.common.annotation.KeepName class *",
"-keepclassmembernames class * { @com.google.android.gms.common.annotation.KeepName *; }",
"-keepnames class * implements android.os.Parcelable { public static final ** CREATOR; }",
"-dontwarn com.google.android.gms.**"
)
libraryDependencies ++= Seq(
"org.scaloid" %% "scaloid" % "3.4-10",
"com.squareup" % "otto" % "1.3.5",
"com.android.support" % "support-v4" % "19.1.0",
"com.google.android.gms" % "play-services" % "4.4.52")
apkbuildExcludes in Android ++= Seq("META-INF/DEPENDENCIES",
"META-INF/NOTICE",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/NOTICE.txt")
scalacOptions in Compile ++= Seq("-feature", "-language:postfixOps")
// call install and run without having to prefix with android:
run <<= run in Android
install <<= install in Android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment