forked from hmrc/api-notification-pull
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
96 lines (85 loc) · 3.75 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
/*
* Copyright 2018 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import scala.util.Properties.envOrElse
import play.sbt.PlayImport._
import play.core.PlayVersion
import sbt.Tests.{SubProcess, Group}
import uk.gov.hmrc.sbtdistributables.SbtDistributablesPlugin._
import uk.gov.hmrc._
import DefaultBuildSettings._
import uk.gov.hmrc.SbtAutoBuildPlugin
import uk.gov.hmrc.sbtdistributables.SbtDistributablesPlugin
import uk.gov.hmrc.versioning.SbtGitVersioning
lazy val appName = "api-notification-pull"
lazy val appDependencies: Seq[ModuleID] = compile ++ test
lazy val compile = Seq(
ws,
"uk.gov.hmrc" %% "bootstrap-play-25" % "1.7.0"
)
lazy val scope: String = "test, it"
lazy val test = Seq(
"uk.gov.hmrc" %% "hmrctest" % "3.0.0" % scope,
"org.scalatest" %% "scalatest" % "3.0.4" % scope,
"org.pegdown" % "pegdown" % "1.6.0" % scope,
"org.mockito" % "mockito-core" % "2.15.0" % scope,
"com.typesafe.play" %% "play-test" % PlayVersion.current % scope,
"org.scalatestplus.play" %% "scalatestplus-play" % "2.0.1" % scope,
"com.github.tomakehurst" % "wiremock" % "2.15.0" % scope exclude("org.apache.httpcomponents","httpclient") exclude("org.apache.httpcomponents","httpcore")
)
lazy val plugins: Seq[Plugins] = Seq.empty
lazy val playSettings: Seq[Setting[_]] = Seq.empty
lazy val microservice = (project in file("."))
.enablePlugins(Seq(_root_.play.sbt.PlayScala, SbtAutoBuildPlugin, SbtGitVersioning, SbtDistributablesPlugin) ++ plugins: _*)
.settings(playSettings: _*)
.settings(scalaSettings: _*)
.settings(publishingSettings: _*)
.settings(defaultSettings(): _*)
.settings(unmanagedResourceDirectories in Compile += baseDirectory.value / "resources")
.settings(unmanagedResourceDirectories in Compile += baseDirectory.value / "public")
.settings(
name := appName,
targetJvm := "jvm-1.8",
scalaVersion := "2.11.11",
libraryDependencies ++= appDependencies,
evictionWarningOptions in update := EvictionWarningOptions.default.withWarnScalaVersionEviction(false)
)
.settings(
Keys.fork in Test := false,
unmanagedSourceDirectories in Test := Seq((baseDirectory in Test).value / "test" / "unit"),
addTestReportOption(Test, "test-reports")
)
.configs(IntegrationTest)
.settings(inConfig(IntegrationTest)(Defaults.itSettings): _*)
.settings(
Keys.fork in IntegrationTest := false,
unmanagedSourceDirectories in IntegrationTest := Seq((baseDirectory in IntegrationTest).value / "test" / "it"),
addTestReportOption(IntegrationTest, "int-test-reports"),
testGrouping in IntegrationTest := oneForkedJvmPerTest((definedTests in IntegrationTest).value),
parallelExecution in IntegrationTest := false,
libraryDependencies ++= test
)
.settings(resolvers ++= Seq(
Resolver.bintrayRepo("hmrc", "releases"),
Resolver.jcenterRepo
))
def oneForkedJvmPerTest(tests: Seq[TestDefinition]) =
tests map {
test => Group(test.name, Seq(test), SubProcess(ForkOptions(runJVMOptions = Seq("-Dtest.name=" + test.name))))
}
// Coverage configuration
coverageMinimum := 96
coverageFailOnMinimum := true
coverageExcludedPackages := "<empty>;com.kenshoo.play.metrics.*;.*definition.*;prod.*;testOnlyDoNotUseInAppConf.*;app.*;uk.gov.hmrc.BuildInfo;views.*;uk.gov.hmrc.apinotificationpull.config.*"