Skip to content

Root project: auto-aggregation vs stable id #4510

@dwijnand

Description

@dwijnand

There's tension for the root project between auto-aggregation and stable id. If you don't declare the root project (which you do, for example, like so: val bippy = project in file(".")) then it auto-aggregates all the projects in the build, but it also doesn't have a stable id, because it depends on the directory it's in, which could break scripts. This is present in current sbt 1.2.8, but it's been there since auto-aggregation was added which was ~ the 0.13.5 days.

I think the easiest way to fix this is to allow to opt back into auto-aggregation with a .withAutoAggregation method on Project.

Ideally, one could define the root project's id with something like RootProject / id := "...", but that's a setting and project's are defined before their settings are even added, let alone evaluated.

Another option could be to just make build loading fail if the root project's id is unstable, but that might be too strict (and too late to change.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions