-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
74 lines (67 loc) · 2.92 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
import sbt.Keys._
import sbt.Tests.{Group, SubProcess}
import sbt._
import uk.gov.hmrc.DefaultBuildSettings
import uk.gov.hmrc.DefaultBuildSettings._
lazy val appName = "third-party-application"
lazy val playSettings: Seq[Setting[_]] = Seq.empty
ThisBuild / scalaVersion := "2.13.12"
ThisBuild / majorVersion := 0
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
lazy val microservice = Project(appName, file("."))
.enablePlugins(PlayScala, SbtDistributablesPlugin)
.disablePlugins(JUnitXmlReportPlugin)
.settings(playSettings: _*)
.settings(scalaSettings: _*)
.settings(defaultSettings(): _*)
.settings(ScoverageSettings())
.settings(
name := appName,
libraryDependencies ++= AppDependencies(),
retrieveManaged := true,
routesGenerator := InjectedRoutesGenerator,
scalacOptions += "-Wconf:src=routes/.*:s",
routesImport ++= Seq(
"uk.gov.hmrc.apiplatform.modules.common.domain.models._",
"uk.gov.hmrc.apiplatform.modules.applications.core.domain.models._",
"uk.gov.hmrc.apiplatform.modules.applications.submissions.domain.models._",
"uk.gov.hmrc.apiplatform.modules.submissions.domain.models._"
)
)
.settings(
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full)
)
.settings(
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-eT"),
Test / fork := false,
Test / unmanagedSourceDirectories ++= Seq(baseDirectory.value / "test", baseDirectory.value / "shared-test"),
Test / parallelExecution := false
)
.settings(
scalacOptions ++= Seq(
"-Wconf:cat=unused&src=views/.*\\.scala:s",
"-Wconf:cat=unused&src=.*RoutesPrefix\\.scala:s",
"-Wconf:cat=unused&src=.*Routes\\.scala:s",
"-Wconf:cat=unused&src=.*ReverseRoutes\\.scala:s"
)
)
lazy val it = (project in file("it"))
.enablePlugins(PlayScala)
.dependsOn(microservice % "test->test;compile->compile")
.settings(
name := "integration-tests",
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-eT"),
DefaultBuildSettings.itSettings()
)
Global / bloopAggregateSourceDependencies := true
commands ++= Seq(
Command.command("cleanAll") { state => "clean" :: "it/clean" :: state },
Command.command("fmtAll") { state => "scalafmtAll" :: "it/scalafmtAll" :: state },
Command.command("fixAll") { state => "scalafixAll" :: "it/scalafixAll" :: state },
Command.command("testAll") { state => "test" :: "it/test" :: state },
Command.command("run-all-tests") { state => "testAll" :: state },
Command.command("clean-and-test") { state => "cleanAll" :: "compile" :: "run-all-tests" :: state },
Command.command("pre-commit") { state => "cleanAll" :: "fmtAll" :: "fixAll" :: "coverage" :: "testAll" :: "coverageOff" :: "coverageAggregate" :: state }
)