-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.sbt
137 lines (124 loc) · 5.08 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import play.sbt.routes.RoutesKeys
import sbt.*
import sbt.Keys.libraryDependencySchemes
import uk.gov.hmrc.DefaultBuildSettings.*
import uk.gov.hmrc.versioning.SbtGitVersioning.autoImport.majorVersion
import uk.gov.hmrc.DefaultBuildSettings
val appName = "income-tax-view-change-frontend"
val bootstrapPlayVersion = "8.1.0"
val playPartialsVersion = "9.1.0"
val playFrontendHMRCVersion = "8.5.0"
val catsVersion = "2.8.0"
val scalaTestPlusVersion = "7.0.0"
val pegdownVersion = "1.6.0"
val jsoupVersion = "1.15.4"
val mockitoVersion = "5.8.0"
val scalaMockVersion = "5.2.0"
val wiremockVersion = "3.0.0-beta-7"
val hmrcMongoVersion = "1.6.0"
val currentScalaVersion = "2.13.12"
val playVersion = "play-30"
scalacOptions += "-feature"
val compile = Seq(
ws,
"uk.gov.hmrc" %% s"bootstrap-frontend-$playVersion" % bootstrapPlayVersion,
"uk.gov.hmrc" %% s"play-partials-$playVersion" % playPartialsVersion,
"org.typelevel" %% "cats-core" % catsVersion,
"uk.gov.hmrc.mongo" %% s"hmrc-mongo-$playVersion" % hmrcMongoVersion,
"uk.gov.hmrc" %% s"play-frontend-hmrc-$playVersion" % playFrontendHMRCVersion,
"uk.gov.hmrc" %% s"crypto-json-$playVersion" % "7.6.0",
"org.jsoup" % "jsoup" % jsoupVersion,
)
def test(scope: String = "test"): Seq[ModuleID] = Seq(
"org.scalatestplus.play" %% "scalatestplus-play" % scalaTestPlusVersion % scope,
"org.scalamock" %% "scalamock" % scalaMockVersion % scope,
"org.pegdown" % "pegdown" % pegdownVersion % scope,
"org.jsoup" % "jsoup" % jsoupVersion % scope,
"org.mockito" % "mockito-core" % mockitoVersion % scope,
"uk.gov.hmrc.mongo" %% s"hmrc-mongo-test-$playVersion" % hmrcMongoVersion % scope,
"org.scalacheck" %% "scalacheck" % "1.17.0" % scope,
"org.scalatestplus" %% "scalacheck-1-15" % "3.2.11.0" % scope,
"uk.gov.hmrc" %% s"bootstrap-test-$playVersion" % bootstrapPlayVersion % "test",
caffeine,
"uk.gov.hmrc" %% s"crypto-json-$playVersion" % "7.6.0"
)
def it(scope: String = "test"): Seq[ModuleID] = Seq(
"org.scalatestplus.play" %% "scalatestplus-play" % scalaTestPlusVersion % scope,
"org.scalamock" %% "scalamock" % scalaMockVersion % scope,
"org.pegdown" % "pegdown" % pegdownVersion % scope,
"org.jsoup" % "jsoup" % jsoupVersion % scope,
"org.mockito" % "mockito-core" % mockitoVersion % scope,
"com.github.tomakehurst" % "wiremock" % wiremockVersion % scope,
"uk.gov.hmrc.mongo" %% s"hmrc-mongo-test-$playVersion" % hmrcMongoVersion % scope,
caffeine
)
lazy val appDependencies: Seq[ModuleID] = compile ++ test()
lazy val appDependenciesIt: Seq[ModuleID] = it()
lazy val plugins: Seq[Plugins] = Seq.empty
lazy val playSettings: Seq[Setting[_]] = Seq.empty
lazy val scoverageSettings = {
import scoverage.ScoverageKeys
Seq(
ScoverageKeys.coverageExcludedPackages := "<empty>;controllers\\..*Reverse.*;models/.data/..*;" +
"filters.*;.handlers.*;components.*;.*BuildInfo.*;.*standardError*.*;.*Routes.*;views.html.*;appConfig.*;" +
"controllers.feedback.*;app.*;prod.*;appConfig.*;com.*;testOnlyDoNotUseInAppConf.*;testOnly.*;\"",
ScoverageKeys.coverageMinimumStmtTotal := 90.0,
ScoverageKeys.coverageFailOnMinimum := true,
ScoverageKeys.coverageHighlighting := true
)
}
lazy val microservice = Project(appName, file("."))
.enablePlugins(play.sbt.PlayScala, SbtDistributablesPlugin)
.disablePlugins(JUnitXmlReportPlugin)
.settings(playSettings: _*)
.settings(scalaSettings: _*)
.settings(scalaVersion := currentScalaVersion)
.settings(scoverageSettings: _*)
.settings(defaultSettings(): _*)
.settings(majorVersion := 1)
.settings(scalacOptions += "-Wconf:cat=lint-multiarg-infix:silent")
.settings(scalacOptions += "-Xfatal-warnings")
.settings(scalacOptions += "-deprecation:false")
.settings(
Test / Keys.fork := true,
Test / javaOptions += "-Dlogger.resource=logback-test.xml",
libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
)
.settings(
libraryDependencies ++= appDependencies,
retrieveManaged := true
)
.settings(
Test / Keys.fork := true,
scalaVersion := currentScalaVersion,
scalacOptions += "-Wconf:src=routes/.*:s",
Test / javaOptions += "-Dlogger.resource=logback-test.xml")
.settings(
Keys.fork := false,
TwirlKeys.templateImports ++= Seq(
"uk.gov.hmrc.govukfrontend.views.html.components.implicits._",
"uk.gov.hmrc.hmrcfrontend.views.html.helpers._",
"uk.gov.hmrc.hmrcfrontend.views.html.components.implicits._"
),
RoutesKeys.routesImport := Seq("enums.IncomeSourceJourney._", "models.admin._", "models.core._"),
scalacOptions += "-Wconf:cat=unused-imports:s,cat=unused-params:s"
)
.settings(resolvers ++= Seq(
Resolver.jcenterRepo
))
lazy val it = project
.dependsOn(microservice % "test->test")
.settings(DefaultBuildSettings.itSettings().head)
.enablePlugins(play.sbt.PlayScala)
.settings(
publish / skip := true
)
.settings(scalaVersion := currentScalaVersion)
.settings(majorVersion := 1)
.settings(scalacOptions += "-Xfatal-warnings")
.settings(
testForkedParallel := true
)
.settings(
libraryDependencies ++= appDependenciesIt
)