-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
executable file
·62 lines (57 loc) · 2.77 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
import org.typelevel.scalacoptions.ScalacOptions
import play.sbt.PlayImport.PlayKeys.playDefaultPort
import uk.gov.hmrc.DefaultBuildSettings
import uk.gov.hmrc.DefaultBuildSettings.*
ThisBuild / scalaVersion := "2.13.12"
ThisBuild / majorVersion := 0
val scalafixSettings = Seq(
semanticdbEnabled := true, // enable SemanticDB
semanticdbVersion := scalafixSemanticdb.revision
)
lazy val microservice = Project("pillar2-submission-api", file("."))
.enablePlugins(play.sbt.PlayScala, SbtDistributablesPlugin, ScalafixPlugin, SwaggerPlugin)
.settings(
majorVersion := 0,
Compile / scalafmtOnCompile := true,
Test / scalafmtOnCompile := true,
Compile / tpolecatExcludeOptions ++= Set(ScalacOptions.warnNonUnitStatement, ScalacOptions.warnValueDiscard),
playDefaultPort := 10054,
libraryDependencies ++= AppDependencies.compile ++ AppDependencies.test,
scalacOptions += "-Wconf:src=routes/.*:s",
scalafixSettings
)
.settings(resolvers += Resolver.jcenterRepo)
.settings(CodeCoverageSettings.settings *)
.settings(
Compile / unmanagedResourceDirectories += baseDirectory.value / "resources"
)
.settings(scalaSettings: _*)
.settings(scalaVersion := "2.13.12")
.configs(IntegrationTest)
.settings(integrationTestSettings(): _*)
.settings(
unmanagedResourceDirectories in Compile += baseDirectory.value / "resources",
unmanagedSourceDirectories in Test := (baseDirectory in Test)(base => Seq(base / "test", base / "test-common")).value,
unmanagedResourceDirectories in Test := Seq(baseDirectory.value / "test-resources")
)
.settings(
unmanagedSourceDirectories in IntegrationTest :=
(baseDirectory in IntegrationTest)(base => Seq(base / "it", base / "test-common")).value,
testOptions in IntegrationTest += Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/test-reports/html-it-report"),
unmanagedResourceDirectories in IntegrationTest := Seq(baseDirectory.value / "test-resources")
)
.settings(resolvers += Resolver.jcenterRepo)
.settings(resolvers += "emueller-bintray" at "https://dl.bintray.com/emueller/maven")
.settings(JsonToYaml.settings *)
.settings(Validate.settings *)
.settings(PlaySwagger.settings *)
.disablePlugins(JUnitXmlReportPlugin)
addCommandAlias("prePrChecks", ";scalafmtCheckAll;scalafmtSbtCheck;scalafixAll --check")
addCommandAlias("lint", ";scalafmtAll;scalafmtSbt;scalafixAll")
addCommandAlias("createOpenAPISpec", ";clean;routesToYamlOas; validateOas")
lazy val it = project
.enablePlugins(PlayScala)
.dependsOn(microservice % "test->test")
.settings(DefaultBuildSettings.itSettings())
.settings(DefaultBuildSettings.itSettings(), tpolecatExcludeOptions ++= Set(ScalacOptions.warnNonUnitStatement, ScalacOptions.warnValueDiscard))
.settings(libraryDependencies ++= AppDependencies.it)