-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
88 lines (65 loc) · 3.19 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Slightly complicated build file for use with pfn's excellent
// Android Scala sbt plugin.
//
// Please see here for details:
// https://github.com/pfn/android-sdk-plugin/blob/master/README.md
import android.Keys._
android.Plugin.androidBuild
organization := "lucoodevcourse"
name := "clickcounter-android-akka"
version := "0.2"
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
javacOptions ++= Seq("-target", "1.6", "-source", "1.6") // so we can build with Java 7 or 8
scalacOptions in Compile ++= Seq("-feature", "-unchecked", "-deprecation")
platformTarget in Android := "android-19"
libraryDependencies ++= Seq(
"org.robolectric" % "robolectric" % "2.3" % "test",
"junit" % "junit" % "4.11" % "test",
"org.scalamock" %% "scalamock-scalatest-support" % "3.2" % "test",
"org.scalatest" %% "scalatest" % "2.2.1" % "test",
"com.typesafe.akka" %% "akka-actor" % "2.3.7"
)
val androidJars = (platformJars in Android, baseDirectory) map {
(j, b) => Seq(Attributed.blank(b / "bin" / "classes"), Attributed.blank(file(j._1)))
}
// Make the actually targeted Android jars available to Robolectric for shadowing.
managedClasspath in Test <++= androidJars
// With this option, we cannot have dependencies in the test scope!
debugIncludesTests in Android := false
exportJars in Test := false
// Supress warnings so that Proguard will do its job.
proguardOptions in Android ++= Seq(
"-dontwarn android.test.**",
"-dontwarn sun.misc.Unsafe"
)
// Proguard rules for Akka
proguardOptions in Android ++= Seq(
"-keep class akka.actor.Actor$class { *; }",
"-keep class akka.actor.LightArrayRevolverScheduler { *; }",
"-keep class akka.actor.LocalActorRefProvider { *; }",
"-keep class akka.actor.CreatorFunctionConsumer { *; }",
"-keep class akka.actor.TypedCreatorFunctionConsumer { *; }",
"-keep class akka.dispatch.BoundedDequeBasedMessageQueueSemantics { *; }",
"-keep class akka.dispatch.UnboundedMessageQueueSemantics { *; }",
"-keep class akka.dispatch.UnboundedDequeBasedMessageQueueSemantics { *; }",
"-keep class akka.dispatch.DequeBasedMessageQueueSemantics { *; }",
"-keep class akka.dispatch.MultipleConsumerSemantics { *; }",
"-keep class akka.actor.LocalActorRefProvider$Guardian { *; }",
"-keep class akka.actor.LocalActorRefProvider$SystemGuardian { *; }",
"-keep class akka.dispatch.UnboundedMailbox { *; }",
"-keep class akka.actor.DefaultSupervisorStrategy { *; }",
"-keep class macroid.akkafragments.AkkaAndroidLogger { *; }",
"-keep class akka.event.Logging$LogExt { *; }"
)
// Required so Proguard won't remove the actual instrumentation tests.
proguardOptions in Android ++= Seq(
"-keep public class * extends junit.framework.TestCase",
"-keepclassmembers class * extends junit.framework.TestCase { *; }"
)
apkbuildExcludes in Android += "LICENSE.txt"
// The next few lines will work only with sbt-scoverage version 0.99.7.1.
// Do not update until sbt-scoverage 1.0 stabilizes!
instrumentSettings
ScoverageKeys.excludedPackages in ScoverageCompile := """.*\.TR.*;.*\.TypedLayoutInflater;.*\.TypedResource;.*\.TypedViewHolder;.*\.TypedLayoutInflater"""
org.scoverage.coveralls.CoverallsPlugin.coverallsSettings
managedClasspath in ScoverageCompile <++= androidJars