relax dependency-management/compiler-bridge-binary

This commit is contained in:
Eugene Yokota 2019-04-17 21:46:37 -04:00
parent 21782a51f0
commit 35a0ee4321
2 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,6 @@
scalaVersion := "2.12.6"
ThisBuild / scalaVersion := "2.12.6"
lazy val check = taskKey[Unit]("")
// We can't use "%%" here without breaking the "== bridgeModule" check below
val bridgeModule = "org.scala-sbt" % s"compiler-bridge_2.12" % "1.2.1"
@ -10,7 +12,14 @@ scalaCompilerBridgeSource := "shouldnotbeused" % "dummy" % "dummy"
scalaCompilerBridgeBinaryJar := {
for {
toolReport <- update.value.configuration(Configurations.ScalaTool)
m <- toolReport.modules.find(m => m.module == bridgeModule)
m <- toolReport.modules.find(m => m.module.name == bridgeModule.name)
(_, file) <- m.artifacts.find(art => art._1.`type` == Artifact.DefaultType)
} yield file
}
check := {
val toolReport = update.value.configuration(Configurations.ScalaTool).get
val m = toolReport.modules.find(m => m.module.name == bridgeModule.name)
val bridge = scalaCompilerBridgeBinaryJar.value
bridge.getOrElse(sys.error(s"bridge JAR is missing: $toolReport"))
}

View File

@ -1 +1,2 @@
> check
> compile