-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
80 lines (77 loc) · 2.88 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
import play.sbt.routes.RoutesKeys
import play.sbt.PlayImport.PlayKeys
import sbt.Keys._
import sbt._
import scoverage.ScoverageKeys
import uk.gov.hmrc.DefaultBuildSettings._
lazy val appName: String = "pension-administrator-frontend"
lazy val root = (project in file("."))
.disablePlugins(JUnitXmlReportPlugin)
.enablePlugins(play.sbt.PlayScala, SbtDistributablesPlugin)
.settings(scalaSettings: _*)
.settings(defaultSettings(): _*)
.settings(inConfig(Test)(testSettings): _*)
.settings(scalaVersion := "2.13.12")
.settings(
scalacOptions += "-Wconf:cat=unused-imports&src=html/.*:s",
scalacOptions += "-Wconf:src=routes/.*:s"
)
.settings(
Test / parallelExecution := true
)
.settings(majorVersion := 0)
.settings(
name := appName,
RoutesKeys.routesImport ++= Seq(
"models.Mode",
"models.CheckMode",
"models.NormalMode",
"models.UpdateMode",
"models.Index",
"models.register._"
),
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._"
),
PlayKeys.playDefaultPort := 8201,
ScoverageKeys.coverageExcludedFiles := "<empty>;Reverse.*;.*filters.*;.*handlers.*;.*components.*;.*models.*;.*repositories.*;" +
".*BuildInfo.*;.*javascript.*;.*FrontendAuditConnector.*;.*Routes.*;.*GuiceInjector;.*UserAnswersCacheConnector;" +
".*ControllerConfiguration;.*LanguageSwitchController",
ScoverageKeys.coverageMinimumStmtTotal := 80,
ScoverageKeys.coverageFailOnMinimum := true,
ScoverageKeys.coverageHighlighting := true
)
.settings(
scalacOptions ++= Seq("-feature"),
libraryDependencies ++= AppDependencies(),
retrieveManaged := true
)
.settings(resolvers ++= Seq(
Resolver.jcenterRepo
)
)
.settings(
// concatenate js
Concat.groups := Seq(
"javascripts/pensionadministratorfrontend-app.js" -> group(Seq(
"javascripts/location-autocomplete.min.js",
"javascripts/pensionadministratorfrontend.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, uglify),
// only compress files generated by concat
uglify / includeFilter := GlobFilter("pensionadministratorfrontend-*.js")
)
lazy val testSettings: Seq[Def.Setting[_]] = Seq(
fork := true,
javaOptions ++= Seq(
"-Dconfig.resource=test.application.conf"
)
)