Skip to content
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

Calling build-level keys at a subproject resolves to wrong scoping #2851

Closed
eed3si9n opened this issue Nov 29, 2016 · 0 comments
Closed

Calling build-level keys at a subproject resolves to wrong scoping #2851

eed3si9n opened this issue Nov 29, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@eed3si9n
Copy link
Member

eed3si9n commented Nov 29, 2016

Ref #2707, #2708, #2469

steps

Using a multi-project build with sbt 0.13.13, navigate to a subproject and call version.

contraband root> project library
[info] Set current project to contraband (in build file:/Users/xxx/work/contraband/)
contraband> version
[info] library/*:version
[info] 	0.3.0-M1
[info] plugin/*:version
[info] 	0.3.0-M1
[info] {.}/*:version
[info] 	0.3.0-M1
contraband> inspect version
[info] Setting: java.lang.String = 0.3.0-M1
[info] Description:
[info] 	The version/revision of the current module.
[info] Provided by:
[info] 	{file:/Users/xxx/work/contraband/}/*:version
[info] Defined at:
[info] 	/Users/xxx/work/contraband/build.sbt:13
[info] Delegates:
[info] 	{.}/*:version
[info] 	*/*:version
[info] Related:
[info] 	*/*:version

problem

The problem is that typing "version" seems to be resolving to some build level scoping, and it ends up aggregating calls to the build level and the subprojects.

expectation

Here's the result using sbt 0.13.11:

contraband root> project library
[info] Set current project to contraband (in build file:/Users/xxx/work/contraband/)
contraband> version
[info] 0.3.0-M1
contraband> inspect version
[info] Setting: java.lang.String = 0.3.0-M1
[info] Description:
[info]  The version/revision of the current module.
[info] Provided by:
[info]  {file:/Users/xxx/work/contraband/}/*:version
[info] Defined at:
[info]  /Users/xxx/work/contraband/build.sbt:13
[info] Reverse dependencies:
[info]  library/*:bintraySyncMavenCentral
[info]  library/*:projectId
[info]  library/*:bintrayRemoteSign
[info]  library/*:isSnapshot
[info]  library/*:bintrayRelease
[info]  library/*:bintrayUnpublish
[info]  library/*:bintray::publishTo
[info] Delegates:
[info]  library/*:version
[info]  {.}/*:version
[info]  */*:version
[info] Related:
[info]  */*:version
[info]  {.}/*:version

notes

This behavior may result to unintended side effect aggregating over the subprojects.

@eed3si9n eed3si9n added the Bug label Nov 29, 2016
@eed3si9n eed3si9n added this to the 0.13.14 milestone Nov 29, 2016
@eed3si9n eed3si9n changed the title Calling settings/tasks/commands at a subproject resolves to wrong scoping Calling build-level keys at a subproject resolves to wrong scoping Nov 29, 2016
eed3si9n added a commit to eed3si9n/sbt that referenced this issue Nov 30, 2016
Fixes sbt#2460
Fixes sbt#2851
Ref sbt#2707, sbt#2708, sbt#2469

Unlike the previous attempts at fixing the handling of build-level
keys, this change does not change the main parsing logic, which uses
`getKey` to retrieve the key from the key map.
The fact that shell worked pre-0.13.11 means that the parsing was ok.

What this changes is just the "example" keys supplied to the parser so
the tab completion works.
@eed3si9n eed3si9n self-assigned this Nov 30, 2016
eed3si9n added a commit to eed3si9n/sbt that referenced this issue Jan 16, 2017
Fixes sbt#2460
Fixes sbt#2851
Ref sbt#2707, sbt#2708, sbt#2469

Unlike the previous attempts at fixing the handling of build-level
keys, this change does not change the main parsing logic, which uses
`getKey` to retrieve the key from the key map.
The fact that shell worked pre-0.13.11 means that the parsing was ok.

What this changes is just the "example" keys supplied to the parser so
the tab completion works.
eed3si9n added a commit to eed3si9n/sbt that referenced this issue Jan 16, 2017
Fixes sbt#2460
Fixes sbt#2851
Ref sbt#2707, sbt#2708, sbt#2469

Unlike the previous attempts at fixing the handling of build-level
keys, this change does not change the main parsing logic, which uses
`getKey` to retrieve the key from the key map.
The fact that shell worked pre-0.13.11 means that the parsing was ok.

What this changes is just the "example" keys supplied to the parser so
the tab completion works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant