Merge pull request #5584 from eed3si9n/fport/5583

Fixes appResolvers returning None
This commit is contained in:
eugene yokota 2020-05-31 01:03:47 -04:00 committed by GitHub
commit b1192c9021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 2 deletions

View File

@ -3781,12 +3781,25 @@ object Classpaths {
ivyRepo.descriptorOptional
} catch { case _: NoSuchMethodError => false }
// for forward-compatibility with launcher.jar prior to 1.3.11
private[this] def mavenRepoAllowInsecureProtocol(mavenRepo: xsbti.MavenRepository): Boolean =
try {
mavenRepo.allowInsecureProtocol
} catch { case _: NoSuchMethodError => false }
// for forward-compatibility with launcher.jar prior to 1.3.11
private[this] def allowInsecureProtocol(ivyRepo: xsbti.IvyRepository): Boolean =
try {
ivyRepo.allowInsecureProtocol
} catch { case _: NoSuchMethodError => false }
@com.github.ghik.silencer.silent
private[this] def bootRepository(repo: xsbti.Repository): Resolver = {
import xsbti.Predefined
repo match {
case m: xsbti.MavenRepository =>
MavenRepository(m.id, m.url.toString).withAllowInsecureProtocol(m.allowInsecureProtocol)
MavenRepository(m.id, m.url.toString)
.withAllowInsecureProtocol(mavenRepoAllowInsecureProtocol(m))
case i: xsbti.IvyRepository =>
val patterns = Patterns(
Vector(i.ivyPattern),
@ -3801,7 +3814,9 @@ object Classpaths {
val file = IO.toFile(i.url)
Resolver.file(i.id, file)(patterns)
case _ =>
Resolver.url(i.id, i.url)(patterns).withAllowInsecureProtocol(i.allowInsecureProtocol)
Resolver
.url(i.id, i.url)(patterns)
.withAllowInsecureProtocol(allowInsecureProtocol(i))
}
case p: xsbti.PredefinedRepository =>
p.id match {