Skip to content

Commit

Permalink
build.sbt: Unify adding dependencies
Browse files Browse the repository at this point in the history
Ensures all used library dependencies are stored in a singular map
with their default versions.

Signed-off-by: Wiktoria Kuna <[email protected]>
  • Loading branch information
wkkuna committed Mar 21, 2024
1 parent f7d2eb5 commit ef055f2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ resolvers ++= Seq(
// Chisel 3.5
addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % "3.5.3" cross CrossVersion.full)

// Provide a managed dependency on X if -DXVersion="" is supplied on the command line.
// Library name, Organization, Version
val defaultVersions = Map(
"chisel3" -> "3.5.+",
"chiseltest" -> "0.5.0",
"chisel-iotesters" -> "2.5.5+"
)
libraryDependencies ++= Seq("chisel3","chiseltest","chisel-iotesters").map {
dep: String => "edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", defaultVersions(dep)) }
"chisel3" -> "edu.berkeley.cs" -> "3.5.+",
"chiseltest" -> "edu.berkeley.cs" -> "0.5.0",
"chisel-iotesters" -> "edu.berkeley.cs" -> "2.5.5+",
"play-json" -> "com.typesafe.play" -> "2.8.+"
)

libraryDependencies += "com.typesafe.play" %% "play-json" % "2.8.+"
// Provide a managed dependency on X if -DXVersion="" is supplied on the command line.
libraryDependencies ++= defaultVersions.map {
case ((dep: String, org: String), v: String) => {
org %% dep % sys.props.getOrElse(dep + "Version", v)
}
}.toSeq

scalacOptions ++= scalacOptionsVersion(scalaVersion.value)

javacOptions ++= javacOptionsVersion(scalaVersion.value)

0 comments on commit ef055f2

Please sign in to comment.