-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
63 lines (48 loc) · 2.47 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
import com.typesafe.sbt.packager.MappingsHelper.*
import sbt.*
import sbt.Keys.*
import uk.gov.hmrc.DefaultBuildSettings
import uk.gov.hmrc.DefaultBuildSettings.defaultSettings
import uk.gov.hmrc.sbtdistributables.SbtDistributablesPlugin
import scala.language.postfixOps
Universal / mappings ++= directory(baseDirectory.value / "public")
// my understanding is publishing processed changed when we moved to the open and
// now it is done in production mode (was in dev previously). hence, we encounter the problem accessing "public" folder
// see https://stackoverflow.com/questions/36906106/reading-files-from-public-folder-in-play-framework-in-production
name := "eori-common-component"
PlayKeys.devSettings := Seq("play.server.http.port" -> "6752")
ThisBuild / majorVersion := 0
ThisBuild / scalaVersion := "2.13.13"
Test / fork := false
lazy val microservice = (project in file("."))
.enablePlugins(play.sbt.PlayScala, SbtDistributablesPlugin)
.disablePlugins(sbt.plugins.JUnitXmlReportPlugin)
.settings(commonSettings, scoverageSettings, silencerSettings)
lazy val commonSettings: Seq[Setting[_]] = defaultSettings()
lazy val scoverageSettings: Seq[Setting[_]] = Seq(
coverageExcludedPackages := "<empty>;Reverse.*;uk.gov.hmrc.customs.managesubscription.config.*;.*(BuildInfo|Routes).*;.*ConfigModule.*;.*ConfigValidationNelAdaptor.*;.*ErrorResponse.*",
coverageMinimumStmtTotal := 95,
coverageFailOnMinimum := false,
coverageHighlighting := true,
Test / parallelExecution := false
)
scalastyleConfig := baseDirectory.value / "project" / "scalastyle-config.xml"
Test / javaOptions += "-Dlogger.resource=logback-test.xml"
libraryDependencies ++= AppDependencies.compile ++ AppDependencies.test
lazy val silencerSettings: Seq[Setting[_]] = {
val silencerVersion = "1.7.16"
Seq(
libraryDependencies ++= Seq(
compilerPlugin("com.github.ghik" % "silencer-plugin" % silencerVersion cross CrossVersion.full)
),
// silence all warnings on autogenerated files
scalacOptions += "-P:silencer:pathFilters=target/.*",
// Make sure you only exclude warnings for the project directories, i.e. make builds reproducible
scalacOptions += s"-P:silencer:sourceRoots=${baseDirectory.value.getCanonicalPath}"
)
}
lazy val it = project
.enablePlugins(PlayScala)
.dependsOn(microservice % "test->test") // the "test->test" allows reusing test code and test dependencies
.settings(DefaultBuildSettings.itSettings())
.settings(libraryDependencies ++= AppDependencies.test)