Skip to content

Commit c959cdf

Browse files
committed
Alias withLatestSnapshots to withCachedSnapshots
1 parent 689f347 commit c959cdf

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ private[sbt] object IvySbt {
541541
val delegate = ivyint.SbtChainResolver(delegatedName, rest, settings, updateOptions, log)
542542
val initialResolvers = projectResolvers :+ delegate
543543
val freshOptions = UpdateOptions()
544-
.withLatestSnapshots(false)
544+
.withCachedSnapshots(true)
545545
.withModuleResolvers(updateOptions.moduleResolvers)
546546
ivyint.SbtChainResolver(name, initialResolvers, settings, freshOptions, log)
547547
}

ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private[sbt] case class SbtChainResolver(
227227
if (resolvedModule.getId.getRevision.contains("SNAPSHOT")) {
228228

229229
Message.warn(
230-
"Resolving a snapshot version. It's going to be slow unless you use `updateOptions := updateOptions.value.withLatestSnapshots(false)` options."
230+
"Resolving a snapshot version. It's going to be slow unless you use `updateOptions := updateOptions.value.withCachedSnapshots(true)` options."
231231
)
232232
val resolvers = sortedRevisions.map(_._2.getName)
233233
sortedRevisions.foreach(h => {

ivy/src/main/scala/sbt/librarymanagement/ivy/UpdateOptions.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ final class UpdateOptions private[sbt] (
3535
copy(circularDependencyLevel = circularDependencyLevel)
3636
def withInterProjectFirst(interProjectFirst: Boolean): UpdateOptions =
3737
copy(interProjectFirst = interProjectFirst)
38+
@deprecated("Use withCachedSnapshots instead with opposite boolean values", "1.9.2")
3839
def withLatestSnapshots(latestSnapshots: Boolean): UpdateOptions =
39-
copy(latestSnapshots = latestSnapshots)
40+
withCachedSnapshots(!latestSnapshots)
41+
def withCachedSnapshots(cachedSnapshots: Boolean): UpdateOptions
42+
copy(latestSnapshots = !cachedResolution)
4043
def withCachedResolution(cachedResolution: Boolean): UpdateOptions =
4144
copy(cachedResolution = cachedResolution)
4245

ivy/src/test/scala/sbt/internal/librarymanagement/UpdateOptionsSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class UpdateOptionsSpec extends BasicTestSuite {
1515
UpdateOptions()
1616
.withCircularDependencyLevel(CircularDependencyLevel.Error)
1717
.withCachedResolution(true)
18-
.withLatestSnapshots(false)
18+
.withCachedSnapshots(true)
1919
.toString() == """|UpdateOptions(
2020
| circularDependencyLevel = error,
21-
| latestSnapshots = false,
21+
| cachedSnapshots = true,
2222
| cachedResolution = true
2323
|)""".stripMargin
2424
)

0 commit comments

Comments
 (0)