-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
69 lines (61 loc) · 2.56 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
import scoverage.ScoverageKeys
import uk.gov.hmrc.DefaultBuildSettings.itSettings
val appName = "customs-data-store"
val silencerVersion = "1.7.14"
val bootstrapVersion = "9.0.0"
val scala3_3_3 = "3.3.3"
val testDirectory = "test"
val scalaStyleConfigFile = "scalastyle-config.xml"
val testScalaStyleConfigFile = "test-scalastyle-config.xml"
ThisBuild / majorVersion := 0
ThisBuild / scalaVersion := scala3_3_3
lazy val microservice = Project(appName, file("."))
.enablePlugins(play.sbt.PlayScala, SbtDistributablesPlugin)
.settings(
libraryDependencies ++= AppDependencies.compile ++ AppDependencies.test,
PlayKeys.playDefaultPort := 9893,
libraryDependencySchemes ++= Seq("org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always),
ScoverageKeys.coverageExcludedFiles := "<empty>;Reverse.*;.*filters.*;.*handlers.*;.*components.*;" +
".*javascript.*;.*Routes.*;.*GuiceInjector;" +
".*ControllerConfiguration;.*LanguageSwitchController;.*Scheduler",
ScoverageKeys.coverageMinimumStmtTotal := 98,
ScoverageKeys.coverageMinimumBranchTotal := 90,
ScoverageKeys.coverageFailOnMinimum := false,
ScoverageKeys.coverageHighlighting := true,
scalafmtDetailedError := true,
scalafmtPrintDiff := true,
scalafmtFailOnErrors := true,
scalacOptions := scalacOptions.value.diff(Seq("-Wunused:all")),
Test / scalacOptions ++= Seq(
"-Wunused:imports",
"-Wunused:params",
"-Wunused:implicits",
"-Wunused:explicits",
"-Wunused:privates"
),
libraryDependencies ++= Seq(
compilerPlugin(
"com.github.ghik" % "silencer-plugin" % silencerVersion
cross CrossVersion.for3Use2_13With("", ".12")
),
"com.github.ghik" % "silencer-lib" % silencerVersion % Provided
cross CrossVersion.for3Use2_13With("", ".12")
)
)
.settings(resolvers += Resolver.jcenterRepo)
.settings(Test / parallelExecution := false)
.settings(scalastyleSettings)
.disablePlugins(sbt.plugins.JUnitXmlReportPlugin)
lazy val scalastyleSettings = Seq(
scalastyleConfig := baseDirectory.value / scalaStyleConfigFile,
(Test / scalastyleConfig) := baseDirectory.value / testDirectory / testScalaStyleConfigFile
)
lazy val it = project
.enablePlugins(PlayScala)
.dependsOn(microservice % "test->test")
.settings(itSettings())
.settings(libraryDependencies ++= Seq("uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion % Test))
addCommandAlias(
"runAllChecks",
";clean;compile;coverage;test;it/test;scalafmtCheckAll;scalastyle;Test/scalastyle;coverageReport"
)