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

Fix a message about an undefined setting #5469

Merged
merged 1 commit into from Mar 18, 2020
Merged

Conversation

nigredo-tori
Copy link
Contributor

@nigredo-tori nigredo-tori commented Mar 13, 2020

defining seems to be a setting or a task that references referencedKey, not the other way around.

`defining` seems to be the setting or a task that references `referencedKey`, not the other way around.
@eed3si9n
Copy link
Member

I just confirmed this using the following.

steps

ThisBuild / scalaVersion     := "2.13.1"
ThisBuild / version          := "0.1.0-SNAPSHOT"
ThisBuild / organization     := "com.example"
ThisBuild / organizationName := "example"

lazy val foo = settingKey[String]("")
lazy val bar = taskKey[String]("")

lazy val root = (project in file("."))
  .settings(
    name := "hello",
    bar := (Def.taskDyn {
      Def.task { foo.value }
    }).value
  )
sbt:hello> bar

problem

sbt:hello> bar
[error] stack trace is suppressed; run last bar for the full output
[error] (bar) sbt.internal.util.Init$RuntimeUndefined: References to undefined settings at runtime.
[error] setting(ScopedKey(Scope(Select(ProjectRef(file:/private/tmp/hello/,root)), Zero, Zero, Zero),bar)) at LinePosition(/private/tmp/hello/build.sbt,14) referenced from ScopedKey(Scope(Select(ProjectRef(file:/private/tmp/hello/,root)), Zero, Zero, Zero),foo)

expectation

sbt:hello> bar
[error] stack trace is suppressed; run last bar for the full output
[error] (bar) sbt.internal.util.Init$RuntimeUndefined: References to undefined settings at runtime.
[error] ScopedKey(Scope(Select(ProjectRef(file:/private/tmp/hello/,root)), Zero, Zero, Zero),foo) at LinePosition(/private/tmp/hello/build.sbt,14) referenced from setting(ScopedKey(Scope(Select(ProjectRef(file:/private/tmp/hello/,root)), Zero, Zero, Zero),bar))

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@eed3si9n eed3si9n merged commit ea4c008 into sbt:develop Mar 18, 2020
@nigredo-tori nigredo-tori deleted the patch-1 branch March 18, 2020 15:53
@eed3si9n eed3si9n added this to the 1.4.0 milestone Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants