mirror of https://github.com/sbt/sbt.git
Merge pull request #8111 from xuwei-k/implicit-explicit-using
[2.x] add `using` if explicitly providing arguments to methods defined with `implicit`
This commit is contained in:
commit
e59923dd5a
|
|
@ -91,7 +91,7 @@ trait ContextUtil[C <: Quotes & scala.Singleton](val valStart: Int):
|
|||
getAnnotation(tree) match
|
||||
case Some(annot) =>
|
||||
annot.asExprOf[cacheLevel] match
|
||||
case '{ cacheLevel(include = Array.empty[CacheLevelTag]($_)) } => Nil
|
||||
case '{ cacheLevel(include = Array.empty[CacheLevelTag](using $_)) } => Nil
|
||||
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
|
||||
include.value.get.toList
|
||||
case _ => sys.error(Printer.TreeStructure.show(annot) + " does not match")
|
||||
|
|
|
|||
|
|
@ -149,13 +149,15 @@ private[librarymanagement] abstract class ResolverFunctions {
|
|||
MavenRepository("typesafe-" + status, TypesafeRepositoryRoot + "/" + status)
|
||||
def typesafeIvyRepo(status: String) =
|
||||
url("typesafe-ivy-" + status, new URI(TypesafeRepositoryRoot + "/ivy-" + status + "/").toURL)(
|
||||
ivyStylePatterns
|
||||
using ivyStylePatterns
|
||||
)
|
||||
def sbtIvyRepo(status: String) =
|
||||
url(s"sbt-ivy-$status", new URI(s"$SbtRepositoryRoot/ivy-$status/").toURL)(ivyStylePatterns)
|
||||
url(s"sbt-ivy-$status", new URI(s"$SbtRepositoryRoot/ivy-$status/").toURL)(using
|
||||
ivyStylePatterns
|
||||
)
|
||||
def sbtPluginRepo(status: String) =
|
||||
url("sbt-plugin-" + status, new URI(SbtRepositoryRoot + "/sbt-plugin-" + status + "/").toURL)(
|
||||
ivyStylePatterns
|
||||
using ivyStylePatterns
|
||||
)
|
||||
@deprecated(
|
||||
"""Use sonatypeOssRepos instead e.g. `resolvers ++= Resolver.sonatypeOssRepos("snapshots")`""",
|
||||
|
|
@ -177,7 +179,7 @@ private[librarymanagement] abstract class ResolverFunctions {
|
|||
def bintrayRepo(owner: String, repo: String) =
|
||||
MavenRepository(s"bintray-$owner-$repo", s"https://dl.bintray.com/$owner/$repo/")
|
||||
def bintrayIvyRepo(owner: String, repo: String) =
|
||||
url(s"bintray-$owner-$repo", new URI(s"https://dl.bintray.com/$owner/$repo/").toURL)(
|
||||
url(s"bintray-$owner-$repo", new URI(s"https://dl.bintray.com/$owner/$repo/").toURL)(using
|
||||
Resolver.ivyStylePatterns
|
||||
)
|
||||
def jcenterRepo = JCenterRepository
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ object ResolverTest extends UnitSpec {
|
|||
val pats = Vector("[orgPath]")
|
||||
val patsExpected = Vector("http://foo.com/test/[orgPath]")
|
||||
val patterns = Resolver
|
||||
.url("test", new URI("http://foo.com/test").toURL)(
|
||||
.url("test", new URI("http://foo.com/test").toURL)(using
|
||||
Patterns(
|
||||
pats,
|
||||
pats,
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ object ResolutionRun {
|
|||
Task.point(Right(value))
|
||||
}
|
||||
|
||||
retry(0, period).unsafeRun()(resolveTask.cache.ec)
|
||||
retry(0, period).unsafeRun()(using resolveTask.cache.ec)
|
||||
}
|
||||
|
||||
finalResult match {
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ trait UpdateOptionsFormat {
|
|||
import sjsonnew.support.scalajson.unsafe.*
|
||||
val moduleIdFormat: JsonFormat[ModuleID] = implicitly[JsonFormat[ModuleID]]
|
||||
def write(key: ModuleID): String =
|
||||
CompactPrinter(Converter.toJsonUnsafe(key)(moduleIdFormat))
|
||||
CompactPrinter(Converter.toJsonUnsafe(key)(using moduleIdFormat))
|
||||
def read(key: String): ModuleID =
|
||||
Converter.fromJsonUnsafe[ModuleID](Parser.parseUnsafe(key))(moduleIdFormat)
|
||||
Converter.fromJsonUnsafe[ModuleID](Parser.parseUnsafe(key))(using moduleIdFormat)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue