我的示例sbt插件使用scala版本2.10.6編譯得很好。 我想在sbt插件build.sbt中升級scalaVersion:=「2.11.7」。使用scala版本訪問sbt插件中的依賴項(而非子項)2.11.7
它打破與followinng CTE: -
/Users/mogli/gitrepos/study/SbtPlugins/ScalaPlugin/src/main/scala/base/BasePlugin.scala:21: 不能展開宏由斯卡拉[錯誤]
VAL項目的早期版本編譯= thisProject.value.dependencies
這是工作的罰款與scalaVersion:如以下問題建議通過微Dotta =「2.10.6」: -
accessing dependent (not child) projects in sbt plugin
簡體SBT插件BasePlugin.scala:
package base
import sbt.{ThisBuild, Def, TaskKey, AutoPlugin}
import sbt._
import Keys._
object BasePlugin extends AutoPlugin {
object autoImport {
lazy val customtask: TaskKey[Unit] = TaskKey("customtask")
}
import autoImport.customtask
override def projectSettings: Seq[Def.Setting[_]] = Seq(
customtask := {
val projects = thisProject.value.dependencies
projects map println
}
)
}
如何獲得它scalaVersion工作:= 「2.11.7」?我想這個插件與使用財政版本11