Skip to content

Commit

Permalink
Alias withLatestSnapshots to withCachedSnapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedetrich committed Aug 26, 2023
1 parent 689f347 commit 8f0a35c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 8f0a35c

Please sign in to comment.