From 8f0a35cbc2dfbb20bb8f25170fdfc9f96f49dc69 Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Sat, 26 Aug 2023 11:23:11 +0200 Subject: [PATCH] Alias withLatestSnapshots to withCachedSnapshots --- ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala | 2 +- .../internal/librarymanagement/ivyint/SbtChainResolver.scala | 2 +- .../main/scala/sbt/librarymanagement/ivy/UpdateOptions.scala | 5 ++++- .../sbt/internal/librarymanagement/UpdateOptionsSpec.scala | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala index 4fbdbce4..844da36d 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala @@ -541,7 +541,7 @@ private[sbt] object IvySbt { val delegate = ivyint.SbtChainResolver(delegatedName, rest, settings, updateOptions, log) val initialResolvers = projectResolvers :+ delegate val freshOptions = UpdateOptions() - .withLatestSnapshots(false) + .withCachedSnapshots(true) .withModuleResolvers(updateOptions.moduleResolvers) ivyint.SbtChainResolver(name, initialResolvers, settings, freshOptions, log) } diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala index 9dfd3b83..e64c1dc1 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala @@ -227,7 +227,7 @@ private[sbt] case class SbtChainResolver( if (resolvedModule.getId.getRevision.contains("SNAPSHOT")) { Message.warn( - "Resolving a snapshot version. It's going to be slow unless you use `updateOptions := updateOptions.value.withLatestSnapshots(false)` options." + "Resolving a snapshot version. It's going to be slow unless you use `updateOptions := updateOptions.value.withCachedSnapshots(true)` options." ) val resolvers = sortedRevisions.map(_._2.getName) sortedRevisions.foreach(h => { diff --git a/ivy/src/main/scala/sbt/librarymanagement/ivy/UpdateOptions.scala b/ivy/src/main/scala/sbt/librarymanagement/ivy/UpdateOptions.scala index 1fa856d0..6e41544f 100644 --- a/ivy/src/main/scala/sbt/librarymanagement/ivy/UpdateOptions.scala +++ b/ivy/src/main/scala/sbt/librarymanagement/ivy/UpdateOptions.scala @@ -35,8 +35,11 @@ final class UpdateOptions private[sbt] ( copy(circularDependencyLevel = circularDependencyLevel) def withInterProjectFirst(interProjectFirst: Boolean): UpdateOptions = copy(interProjectFirst = interProjectFirst) + @deprecated("Use withCachedSnapshots instead with opposite boolean values", "1.9.2") def withLatestSnapshots(latestSnapshots: Boolean): UpdateOptions = - copy(latestSnapshots = latestSnapshots) + withCachedSnapshots(!latestSnapshots) + def withCachedSnapshots(cachedSnapshots: Boolean): UpdateOptions + copy(latestSnapshots = !cachedResolution) def withCachedResolution(cachedResolution: Boolean): UpdateOptions = copy(cachedResolution = cachedResolution) diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/UpdateOptionsSpec.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/UpdateOptionsSpec.scala index 5729bd06..cb50cdda 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/UpdateOptionsSpec.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/UpdateOptionsSpec.scala @@ -15,10 +15,10 @@ class UpdateOptionsSpec extends BasicTestSuite { UpdateOptions() .withCircularDependencyLevel(CircularDependencyLevel.Error) .withCachedResolution(true) - .withLatestSnapshots(false) + .withCachedSnapshots(true) .toString() == """|UpdateOptions( | circularDependencyLevel = error, - | latestSnapshots = false, + | cachedSnapshots = true, | cachedResolution = true |)""".stripMargin )