scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

variable support for dependency versions

Open scarf005 opened this issue 9 months ago • 0 comments

Is your feature request related to a problem? Please describe.

compared to sbt:

val quillVersion = "4.7.3"

libraryDependencies ++= Seq(
  // Syncronous JDBC Modules
  "io.getquill" %% "quill-jdbc" % quillVersion,
  // Or ZIO Modules
  "io.getquill" %% "quill-jdbc-zio" % quillVersion,
  // Or Cassandra
  "io.getquill" %% "quill-cassandra" % quillVersion,
  // Or Cassandra + ZIO
  "io.getquill" %% "quill-cassandra-zio" % quillVersion,
  // Add for Caliban Integration
  "io.getquill" %% "quill-caliban" % quillVersion
)

there's no easy way to pin multiple libraries to same version in scala-cli.

//> using dep io.getquill::quill-jdbc:4.7.3
//> using dep io.getquill::quill-jdbc-zio:4.7.3
//> using dep io.getquill::quill-cassandra:4.7.3
//> using dep io.getquill::quill-cassandra-zio:4.7.3
//> using dep io.getquill::quill-caliban:4.7.3

Describe the solution you'd like

introduce using val (syntax can change) directive to make it easier to pin multiple dependencies to same version.

//> using val quillVersion = "4.7.3"
//> using dep "io.getquill::quill-jdbc:$quillVersion"
//> using dep "io.getquill::quill-jdbc-zio:$quillVersion"
//> using dep "io.getquill::quill-cassandra:$quillVersion"
//> using dep "io.getquill::quill-cassandra-zio:$quillVersion"
//> using dep "io.getquill::quill-caliban:$quillVersion"

Describe alternatives you've considered

not adding it, it's more of an inconvenience.

Additional context Add any other context or screenshots about the feature request here.

scarf005 avatar Mar 27 '25 01:03 scarf005