-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
87 lines (82 loc) · 2.73 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
import play.sbt.routes.RoutesKeys
import sbt.Def
import uk.gov.hmrc.DefaultBuildSettings._
lazy val appName: String = "marginal-relief-calculator-frontend"
lazy val IntegrationTest = config("it") extend Test
lazy val root = (project in file("."))
.enablePlugins(PlayScala, SbtDistributablesPlugin)
.settings(
PlayKeys.playDefaultPort := 7101,
name := appName,
targetJvm := "jvm-11",
scalaVersion := "2.13.12",
majorVersion := 1,
scalacOptions ++= Seq(
"-feature",
"-Xlint:-byname-implicit",
"-Wconf:cat=unused&src=routes/.*:s",
"-Wconf:cat=unused-imports&src=target/.*:s"
)
)
.settings(inConfig(Test)(testSettings): _*)
.configs(IntegrationTest)
.settings(inConfig(IntegrationTest)(itSettings): _*)
.settings(
RoutesKeys.routesImport ++= Seq(
"models._",
"uk.gov.hmrc.play.bootstrap.binders.RedirectUrl"
),
TwirlKeys.templateImports ++= Seq(
"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._",
"views.ViewUtils._",
"models.Mode",
"controllers.routes._",
"viewmodels.govuk.All._"
),
libraryDependencies ++= AppDependencies(),
retrieveManaged := true,
resolvers ++= Seq(Resolver.jcenterRepo)
// concatenate js
)
.settings(
Concat.groups := Seq(
"javascripts/application.js" ->
group(
Seq(
"javascripts/app.js"
)
)
),
// prevent removal of unused code which generates warning errors due to use of third-party libs
// uglifyCompressOptions := Seq("unused=false", "dead_code=false"),
pipelineStages := Seq(digest),
// below line required to force asset pipeline to operate in dev rather than only prod
Assets / pipelineStages := Seq(
concat
)
// only compress files generated by concat
)
.settings(CodeCoverageSettings.settings: _*)
lazy val testSettings: Seq[Def.Setting[_]] = Defaults.testSettings ++ Seq(
fork := true,
javaOptions += "-Dconfig.resource=test.application.conf",
unmanagedSourceDirectories := Seq(
baseDirectory.value / "test",
baseDirectory.value / "test-utils"
),
unmanagedResourceDirectories := Seq(baseDirectory.value / "test" / "resources")
)
lazy val itSettings = Defaults.testSettings ++ Seq(
fork := true,
parallelExecution := false,
unmanagedSourceDirectories := Seq(
baseDirectory.value / "it"
),
unmanagedResourceDirectories := Seq(baseDirectory.value / "it" / "resources"),
javaOptions += "-Dconfig.resource=it.application.conf"
)
addCommandAlias("fmt", "scalafmt;scalafmtSbt;test:scalafmt;it:scalafmt")