Skip to content

Commit 35fdb07

Browse files
authored
APIS-6855 - subprojects (#86)
1 parent 0bf93a7 commit 35fdb07

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

build.sbt

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,27 @@ lazy val playSettings: Seq[Setting[_]] = Seq.empty
1616

1717
ThisBuild / semanticdbEnabled := true
1818
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
19-
19+
ThisBuild / scalaVersion := "2.13.12"
20+
ThisBuild / majorVersion := 0
2021
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
2122

22-
lazy val microservice = Project(appName, file("."))
23+
lazy val microservice: Project = Project(appName, file("."))
2324
.enablePlugins(PlayScala, SbtDistributablesPlugin)
2425
.settings(playSettings: _*)
2526
.settings(scalaSettings: _*)
2627
.settings(defaultSettings(): _*)
2728
.settings(ScoverageSettings(): _*)
2829
.settings(
29-
majorVersion := 0,
3030
libraryDependencies ++= AppDependencies.libraryDependencies,
3131
retrieveManaged := true
3232
)
3333
.settings(
34-
inConfig(Test)(BloopDefaults.configSettings),
3534
addTestReportOption(Test, "test-reports"),
3635
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-eT"),
37-
Test / fork := false,
3836
Test / unmanagedSourceDirectories ++= Seq(
3937
baseDirectory.value / "test",
4038
baseDirectory.value / "test-common"
4139
),
42-
Test / parallelExecution := false
43-
)
44-
.settings(DefaultBuildSettings.integrationTestSettings())
45-
.configs(IntegrationTest)
46-
.settings(
47-
inConfig(IntegrationTest)(scalafixConfigSettings(IntegrationTest)),
48-
inConfig(IntegrationTest)(BloopDefaults.configSettings),
49-
addTestReportOption(IntegrationTest, "int-test-reports"),
50-
IntegrationTest / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-eT"),
51-
IntegrationTest / fork := false,
52-
IntegrationTest / unmanagedSourceDirectories ++= Seq(
53-
baseDirectory.value / "integration",
54-
baseDirectory.value / "test-common"
55-
),
56-
IntegrationTest / parallelExecution := false
5740
)
5841
.settings(
5942
scalacOptions ++= Seq(
@@ -64,11 +47,26 @@ lazy val microservice = Project(appName, file("."))
6447
)
6548
)
6649

50+
lazy val it = (project in file("it"))
51+
.enablePlugins(PlayScala)
52+
.dependsOn(microservice % "test->test")
53+
.settings(DefaultBuildSettings.itSettings())
54+
.settings(
55+
Test / testOptions := Seq(Tests.Argument(TestFrameworks.ScalaTest, "-eT")),
56+
Test / unmanagedSourceDirectories += baseDirectory.value / "testcommon",
57+
addTestReportOption(Test, "int-test-reports"),
58+
)
59+
6760
commands ++= Seq(
68-
Command.command("run-all-tests") { state => "test" :: "it:test" :: state },
61+
Command.command("cleanAll") { state => "clean" :: "it/clean" :: state },
62+
Command.command("fmtAll") { state => "scalafmtAll" :: "it/scalafmtAll" :: state },
63+
Command.command("fixAll") { state => "scalafixAll" :: "it/scalafixAll" :: state },
64+
Command.command("testAll") { state => "test" :: "it/test" :: state },
65+
66+
Command.command("run-all-tests") { state => "testAll" :: state },
6967

70-
Command.command("clean-and-test") { state => "clean" :: "compile" :: "run-all-tests" :: state },
68+
Command.command("clean-and-test") { state => "cleanAll" :: "compile" :: "run-all-tests" :: state },
7169

7270
// Coverage does not need compile !
73-
Command.command("pre-commit") { state => "clean" :: "scalafmtAll" :: "scalafixAll" :: "coverage" :: "run-all-tests" :: "coverageOff" :: "coverageAggregate" :: state }
71+
Command.command("pre-commit") { state => "cleanAll" :: "fmtAll" :: "fixAll" :: "coverage" :: "testAll" :: "coverageOff" :: "coverageAggregate" :: state }
7472
)
File renamed without changes.
File renamed without changes.

project/AppDependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ object AppDependencies {
2222
"uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion,
2323
"org.mockito" %% "mockito-scala-scalatest" % "1.17.29",
2424
"uk.gov.hmrc" %% "api-platform-test-common-domain" % commonDomainVersion
25-
).map(_ % "test, it")
25+
).map(_ % "test")
2626

2727
}

0 commit comments

Comments
 (0)