forked from hmrc/hmrc-email-renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
56 lines (51 loc) · 2.17 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
import sbt.Tests.{ Group, SubProcess }
import sbt._
import uk.gov.hmrc.DefaultBuildSettings._
import uk.gov.hmrc.versioning.SbtGitVersioning.autoImport.majorVersion
val appName = "hmrc-email-renderer"
val appDependencies: Seq[ModuleID] = AppDependencies()
lazy val playSettings: Seq[Setting[_]] = Seq.empty
def oneForkedJvmPerTest(tests: Seq[TestDefinition]): Seq[Group] =
tests map { test =>
Group(test.name, Seq(test), SubProcess(ForkOptions().withRunJVMOptions(Vector(s"-Dtest.name=${test.name}"))))
}
lazy val microservice = Project(appName, file("."))
.enablePlugins(play.sbt.PlayScala, SbtAutoBuildPlugin, SbtGitVersioning, SbtDistributablesPlugin)
.disablePlugins(JUnitXmlReportPlugin) //Required to prevent https://github.com/scalatest/scalatest/issues/1427
.settings(majorVersion := 2)
.settings(playSettings: _*)
.settings(scalaSettings: _*)
.settings(defaultSettings(): _*)
.settings(
libraryDependencies ++= appDependencies,
scalaVersion := "2.13.8",
retrieveManaged := true,
scalacOptions ++= Seq(
// Silence unused warnings on Play `routes` and `twirl` files
"-Wconf:cat=unused-imports&src=.*routes.*:s",
"-Wconf:cat=unused-privates&src=.*routes.*:s",
"-Wconf:src=twirl/.*:s"
)
)
.configs(IntegrationTest)
.settings(inConfig(IntegrationTest)(Defaults.itSettings): _*)
.settings(
IntegrationTest / fork := false,
IntegrationTest / unmanagedSourceDirectories := (IntegrationTest / baseDirectory)(base => Seq(base / "it")).value,
addTestReportOption(IntegrationTest, "int-test-reports"),
IntegrationTest / testGrouping := oneForkedJvmPerTest((IntegrationTest / definedTests).value),
IntegrationTest / parallelExecution := false,
inConfig(IntegrationTest)(
scalafmtCoreSettings ++
Seq(
compile / compileInputs := Def.taskDyn {
val task = test in (resolvedScoped.value.scope in scalafmt.key)
val previousInputs = (compile / compileInputs).value
task.map(_ => previousInputs)
}.value
)
)
)
.settings(resolvers += Resolver.jcenterRepo)
.settings(routesGenerator := InjectedRoutesGenerator)
.settings(ScoverageSettings())