diff --git a/build.sbt b/build.sbt index 3ad9944..3623d02 100644 --- a/build.sbt +++ b/build.sbt @@ -7,26 +7,26 @@ val username = "RustedBones" val repo = "taxonomy" // for sbt-github-actions -ThisBuild / scalaVersion := "3.2.1" -ThisBuild / githubWorkflowBuild := Seq( +ThisBuild / scalaVersion := "3.2.1" +ThisBuild / githubWorkflowBuild := Seq( WorkflowStep.Sbt(name = Some("Check project"), commands = List("scalafmtCheckAll", "headerCheckAll")), WorkflowStep.Sbt(name = Some("Build project"), commands = List("test", "IntegrationTest/test")) ) -ThisBuild / githubWorkflowTargetBranches := Seq("main") +ThisBuild / githubWorkflowTargetBranches := Seq("main") ThisBuild / githubWorkflowPublishTargetBranches := Seq.empty lazy val commonSettings = Defaults.itSettings ++ headerSettings(Configurations.IntegrationTest) ++ inConfig(IntegrationTest)(ScalafmtPlugin.scalafmtConfigSettings) ++ Seq( - organization := "fr.davit", - organizationName := "Michel Davit", - scalaVersion := (ThisBuild / scalaVersion).value, - homepage := Some(url(s"https://github.com/$username/$repo")), + organization := "fr.davit", + organizationName := "Michel Davit", + scalaVersion := (ThisBuild / scalaVersion).value, + homepage := Some(url(s"https://github.com/$username/$repo")), licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")), - startYear := Some(2020), - scmInfo := Some(ScmInfo(url(s"https://github.com/$username/$repo"), s"git@github.com:$username/$repo.git")), - developers := List( + startYear := Some(2020), + scmInfo := Some(ScmInfo(url(s"https://github.com/$username/$repo"), s"git@github.com:$username/$repo.git")), + developers := List( Developer( id = s"$username", name = "Michel Davit", @@ -34,38 +34,36 @@ lazy val commonSettings = Defaults.itSettings ++ url = url(s"https://github.com/$username") ) ), - publishMavenStyle := true, - Test / publishArtifact := false, - publishTo := { - val resolver = if (isSnapshot.value) { - Opts.resolver.sonatypeSnapshots: @nowarn("cat=deprecation") - } else { - Opts.resolver.sonatypeStaging - } + publishMavenStyle := true, + Test / publishArtifact := false, + publishTo := { + val resolver = + if isSnapshot.value then Opts.resolver.sonatypeSnapshots: @nowarn("cat=deprecation") + else Opts.resolver.sonatypeStaging Some(resolver) }, releasePublishArtifactsAction := PgpKeys.publishSigned.value, - credentials ++= (for { + credentials ++= (for username <- sys.env.get("SONATYPE_USERNAME") password <- sys.env.get("SONATYPE_PASSWORD") - } yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq, + yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq, testFrameworks += new TestFramework("munit.Framework") ) lazy val `taxonomy` = (project in file(".")) - .settings(commonSettings: _*) + .settings(commonSettings*) .aggregate(`taxonomy-model`, `taxonomy-scodec`, `taxonomy-fs2`) .settings( publish / skip := true ) lazy val `taxonomy-model` = (project in file("model")) - .settings(commonSettings: _*) + .settings(commonSettings*) lazy val `taxonomy-scodec` = (project in file("scodec")) .configs(IntegrationTest) .dependsOn(`taxonomy-model`) - .settings(commonSettings: _*) + .settings(commonSettings*) .settings( libraryDependencies ++= Seq( Dependencies.ScodecCore, @@ -76,7 +74,7 @@ lazy val `taxonomy-scodec` = (project in file("scodec")) lazy val `taxonomy-fs2` = (project in file("fs2")) .configs(IntegrationTest) .dependsOn(`taxonomy-scodec`) - .settings(commonSettings: _*) + .settings(commonSettings*) .settings( libraryDependencies ++= Seq( Dependencies.FS2Core, diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 6d907a2..e2268a0 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -1,20 +1,16 @@ -import sbt._ +import sbt.* -object Dependencies { +object Dependencies: - object Versions { + object Versions: val FS2 = "3.4.0" val MUnitCE3 = "1.0.7" val Scodec = "2.2.0" - } val FS2Core = "co.fs2" %% "fs2-core" % Versions.FS2 val FS2IO = "co.fs2" %% "fs2-io" % Versions.FS2 val FS2Scodec = "co.fs2" %% "fs2-scodec" % Versions.FS2 val ScodecCore = "org.scodec" %% "scodec-core" % Versions.Scodec - object Test { + object Test: val MUnitCE3 = "org.typelevel" %% "munit-cats-effect-3" % Versions.MUnitCE3 % "it,test" - } - -}