1

I have a multi-project sbt build with one project that has a dependy on another project. In my ide I want to be able to re-factor the code in the dependency and it affect the code in the dependant project (so I use dependsOn) but in jenkins I want that dependant project to have a jar dependency and to build as standalone.

So in my ide I want to use dependsOn but in jenkins I want use libraryDependecies, but I'm struggling to get the sbt file to build correctly using somthing like:

lazy val projB = Try(project in file("../projB")).toOption
lazy val projA = project in file(".")

projB match {
  case Some(p) => projA dependsOn p
  case None => libraryDependencies += "org.mine" % "proj.b" % scalaVersion.value
}

I was thinking about using a Build.scala but it seems that approach is deprecated see

I'd like to hear some ideas on how to achieve this

iou1
  • 43
  • 7
  • I'd like to add I've hacked a solution to this by creating a seperate build file (without the .sbt ext to prevent inclusion in the normal sbt build) and in jenkins overwriting build.sbt using 'mv build.sbt.jenkins build.sbt' as the first build step and following this build step with the sbt build step – iou1 Mar 23 '17 at 23:53

0 Answers0