mirror of https://github.com/sbt/sbt.git
Fixes #2686 by resetting scalaVersion for updateSbtClassifiers
Ref #2634 updateSbtClassifiers uses an artificially created dependency graph set in classifiersModule. The problem is that ivyScala instance is reused from the outer scope that has the user project's scalaVersion as demonstrated as follows: scala> val is = (ivyScala in updateSbtClassifiers).eval is: Option[sbt.IvyScala] = Some(IvyScala(2.9.3,2.9.3,List(),true,false,true,org.scala-lang)) This change fixes #2686 by redefining ivyScala with scalaVersion and scalaBinaryVersion scoped to updateSbtClassifiers task. The existing scripted test was modified to reproduce the bug.
This commit is contained in:
parent
c1648ac0a5
commit
f3817ad64f
|
|
@ -1413,6 +1413,14 @@ object Classpaths {
|
||||||
val pluginIDs: Vector[ModuleID] = pluginJars.flatMap(_ get moduleID.key)
|
val pluginIDs: Vector[ModuleID] = pluginJars.flatMap(_ get moduleID.key)
|
||||||
GetClassifiersModule(pid, sbtDep +: pluginIDs, Vector(Configurations.Default), classifiers.toVector)
|
GetClassifiersModule(pid, sbtDep +: pluginIDs, Vector(Configurations.Default), classifiers.toVector)
|
||||||
}).value,
|
}).value,
|
||||||
|
// Redefine scalaVersion and scalaBinaryVersion specifically for the dependency graph used for updateSbtClassifiers task.
|
||||||
|
// to fix https://github.com/sbt/sbt/issues/2686
|
||||||
|
scalaVersion := appConfiguration.value.provider.scalaProvider.version,
|
||||||
|
scalaBinaryVersion := binaryScalaVersion(scalaVersion.value),
|
||||||
|
ivyScala := {
|
||||||
|
Some(IvyScala(scalaVersion.value, scalaBinaryVersion.value, Vector(), checkExplicit = false, filterImplicit = false,
|
||||||
|
overrideScalaVersion = true).withScalaOrganization(scalaOrganization.value))
|
||||||
|
},
|
||||||
updateSbtClassifiers in TaskGlobal := (Def.task {
|
updateSbtClassifiers in TaskGlobal := (Def.task {
|
||||||
val s = streams.value
|
val s = streams.value
|
||||||
val is = ivySbt.value
|
val is = ivySbt.value
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
scalaVersion := "2.9.2"
|
||||||
Loading…
Reference in New Issue