-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.sbt
More file actions
73 lines (65 loc) · 2.41 KB
/
build.sbt
File metadata and controls
73 lines (65 loc) · 2.41 KB
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
import Dependencies._
import sbt.Keys.{libraryDependencies, organization, parallelExecution}
import scoverage.ScoverageKeys.coverageFailOnMinimum
// https://github.com/scala/scala
ThisBuild / scalaVersion := "2.13.8"
inThisBuild(
List(
organization := "io.bartholomews",
homepage := Some(url("https://github.com/batholomews/spotify4s")),
licenses += ("MIT", url("https://opensource.org/licenses/MIT")),
developers := List(
Developer(
"bartholomews",
"Federico Bartolomei",
"spotify4s@bartholomews.io",
url("https://bartholomews.io")
)
)
)
)
val commonSettings = Seq(
// TODO move options in a plugin
scalacOptions += "-Ymacro-annotations", // https://github.com/circe/circe/issues/975
// http://www.scalatest.org/user_guide/using_scalatest_with_sbt
Test / logBuffered := false,
Test / parallelExecution := false,
resolvers +=
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)
lazy val core = (project in file("modules/core"))
.settings(
commonSettings,
name := "spotify4s-core",
libraryDependencies ++= dependencies ++ testDependencies,
coverageMinimumStmtTotal := 68,
coverageFailOnMinimum := true
)
lazy val circe = (project in file("modules/circe"))
.dependsOn(core % "test->test; compile->compile")
.settings(commonSettings)
.settings(
name := "spotify4s-circe",
libraryDependencies ++= circeDependencies,
coverageMinimumStmtTotal := 86,
coverageFailOnMinimum := true
)
lazy val play = (project in file("modules/play"))
.dependsOn(core % "test->test; compile->compile")
.settings(commonSettings)
.settings(
name := "spotify4s-play",
libraryDependencies ++= playDependencies,
coverageMinimumStmtTotal := 79,
coverageFailOnMinimum := true
)
def sequentially(cmd: String) = s";core/$cmd;circe/$cmd;play/$cmd"
// https://www.scala-sbt.org/1.x/docs/Multi-Project.html
// https://stackoverflow.com/questions/11899723/how-to-turn-off-parallel-execution-of-tests-for-multi-project-builds
lazy val spotify4s = (project in file("."))
.settings(commonSettings)
.settings(addCommandAlias("test", sequentially("test")): _*)
.settings(addCommandAlias("test-fast", sequentially("testOnly * -- -l org.scalatest.tags.Slow")): _*)
.settings(publish / skip := true)
.aggregate(core, circe, play)
addCommandAlias("test-coverage", ";clean ;coverage ;test ;coverageAggregate")