Given a build.sbt of
version := "0.0.1"
org.scalastyle.sbt.ScalastylePlugin.Settings
val t = taskKey[Unit]("task")
t := {
// org.scalastyle.sbt.PluginKeys.scalastyle is an input key
val ignored = org.scalastyle.sbt.PluginKeys.scalastyle.evaluated
// should be
// val ignored = org.scalastyle.sbt.PluginKeys.scalastyle.toTask("").value
}
and project/plugins.sbt of
resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/"
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.4.0")
sbt.version = 0.13.1
When reloading sbt, the following message is given:
C:\temp\ff\build.sbt:9: error: `value` can only be called on an input task
within a task definition macro, such as := or Def.inputTask.
val ignored = org.scalastyle.sbt.PluginKeys.scalastyle.evaluated
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
This is confusing, because it refers to value, not evaluated. What would be nice would be to say something along the lines of 'should you be using toTask()'
Guys how to deal with this ?
lazy val startServer = taskKey[Unit]("Start PingPong Server before running JS tests")
(startServer in Test) := {
println("Starting server!!!")
val main = (runMain in Compile).fullInput("com.example.PingPongClient")
}
error: `value` can only be called on an input task within a task definition macro, such as := or Def.inputTask.
Still an issue in sbt 1.x.x.
Most helpful comment
Still an issue in sbt 1.x.x.