1
我讀的是sbt tutorial,我想了解依賴於其他任務的任務部分。問題是,我創建了從該教程以下,但它不工作:具有依賴關係的Sbt任務
import sbt._
import Keys._
import sys.process._
object HelloBuild extends Build {
val hwsettings = Defaults.defaultSettings ++ Seq (
scalaVersion := "2.9.1",
name := "sbt-build"
)
val intt = TaskKey[Int]("int-task")
val intTask = intt := 1
val sample = TaskKey[Int]("sample-task")
val sampleTask = sample <<= intTask map { _ + 1 }
lazy val project = Project (
"project",
file("."),
settings = hwsettings ++ Seq(intTask)
)
}
它說:
[error] /home/platon/Tor/sbt-build/project/Build.scala:21: type mismatch;
[error] found : Int(1)
[error] required: String
[error] val sampleTask = sample <<= intTask map { _ + 1 }
我在做什麼錯?
啊,愚蠢的錯誤:) – Rogach 2012-02-15 15:53:47