Skip to content

Commit

Permalink
Added scala-steward friendly versions for scripted test
Browse files Browse the repository at this point in the history
  • Loading branch information
develeon committed Dec 12, 2024
1 parent 0e7d4e6 commit 7938851
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ lazy val codegenSbt = project
"-Xmx1024M",
"-Xss4M",
"-Dplugin.version=" + version.value,
"-Dzio.test.version=" + ScriptedDependency.Version.zioTest,
"-Dsttp.version=" + ScriptedDependency.Version.sttp,
s"-Dproject.dir=${baseDirectory.value.getAbsolutePath}"
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ lazy val calibanLib = Seq(
)

lazy val sttp = Seq(
"com.softwaremill.sttp.client3" %% "core" % "3.10.1",
"com.softwaremill.sttp.client3" %% "zio" % "3.10.1"
"com.softwaremill.sttp.client3" %% "core" % Version.sttpVersion,
"com.softwaremill.sttp.client3" %% "zio" % Version.sttpVersion
)

lazy val zioTest = Seq(
"dev.zio" %% "zio-test" % "2.1.9" % Test,
"dev.zio" %% "zio-test-sbt" % "2.1.9" % Test
"dev.zio" %% "zio-test" % Version.zioTestVersion % Test,
"dev.zio" %% "zio-test-sbt" % Version.zioTestVersion % Test
)
// ### App Modules ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@ object Version {
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
def zioTestVersion: String =
sys.props.get("zio.test.version") match {
case Some(x) => x
case _ => sys.error("""|The system property 'zio.test.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
def sttpVersion: String =
sys.props.get("sttp.version") match {
case Some(x) => x
case _ => sys.error("""|The system property 'sttp.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
}
20 changes: 20 additions & 0 deletions project/ScriptedDependency.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import sbt.*

//noinspection TypeAnnotation
object ScriptedDependency {
// scala steward should understand these version in context of dependencies described here
object Version {
val sttp = "3.10.1"
val zioTest = "2.1.9"
}

lazy val sttp = Seq(
"com.softwaremill.sttp.client3" %% "core" % Version.sttp,
"com.softwaremill.sttp.client3" %% "zio" % Version.sttp
)

lazy val zioTest = Seq(
"dev.zio" %% "zio-test" % Version.zioTest % Test,
"dev.zio" %% "zio-test-sbt" % Version.zioTest % Test
)
}

0 comments on commit 7938851

Please sign in to comment.