-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
94 lines (86 loc) · 3.21 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import play.sbt.routes.RoutesKeys
import sbt.Def
import scoverage.ScoverageKeys
import uk.gov.hmrc.versioning.SbtGitVersioning.autoImport.majorVersion
import uk.gov.hmrc.DefaultBuildSettings
lazy val appName: String = "income-tax-tailor-returns-frontend"
ThisBuild / majorVersion := 0
ThisBuild / scalaVersion := "2.13.12"
val excludedPackages: Seq[String] = Seq(
"<empty>",
"Reverse.*",
"uk.gov.hmrc.BuildInfo",
"app.*",
"prod.*",
".*Routes.*",
"testOnly.*",
"testOnlyDoNotUseInAppConf.*"
)
lazy val root = (project in file("."))
.enablePlugins(PlayScala, SbtDistributablesPlugin)
.disablePlugins(JUnitXmlReportPlugin) //Required to prevent https://github.com/scalatest/scalatest/issues/1427
.settings(inConfig(Test)(testSettings): _*)
.settings(ThisBuild / useSuperShell := false)
.settings(
name := appName,
RoutesKeys.routesImport ++= Seq(
"models._",
"uk.gov.hmrc.play.bootstrap.binders.RedirectUrl"
),
TwirlKeys.templateImports ++= Seq(
"config.FrontendAppConfig",
"play.twirl.api.HtmlFormat",
"play.twirl.api.HtmlFormat._",
"uk.gov.hmrc.govukfrontend.views.html.components._",
"uk.gov.hmrc.hmrcfrontend.views.html.components._",
"uk.gov.hmrc.hmrcfrontend.views.html.helpers._",
"uk.gov.hmrc.hmrcfrontend.views.config._",
"views.ViewUtils._",
"models.Mode",
"controllers.routes._",
"viewmodels.govuk.all._"
),
PlayKeys.playDefaultPort := 10007,
ScoverageKeys.coverageExcludedPackages := excludedPackages.mkString(";"),
ScoverageKeys.coverageExcludedFiles := "<empty>;Reverse.*;.*handlers.*;.*components.*;.*controllers.testonly.*" +
".*Routes.*;.*viewmodels.govuk.*;",
ScoverageKeys.coverageMinimumStmtTotal := 96,
ScoverageKeys.coverageFailOnMinimum := true,
ScoverageKeys.coverageHighlighting := true,
scalacOptions ++= Seq(
"-feature",
"-rootdir",
baseDirectory.value.getCanonicalPath,
"-Wconf:cat=deprecation:ws,cat=feature:ws,cat=optimizer:ws,src=target/.*:s"
),
libraryDependencies ++= AppDependencies(),
retrieveManaged := true,
resolvers ++= Seq(Resolver.jcenterRepo),
// concatenate js
Concat.groups := Seq(
"javascripts/application.js" ->
group(Seq(
"javascripts/app.js"
))
),
pipelineStages := Seq(digest),
Assets / pipelineStages := Seq(concat)
)
lazy val testSettings: Seq[Def.Setting[?]] = Seq(
fork := true,
javaOptions ++= Seq("-Dconfig.resource=test.application.conf", "-Dapplication.router=testOnlyDoNotUseInAppConf.Routes"),
unmanagedSourceDirectories.withRank(KeyRanks.Invisible) += baseDirectory.value / "test-utils"
)
lazy val itSettings = DefaultBuildSettings.itSettings() ++ Seq(
unmanagedSourceDirectories.withRank(KeyRanks.Invisible) := Seq(
baseDirectory.value / "it"
),
unmanagedResourceDirectories.withRank(KeyRanks.Invisible) := Seq(
baseDirectory.value / "it" / "resources"
)
)
lazy val it = project
.enablePlugins(PlayScala)
.dependsOn(root % "test->test") // the "test->test" allows reusing test code and test dependencies
.settings(testSettings ++ itSettings)
addCommandAlias("runAllChecks", "clean;compile;scalastyle;coverage;test;it/test;coverageReport")