Fix #5110: allow semanticdbVersion override

This commit is contained in:
Filipe Regadas 2019-10-18 16:48:36 +01:00
parent e4ee8d4a7f
commit a451200bad
No known key found for this signature in database
GPG Key ID: 56776825923FC777
4 changed files with 31 additions and 5 deletions

View File

@ -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

View File

@ -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")
}

View File

@ -0,0 +1,7 @@
package foo
object Test {
def main(args: Array[String]): Unit = {
println("hello world")
}
}

View File

@ -0,0 +1 @@
> check