I am using SBT 0.13.1 .
project / build.properties is as follows:
sbt.version=0.13.1
Running sbt about prints the following:
$ sbt [info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins [info] Loading project definition from /Users/jacek/sandbox/so/sbt-0.13.1/project [info] Set current project to sbt-0-13-1 (in build file:/Users/jacek/sandbox/so/sbt-0.13.1/) [sbt-0-13-1]> about [info] This is sbt 0.13.1 [info] The current project is {file:/Users/jacek/sandbox/so/sbt-0.13.1/}sbt-0-13-1 0.1-SNAPSHOT [info] The current project is built against Scala 2.10.4-RC1 [info] Available Plugins: com.typesafe.sbt.SbtGit, com.typesafe.sbt.SbtProguard, growl.GrowlingTests, np.Plugin, net.virtualvoid.sbt.graph.Plugin, com.timushev.sbt.updates.UpdatesPlugin [info] sbt, sbt plugins, and build definitions are using Scala 2.10.3
With the following task - hello - in build.sbt :
scalaVersion := "2.10.4-RC1" lazy val hello = taskKey[Unit]("An example task") hello := { print("Sleeping for a sec...") println("done.") }
... and reload , sbt reports [error] Type error in expression :
[sbt-0-13-1]> reload [info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins [info] Loading project definition from /Users/jacek/sandbox/so/sbt-0.13.1/project /Users/jacek/sandbox/so/sbt-0.13.1/build.sbt:6: error: type mismatch; found : String("Sleeping for a sec...") required: sbt.TaskKey[String] print("Sleeping for a sec...") ^ [error] Type error in expression Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
When I change print to println , the task is defined correctly.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? r [info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins [info] Loading project definition from /Users/jacek/sandbox/so/sbt-0.13.1/project [info] Set current project to sbt-0-13-1 (in build file:/Users/jacek/sandbox/so/sbt-0.13.1/) [sbt-0-13-1]> hello Sleeping for a sec... done. [success] Total time: 0 s, completed Jan 4, 2014 10:31:43 AM
Is print not specified in the task definition?
sbt
Jacek laskowski
source share