代替
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5")
Run Code Online (Sandbox Code Playgroud)
添加这些行plugins.sbt:
libraryDependencies ++= {
if (baseDirectory.value / "../.git" isDirectory)
Seq(Defaults.sbtPluginExtra("com.typesafe.sbt" % "sbt-git" % "0.8.5", (sbtBinaryVersion in update).value, (scalaBinaryVersion in update).value))
else {
println("sbt-git plugin not loaded")
Seq.empty
}
}
Run Code Online (Sandbox Code Playgroud)
使用 SBT 0.13.9 进行测试。
更新:
它也适用于 SBT 1.7.1,但语法略有不同:
libraryDependencies ++= {
if (baseDirectory.value / "../.git" isDirectory)
Seq(Defaults.sbtPluginExtra("com.typesafe.sbt" % "sbt-git" % "0.8.5", (update/sbtBinaryVersion).value, (update/scalaBinaryVersion).value))
else {
println("sbt-git plugin not loaded")
Seq.empty
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
298 次 |
| 最近记录: |