Skip to content

Instantly share code, notes, and snippets.

@pfn
Created October 18, 2013 22:39
Show Gist options
  • Save pfn/7049299 to your computer and use it in GitHub Desktop.
Save pfn/7049299 to your computer and use it in GitHub Desktop.
example build.sbt for a single project with many library projects
import android.Keys._
android.Plugin.androidBuild
name := "project-with-lib-projects"
unmanagedClasspath in Compile <<= ( baseDirectory
, unmanagedClasspath in Compile) map {
(base,cp) =>
val ignores = Set("android-support-v4.jar", "guava-14.0.1.jar")
(cp filterNot (c => ignores(c.data.getName))) ++ Seq(
Attributed.blank(base / "libs" / "android-support-v4.jar"),
Attributed.blank(base / "libs" / "guava-14.0.1.jar")
)
}
proguardConfig in Android ~= { pc => "-dontwarn com.google.common.**" +:
pc filterNot { _ contains "jsr305" }}
commands += Command.command("proguard")(st => {
val extracted = Project.extract(st)
Project.runTask(packageT in Android,
extracted.append(Seq(
useProguard in Android := true,
useProguardInDebug in Android := true
), st)
)
st
})
run <<= run in Android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment