mirror of https://github.com/sbt/sbt.git
Fix #5110: allow semanticdbVersion override
This commit is contained in:
parent
e4ee8d4a7f
commit
a451200bad
|
|
@ -21,14 +21,14 @@ object SemanticdbPlugin extends AutoPlugin {
|
|||
semanticdbEnabled := false,
|
||||
semanticdbIncludeInJar := false,
|
||||
semanticdbOptions := List("-Yrangepos"),
|
||||
semanticdbVersion := "4.1.0",
|
||||
semanticdbCompilerPlugin := {
|
||||
val v = semanticdbVersion.value
|
||||
("org.scalameta" % "semanticdb-scalac" % v).cross(CrossVersion.full)
|
||||
}
|
||||
semanticdbVersion := "4.1.0"
|
||||
)
|
||||
|
||||
override lazy val projectSettings = Seq(
|
||||
semanticdbCompilerPlugin := {
|
||||
val v = semanticdbVersion.value
|
||||
("org.scalameta" % "semanticdb-scalac" % v).cross(CrossVersion.full)
|
||||
},
|
||||
allDependencies ++= {
|
||||
val sdb = semanticdbEnabled.value
|
||||
val m = semanticdbCompilerPlugin.value
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
ThisBuild / scalaVersion := "2.12.8"
|
||||
ThisBuild / semanticdbEnabled := true
|
||||
ThisBuild / semanticdbVersion := "4.2.3"
|
||||
ThisBuild / semanticdbIncludeInJar := false
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
|
||||
lazy val check = taskKey[Unit]("Checks the configured semanticdbVersion")
|
||||
|
||||
check := {
|
||||
val expected = Some("4.2.3")
|
||||
val actual = allDependencies
|
||||
.value
|
||||
.find(_.name == "semanticdb-scalac")
|
||||
.map(_.revision)
|
||||
|
||||
assert(actual == expected, s"Expected version to be $expected, was $actual")
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package foo
|
||||
|
||||
object Test {
|
||||
def main(args: Array[String]): Unit = {
|
||||
println("hello world")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> check
|
||||
Loading…
Reference in New Issue