Skip to content

Adding subproject causes setting to no longer be evaluated (?) #7173

@armanbilge

Description

@armanbilge

steps

sbt 1.8.2

val foo = project.in(file("foo"))
val fooAux = project.in(file("foo-aux")).settings(foo / Compile / sourceGenerators += Def.task(Seq.empty))
val bar = project
val baz = project

problem

Project foo has no source generators.

sbt:sandbox> reload; show Compile/sourceGenerators
[info] welcome to sbt 1.8.2 (Azul Systems, Inc. Java 11.0.17)
[info] loading project definition from /workspace/sandbox/project
[info] loading settings for project sandbox from build.sbt ...
[info] set current project to sandbox (in build file:/workspace/sandbox/)
[info] foo / Compile / sourceGenerators
[info]  List()
[info] fooAux / Compile / sourceGenerators
[info]  List()
[info] bar / Compile / sourceGenerators
[info]  List()
[info] baz / Compile / sourceGenerators
[info]  List()
[info] Compile / sourceGenerators
[info]  List()

expectation

If we remove the baz project from the build, then foo does have a source generator. This is what I expect.

sbt:sandbox> reload; show Compile/sourceGenerators
[info] welcome to sbt 1.8.2 (Azul Systems, Inc. Java 11.0.17)
[info] loading project definition from /workspace/sandbox/project
[info] loading settings for project sandbox from build.sbt ...
[info] set current project to sandbox (in build file:/workspace/sandbox/)
[info] foo / Compile / sourceGenerators
[info]  List(Task(_))
[info] fooAux / Compile / sourceGenerators
[info]  List()
[info] bar / Compile / sourceGenerators
[info]  List()
[info] Compile / sourceGenerators
[info]  List()

notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions