Merge pull request #294 from alexarchambault/update/coursier-2.0.7

Update coursier to 2.0.7
This commit is contained in:
Alexandre Archambault 2020-11-18 19:39:54 +01:00 committed by GitHub
commit 103665b72f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -15,7 +15,7 @@ inThisBuild(List(
)
))
val coursierVersion0 = "2.0.6"
val coursierVersion0 = "2.0.7"
lazy val `lm-coursier` = project
.in(file("modules/lm-coursier"))
@ -54,7 +54,8 @@ lazy val `lm-coursier-shaded` = project
"argonaut",
"org.fusesource",
"macrocompat",
"io.github.alexarchambault.windowsansi"
"io.github.alexarchambault.windowsansi",
"concurrentrefhashmap"
)
for (ns <- toShade)
yield ShadingRule.moveUnder(ns, "lmcoursier.internal.shaded")

View File

@ -1,10 +1,11 @@
package lmcoursier.internal
import coursier.ivy.IvyRepository
import java.net.MalformedURLException
import java.nio.file.Paths
import coursier.cache.CacheUrl
import coursier.core.{Authentication, Repository}
import coursier.ivy.IvyRepository
import coursier.maven.MavenRepository
import org.apache.ivy.plugins.resolver.IBiblioResolver
import sbt.librarymanagement.{Configuration => _, MavenRepository => _, _}
@ -54,7 +55,14 @@ object Resolvers {
// this handles whitespace in path
private def pathToUriString(path: String): String = {
"file://" + path.replaceAllLiterally(" ", "%20")
val stopAtIdx = path.indexWhere(c => c == '[' || c == '$' || c == '(')
if (stopAtIdx > 0) {
val (pathPart, patternPart) = path.splitAt(stopAtIdx)
Paths.get(pathPart).toUri.toASCIIString + patternPart
} else if (stopAtIdx == 0)
"file://" + path
else
Paths.get(path).toUri.toASCIIString
}
def repository(