Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can multi-projects from GIT be used as SBT dependencies?

I would like to use banana-rdf in my project, ideally by defining it as a dependency in a build.scala using dependsOn:

lazy val root = Project("root", file(".")) dependsOn RootProject(uri("git://github.com/w3c/banana-rdf"))

However, banana-rdf is a multi-project so needs to be composed differently. From what I can see, these multi-project definitions only allow you to specify project locations as file paths, and won't allow URIs.

Question: Am I right in saying that I have to clone these multi-project GIT dependencies into my project and reference them as folders?

I rather like the idea of leaving all the GIT cloning up to SBT, and having these cloned in some tmp SBT folder rather than cluttering up my project...

like image 737
Lawrence Wagerfield Avatar asked Nov 19 '13 22:11

Lawrence Wagerfield


1 Answers

I depend on Banana RDF subprojects all the time with ProjectRef, like this:

lazy val core: Project = Project(
  ...
).dependsOn(
  ProjectRef(uri("git://github.com/w3c/banana-rdf.git"), "banana-jena")
)

One especially nice part is that you can just tack a commit or branch name as a fragment identifier on the URI and everything works exactly as you'd expect.

like image 126
Travis Brown Avatar answered Oct 21 '22 11:10

Travis Brown