diff --git a/build.sbt b/build.sbt index 293b766..13ed29d 100644 --- a/build.sbt +++ b/build.sbt @@ -9,8 +9,8 @@ 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:git@github.com:moia-oss/itkit.git")), - homepage := Some(url("https://github.com/moia-oss/itkit")) + scmInfo := Some(ScmInfo(url("https://github.com/moia-oss/itkit"), "scm:git@github.com:moia-oss/itkit.git")), + homepage := Some(url("https://github.com/moia-oss/itkit")) ) .enablePlugins( AutomateHeaderPlugin, @@ -18,8 +18,6 @@ lazy val itkit = GitBranchPrompt ) .settings(sonatypeSettings: _*) - .configs(IntegrationTest) - .settings(Defaults.itSettings: _*) .settings(commonSettings) .settings( libraryDependencies ++= Seq( @@ -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 // ***************************************************************************** @@ -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 @@ -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 @@ -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")