Skip to content

Commit

Permalink
Extract deprecated IntegrationTest configuration into sbt subproject
Browse files Browse the repository at this point in the history
  • Loading branch information
saeltz committed Nov 23, 2023
1 parent 654f6a7 commit 5b65a5b
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ lazy val itkit =
name := "itkit",
organization := "io.moia",
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")),
scmInfo := Some(ScmInfo(url("https://github.com/moia-oss/itkit"), "scm:[email protected]:moia-oss/itkit.git")),
homepage := Some(url("https://github.com/moia-oss/itkit"))
scmInfo := Some(ScmInfo(url("https://github.com/moia-oss/itkit"), "scm:[email protected]:moia-oss/itkit.git")),
homepage := Some(url("https://github.com/moia-oss/itkit"))
)
.enablePlugins(
AutomateHeaderPlugin,
GitVersioning,
GitBranchPrompt
)
.settings(sonatypeSettings: _*)
.configs(IntegrationTest)
.settings(Defaults.itSettings: _*)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
Expand All @@ -43,15 +41,24 @@ lazy val itkit =
lazy val samples =
project
.in(file("samples"))
.configs(IntegrationTest)
.configs(IntegrationWithTest)
.dependsOn(itkit)
.settings(Defaults.itSettings: _*)
.settings(commonSettings)
.settings(
fork := true,
publishArtifact := false
)

lazy val IntegrationWithTest = config("it").extend(Test)
lazy val integrationTestSettings = inConfig(IntegrationWithTest)(integrationTestConfig)
lazy val integrationTestConfig =
Defaults.configSettings ++ Defaults.testTasks ++ org.scalafmt.sbt.ScalafmtPlugin.scalafmtConfigSettings ++ Seq(
IntegrationWithTest / publish / skip := true,
IntegrationWithTest / fork := true,
IntegrationWithTest / scalaSource := baseDirectory.value / "src" / "it" / "scala",
IntegrationWithTest / resourceDirectory := baseDirectory.value / "src" / "it" / "resources"
)

// *****************************************************************************
// Dependencies
// *****************************************************************************
Expand All @@ -67,7 +74,7 @@ lazy val library =
val scalaLogging = "3.9.5"
val scalaTest = "3.2.17"
}
val akkaActor = "com.typesafe.akka" %% "akka-actor-typed" % Version.akka
val akkaActor = "com.typesafe.akka" %% "akka-actor-typed" % Version.akka
val akkaHttp = "com.typesafe.akka" %% "akka-http" % Version.akkaHttp
val akkaHttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % Version.akkaHttp
val akkaStream = "com.typesafe.akka" %% "akka-stream-typed" % Version.akka
Expand Down Expand Up @@ -123,15 +130,15 @@ lazy val compilerSettings =
"-target",
"1.8"
),
Compile / unmanagedSourceDirectories := Seq((Compile / scalaSource).value),
Test / unmanagedSourceDirectories := Seq((Test / scalaSource).value)
Compile / unmanagedSourceDirectories := Seq((Compile / scalaSource).value),
Test / unmanagedSourceDirectories := Seq((Test / scalaSource).value)
)

lazy val gitSettings = Seq(git.useGitDescribe := true)

lazy val licenseSettings =
Seq(
headerLicense := Some(
headerLicense := Some(
HeaderLicense.Custom(
"""|Copyright (c) MOIA GmbH 2017
|""".stripMargin
Expand Down Expand Up @@ -160,9 +167,9 @@ lazy val scapegoatSettings = Seq(ThisBuild / scapegoatVersion := "2.1.3")
lazy val sbtVersionRegex = "v([0-9]+.[0-9]+.[0-9]+)-?(.*)?".r

lazy val sbtGitSettings = Seq(
git.useGitDescribe := true,
git.baseVersion := "0.0.0",
git.uncommittedSignifier := None,
git.useGitDescribe := true,
git.baseVersion := "0.0.0",
git.uncommittedSignifier := None,
git.gitTagToVersionNumber := {
case sbtVersionRegex(v, "") => Some(v)
case sbtVersionRegex(v, "SNAPSHOT") => Some(s"$v-SNAPSHOT")
Expand Down

0 comments on commit 5b65a5b

Please sign in to comment.