-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
75 lines (72 loc) · 3.23 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
import play.sbt.routes.RoutesKeys
import sbt.Def
import scoverage.ScoverageKeys
import uk.gov.hmrc.DefaultBuildSettings
import uk.gov.hmrc.versioning.SbtGitVersioning.autoImport.majorVersion
lazy val appName: String = "manage-pensions-frontend"
lazy val root = (project in file("."))
.disablePlugins(JUnitXmlReportPlugin) //Required to prevent https://github.com/scalatest/scalatest/issues/1427
.enablePlugins(PlayScala, SbtDistributablesPlugin)
.settings(DefaultBuildSettings.scalaSettings: _*)
.settings(DefaultBuildSettings.defaultSettings(): _*)
.settings(inConfig(Test)(testSettings): _*)
.settings(majorVersion := 0)
.settings(scalaVersion := "2.13.12")
.settings(
name := appName,
RoutesKeys.routesImport ++= Seq(
"models.SchemeReferenceNumber",
"models.Mode",
"models.CheckMode",
"models.NormalMode"
),
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 := 8204,
ScoverageKeys.coverageExcludedFiles := "<empty>;Reverse.*;.*filters.*;.*handlers.*;.*components.*;.*models.*;.*repositories.*;" +
".*BuildInfo.*;.*javascript.*;.*FrontendAuditConnector.*;.*Routes.*;.*GuiceInjector;" +
".*ControllerConfiguration;.*LanguageSwitchController;.*MongoDiagnosticsConnector;.*PensionsSchemeFeatureSwitchConnector;" +
".*PensionAdministratorFeatureSwitchConnectorImpl;.*controllers.testonly.*;.*target.*",
ScoverageKeys.coverageMinimumStmtTotal := 80,
ScoverageKeys.coverageFailOnMinimum := true,
ScoverageKeys.coverageHighlighting := true,
scalacOptions ++= Seq("-feature"),
scalacOptions ++= Seq("-Xmaxerrs", "500"), // Set maximum errors to 500
scalacOptions ++= Seq("-Xmaxwarns", "1"), // Set maximum errors to 500
libraryDependencies ++= AppDependencies(),
retrieveManaged := true,
update / evictionWarningOptions :=
EvictionWarningOptions.default.withWarnScalaVersionEviction(false),
resolvers ++= Seq(
Resolver.jcenterRepo
),
// concatenate js
Concat.groups := Seq(
"javascripts/application.js" -> group(Seq(
"javascripts/autocomplete/location-autocomplete.min.js",
"javascripts/managepensionsfrontend.js"
))
),
// prevent removal of unused code which generates warning errors due to use of third-party libs
uglifyCompressOptions := Seq("unused=false", "dead_code=false"),
// Added below code to replace plugin silencer version = "1.7.8"
scalacOptions += "-Wconf:src=routes/.*:s",
scalacOptions += "-Wconf:cat=unused-imports&src=html/.*:s",
pipelineStages := Seq(digest),
// below line required to force asset pipeline to operate in dev rather than only prod
// Removed uglify due to node 20 compile issues.
// Suspected cause minification of already minified location-autocomplete.min.js -Pavel Vjalicin
Assets / pipelineStages := Seq(concat)
)
lazy val testSettings: Seq[Def.Setting[_]] = Seq(
fork := true,
parallelExecution := true,
javaOptions ++= Seq(
"-Dconfig.resource=test.application.conf"
)
)