-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide docs how to use the plugin with multi-project projects #52
Comments
I'll try to detail this out soon. Basically, the "archetypes" are a per-project based packaging scenario. If you want to package multiple projects, you may need to "manually" construct the I'll see if perhaps I can promote that idea as first class. |
Josh, it would be very nice to support this idea as first class. It's common to have frontend, backend, common sub-projects and wish to merge them together into a single package without too much pain. For now, can you provide some steps or code required to construct this setup manually? Thanks you. |
I think we should put this in our next milestone 0.8.0 |
sounds good. Sorry I've been AFK, trying to push 0.13.2-RC1 out. |
bump :) |
Not from me :( I'm currently not having that much experience with multi-module-sbt projects. I'm doing this currently with a configuration like this lazy val frontend = Project(
id = "frontend",
base = file("."),
settings = defaultSettings ++ playScalaSettings ++ packageArchetype.java_server ++ Packaging.debian ++ Seq(
libraryDependencies ++= Dependencies.frontend
),
aggregate = Seq(common, api)
) dependsOn(common, api)
// --------- Project Commons ----------------
lazy val common = Project(
id = "common",
base = file("sub_common"),
settings = defaultSettings ++ Seq(
libraryDependencies ++= Dependencies.common
)
)
// --------- Project API ------------------
lazy val api = Project(
id = "api",
base = file("sub_api"),
settings = defaultSettings ++ Seq(
libraryDependencies ++= Dependencies.common
)
) dependsOn(common) |
Yeah, so we only support "whole" packages right now, with all dependent jars bundles, and no sharing. It'd be an epic feature request to do more, and possibly some socialization of how to do so. Otherwise @muuki88's code looks great except for that defaultSettings bit :). Using defaultSettings is effectively deprecated in 0.13.5 (as it means you're going to bypass the entire AutoPlugin mechanism), so here's what I would write: lazy val frontend = (Project(
id = "frontend",
base = file("."),
aggregate = Seq(common, api)
) settings(playScalaSettings:_*)
settings(packageArchetype.java_server:_*) settings(
libraryDependencies ++= Dependencies.frontend
),dependsOn(common, api))
// --------- Project Commons ----------------
lazy val common = Project(
id = "common",
base = file("sub_common")
) settings(
libraryDependencies ++= Dependencies.common
)
)
// --------- Project API ------------------
lazy val api = Project(
id = "api",
base = file("sub_api"),
) settings (
libraryDependencies ++= Dependencies.common
)
) dependsOn(common) |
Hi, Josh. I try to use this plugin with multi-project setup described in your book "SBT in Action" (btw, I can't skip dots at the end of the lines like in the book - it doesn't compile).
My build.sbt:
common.scala:
and dependencies.scala:
But when I invoke 'stage' from the root I don't get my sub-projects and their dependencies. I just want to include all my sub-projects. Can you provide some documentation describing this plugin usage in such a common scenario? Thank you so much for your book and this plugin!
The text was updated successfully, but these errors were encountered: