Skip to content

Commit

Permalink
ProjectGroup root project no longer automatically aggregates subprojects
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Janusz committed Mar 18, 2023
1 parent 0e47fd2 commit d340193
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -74,7 +74,6 @@ The above file is a complete definition of an `sbt` multi-project build, in plai
* The root project must be defined as `lazy val root` and implemented with `mkSubProject`. ID of this project will be the same as name of the `ProjectGroup`, i.e. `myproj`. Base directory of this project is the build root directory.
* All subprojects in the project group must be defined as `lazy val`s, just like you would do in an `.sbt` file. However, usage of `mkSubProject` makes sure that subprojects follow hierarchical naming and directory convention.
For example `lazy val api: Project = mkSubProject` will define a subproject with ID `myproj-api` and base directory `api/`. Note how this is different from the default `sbt` behaviour which would place the project in a directory corresponding directly to its ID (i.e. `myproj-api/`).
* The `root` project automatically [aggregates](https://www.scala-sbt.org/1.x/docs/Multi-Project.html#Aggregation) all subprojects.
* Settings shared by all the projects in your build can be defined by overriding `commonSettings`.
Note how this is **not** the same as defining settings in `Global` or `ThisBuild` scopes - `commonSettings` are applied **directly** on each and every project which is more reliable than `Global`/`ThisBuild` and generally more recommended.
There are also variations of `commonSettings`, e.g. `subprojectSettings`, `leafSubprojectSettings`, etc. which allow you to refine the exact set of projects that you want to apply settings on. Refer to `ProjectGroup`s API for details.
Expand Down
4 changes: 0 additions & 4 deletions src/main/scala/com/github/ghik/plainsbt/ProjectGroup.scala
Expand Up @@ -66,15 +66,11 @@ abstract class ProjectGroup(
* The base directory for this project will be set to:
* - current directory if this project group is the toplevel group
* - `<parentGroupDirectory>/<groupName>` otherwise
*
* The root project will automatically aggregate all subprojects in the group
* (i.e. tasks invoked on the root project will also be invoked on aggregated subprojects).
*/
protected def mkRootProject(implicit freshProject: FreshProject): Project =
freshProject.project.in(baseDir)
.withId(rootProjectId)
.enablePlugins(this)
.aggregate(subprojects.map(p => p: ProjectReference) *)
.settings(commonSettings)
.settings(directCommonSettings)
.settings(parent.mapOr(Nil, _.commonSettings))
Expand Down

0 comments on commit d340193

Please sign in to comment.