mirror of https://github.com/sbt/sbt.git
OverrideScalaMediator: fix bootstrapping a Scala compiler
Fixes #2867, #2896
This commit is contained in:
parent
c223dccb54
commit
0d0476eaa9
|
|
@ -64,13 +64,22 @@ private object IvyScala {
|
||||||
// Mediate only for the dependencies in scalaVersion configurations. https://github.com/sbt/sbt/issues/2786
|
// Mediate only for the dependencies in scalaVersion configurations. https://github.com/sbt/sbt/issues/2786
|
||||||
def configQualifies: Boolean =
|
def configQualifies: Boolean =
|
||||||
(dd.getModuleConfigurations exists { scalaVersionConfigs })
|
(dd.getModuleConfigurations exists { scalaVersionConfigs })
|
||||||
|
// Do not rewrite the dependencies of Scala dependencies themselves, this prevents bootstrapping
|
||||||
|
// a Scala compiler using another Scala compiler.
|
||||||
|
def dependeeQualifies: Boolean =
|
||||||
|
dd.getParentRevisionId.getName match {
|
||||||
|
case name @ (CompilerID | LibraryID | ReflectID | ActorsID | ScalapID) =>
|
||||||
|
false
|
||||||
|
case _ =>
|
||||||
|
true
|
||||||
|
}
|
||||||
val transformer =
|
val transformer =
|
||||||
new NamespaceTransformer {
|
new NamespaceTransformer {
|
||||||
def transform(mrid: ModuleRevisionId): ModuleRevisionId = {
|
def transform(mrid: ModuleRevisionId): ModuleRevisionId = {
|
||||||
if (mrid == null) mrid
|
if (mrid == null) mrid
|
||||||
else
|
else
|
||||||
mrid.getName match {
|
mrid.getName match {
|
||||||
case name @ (CompilerID | LibraryID | ReflectID | ActorsID | ScalapID) if configQualifies =>
|
case name @ (CompilerID | LibraryID | ReflectID | ActorsID | ScalapID) if configQualifies && dependeeQualifies =>
|
||||||
ModuleRevisionId.newInstance(scalaOrganization, name, mrid.getBranch, scalaVersion, mrid.getQualifiedExtraAttributes)
|
ModuleRevisionId.newInstance(scalaOrganization, name, mrid.getBranch, scalaVersion, mrid.getQualifiedExtraAttributes)
|
||||||
case _ => mrid
|
case _ => mrid
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue