Skip to content

Instantly share code, notes, and snippets.

@fedragon
Created May 9, 2017 12:06
Show Gist options
  • Save fedragon/418342d38004a3e1eab4a5a005c45b60 to your computer and use it in GitHub Desktop.
Save fedragon/418342d38004a3e1eab4a5a005c45b60 to your computer and use it in GitHub Desktop.
sbt: Change dependency version according to scala version
def myDependencyVersion(scalaVersion: String) = scalaVersion match {
case "2.11.11" => "2.0"
case _ => "1.0"
}
Project(...)
.settings(
libraryDependencies ++= Seq(
...,
"my" %% "dependency" % myDependency(scalaVersion.value)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment