我想创建一个发布到特定目录的任务。我试过这个:
import sbt._
import Keys._
object SampleStuff extends Plugin {
lazy val someCmd = taskKey[Unit]("some command")
val someCmdValue = publishTo in someCmd := Some(Resolver.file("file", new File( "path/to/my/maven-repo/releases")))
override def settings = Seq(
someCmdValue,
someCmd := { println(s"publishing to the place; ${publish.value}") }
)
}
我认为someCmd 中的 publishTo会在执行someCmd时设置publishTo的值,但事实并非如此。我错过了什么?