Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract deprecated IntegrationTest configuration into sbt subproject #162

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading