Cloud | Scala
Compile-Time Evaluation in Scala with macros Arnout Engelen 27 Mar, 2016
import sbt.{Build, Project, ProjectRef, uri}
object GotoBuild extends Build {
lazy val root = Project("root", sbt.file(".")).dependsOn(staminaCore, staminaJson, ...)
lazy val staminaCore = ProjectRef(uri("git://github.com/scalapenos/stamina.git#master"), "stamina-core")
lazy val staminaJson = ProjectRef(uri("git://github.com/scalapenos/stamina.git#master"), "stamina-json")
...
}
These subprojects are now a compile time dependency and sbt will pull in and maintain the repository in ~/.sbt/0.13/staging/[sha]/stamina. So no manual checkout with local publish is needed. This is very handy when depending on an internal independent project/module and without needing to create a new release for every change. (One side note is that my IntelliJ currently does not recognize that the library is on the class/source path of the main project, so it complains it cannot find symbols and therefore cannot do proper syntax checking and auto completing.)