-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
executable file
·62 lines (56 loc) · 2.12 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
import uk.gov.hmrc.DefaultBuildSettings
import scoverage.ScoverageKeys
ThisBuild / majorVersion := 0
ThisBuild / scalaVersion := "2.13.14"
ThisBuild / excludeDependencies ++= Seq(
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Specifically affects play-json-extensions dependency
ExclusionRule(organization = "com.typesafe.play")
)
lazy val microservice = Project("alcohol-duty-returns", file("."))
.enablePlugins(play.sbt.PlayScala, SbtDistributablesPlugin)
.disablePlugins(JUnitXmlReportPlugin)
.settings(
libraryDependencies ++= AppDependencies.compile ++ AppDependencies.test,
// https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
// suppress warnings in generated routes files
scalacOptions += "-Wconf:src=routes/.*:s",
scalafmtOnCompile := true,
)
.settings(inConfig(Test)(testSettings): _*)
.settings(resolvers += Resolver.jcenterRepo)
.settings(
ScoverageKeys.coverageExcludedFiles := scoverageExcludedList.mkString(";"),
ScoverageKeys.coverageMinimumStmtTotal := 99,
ScoverageKeys.coverageFailOnMinimum := true,
ScoverageKeys.coverageHighlighting := true,
)
.settings(PlayKeys.playDefaultPort := 16001)
lazy val it = project
.enablePlugins(PlayScala)
.dependsOn(microservice % "test->test") // the "test->test" allows reusing test code and test dependencies
.settings(DefaultBuildSettings.itSettings())
.settings(libraryDependencies ++= AppDependencies.itDependencies)
.settings(
Test / parallelExecution := false,
Test / fork := true,
)
lazy val testSettings: Seq[Def.Setting[_]] = Seq(
unmanagedSourceDirectories += baseDirectory.value / "test-utils"
)
lazy val scoverageExcludedList: Seq[String] = Seq(
"<empty>",
"Reverse.*",
".*handlers.*",
"uk.gov.hmrc.BuildInfo",
"app.*",
".*SchemaValidationService.*",
"prod.*",
".*Routes.*",
"testOnly.*",
".*testOnly.*",
".*TestOnlyController.*",
"testOnlyDoNotUseInAppConf.*",
".*config.*"
)
addCommandAlias("runAllChecks", ";clean;compile;scalafmtCheckAll;coverage;test;it/test;scalastyle;coverageReport")