sbt-dependency-from-file
is a fresh-made library for dynamic load sbt dependencies using json files.
By using sbt-dependency-from-file
, users will be able to dynamically change project dependencies by adding or overwriting a simple file; this comes really handy to automation software.
In order to use sbt-dependency-from-file
in a sbt project, add sbt plugin in project/plugins.sbt
:
addSbtPlugin("io.radicalbit" % "sbt-dependency-from-file" % "1.0")
Suppose that you want to load different sbt dependencies according to specific environment, you just need to define a json file that contains dependencies in the root folder of your project:
{
"groupId":"org.typelevel",
"artifactId":"cats-core",
"version":"2.0.0-RC1",
"scalaVersion": "2.12",
"resolver":{
"name":"Local Maven Repository",
"url":".m2/repository",
}
}
]
And then, in your build.sbt
:
dependenciesJsonPath := baseDirectory.value / "dev.json"
libraryDependencies ++= extractedDependencies.value
- Francesco Frontera - [email protected] @francescofrontera
- Mauro Cortellazzi - [email protected] @maocorte