我正在尝试在sbt中创建一个将输出自定义配置的完整类路径的任务,但是当sbt尝试加载项目定义时,我得到an undefined setting error
。我无法确定必须定义哪个设置:
import sbt.Keys._
import sbt._
object FoobarBuild extends Build {
lazy val ZK = config("zk")
lazy val fcp = TaskKey[String]("fcp", "create formatted classpath")
lazy val fcpTask = fcp <<= (fullClasspath in ZK) map { cp =>
println(cp.files.absString)
cp.files.absString
}
lazy val project = Project("foobar", file(".")).
configs(ZK).
settings(
name := "foobar",
version := "1.0",
scalaVersion := "2.11.7"
).
settings(fcpTask)
}
错误:
[info] Loading project definition from foobar/project
Reference to undefined setting:
zk:fullClasspath from *:fcp (/Users/gaston/mesosphere/foobar/project/Build.scala:7)
答案 0 :(得分:1)
zk:fullClasspath
为fullClasspath in ZK
。它是未定义的,因为它不是从任何其他配置设置或继承的,我相信。