Skip to content

better diagnostics when insufficient scope axes are specified #135

harrah opened this Issue Jan 5, 2013 · 1 comment

1 participant

harrah commented Jan 5, 2013

We've discussed this previously on the ML. Perhaps best motivated by a short reading from "SBT 0.10: Amateur Hour"

gseitz: in sbt-0.10, how can I make a setting in projectB depend on a setting in project A?
gseitz: scalacOptions <+= (packagedArtifact in projectA) map (...) did not work, because packagedArtifact is not initialized in the settings graph
retronym: (packagedArtifact in Compile in projectA) ?
retronym: gseitz: that unitialized error usually means you are missing an axis in the scoping
gseitz: retronym: i see, didn't know you can change the "in scope", but it's still uninitialized
retronym: try: packagedArtifact in packageBin in projectA
gseitz: still uninitialized :/
retronym: boooo
gseitz: retronym: though the setting name that sbt believe's to be uninitialized looks good
retronym: gseitz; you need the task, config, and project axes filled
retronym: TaskKey[Unit]("foo") <<= (packagedArtifact in Compile in projectA in packageBin) map { (x) => println(x) }
gseitz: retronym: genius, thanks
retronym: not sure how to discover it in the console
retronym: but in Defaults.scala, you'll see stuff like
retronym: lazy val defaultConfigs: Seq[Setting[_]] = inConfig(Compile)(compileSettings)
retronym: packageTasks(packageBin, packageBinTask)
retronym: def packageTasks(key: TaskKey[File], mappingsTask: Initialize[Task[Seq[(File,String)]]]) = inTask(key)( Seq(…))
gseitz: ah, there it is. easy to overlook

Clippy might have popped up and suggested that "it seems like you're trying to refer to ..."

harrah commented Jan 5, 2013

IMPORTANT This project has moved to This issue still exists to avoid dead links, but GitHub limitations prevent the original issue from being correctly preserved here. Please see sbt/sbt#135 for the full issue and to comment.

@harrah harrah closed this Jan 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.