Skip to content

Commit

Permalink
Update to lm 2.0.0-alpha13 for sjson-new
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Nov 24, 2023
1 parent 8765457 commit 527919d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
7 changes: 5 additions & 2 deletions main/src/main/scala/sbt/Defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3043,7 +3043,10 @@ object Classpaths {
}
}).value,
moduleName := normalizedName.value,
ivyPaths := IvyPaths(baseDirectory.value, bootIvyHome(appConfiguration.value)),
ivyPaths := IvyPaths(
baseDirectory.value.toString,
bootIvyHome(appConfiguration.value).map(_.toString)
),
csrCacheDirectory := {
val old = csrCacheDirectory.value
val ac = appConfiguration.value
Expand All @@ -3055,7 +3058,7 @@ object Classpaths {
else if (ip.ivyHome == defaultIvyCache) old
else
ip.ivyHome match {
case Some(home) => home / "coursier-cache"
case Some(home) => new File(home) / "coursier-cache"
case _ => old
}
} else Classpaths.dummyCoursierDirectory(ac)
Expand Down
2 changes: 1 addition & 1 deletion main/src/main/scala/sbt/RemoteCache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ object RemoteCache {
val app = appConfiguration.value
val base = app.baseDirectory.getCanonicalFile
// base is used only to resolve relative paths, which should never happen
IvyPaths(base, localCacheDirectory.value)
IvyPaths(base.toString, localCacheDirectory.value.toString)
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ object CoursierRepositoriesTasks {
val result2 =
paths.ivyHome match {
case Some(ivyHome) =>
val ivyHomeUri = ivyHome.getPath
val ivyHomeUri = ivyHome
result1 map {
case r: FileRepository =>
val ivyPatterns = r.patterns.ivyPatterns map {
Expand Down
6 changes: 3 additions & 3 deletions main/src/main/scala/sbt/coursierint/LMCoursier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ object LMCoursier {
createLogger: Option[CacheLogger],
cacheDirectory: File,
reconciliation: Seq[(ModuleMatchers, Reconciliation)],
ivyHome: Option[File],
ivyHome: Option[String],
strict: Option[CStrict],
depsOverrides: Seq[ModuleID],
log: Logger
Expand Down Expand Up @@ -140,7 +140,7 @@ object LMCoursier {
createLogger: Option[CacheLogger],
cacheDirectory: File,
reconciliation: Seq[(ModuleMatchers, Reconciliation)],
ivyHome: Option[File],
ivyHome: Option[String],
strict: Option[CStrict],
depsOverrides: Seq[ModuleID],
updateConfig: Option[UpdateConfiguration],
Expand Down Expand Up @@ -192,7 +192,7 @@ object LMCoursier {
.withCache(cacheDirectory)
.withReconciliation(reconciliation.toVector)
.withLog(log)
.withIvyHome(ivyHome)
.withIvyHome(ivyHome.map(new File(_)))
.withStrict(strict)
.withForceVersions(userForceVersions.toVector)
.withMissingOk(missingOk)
Expand Down
9 changes: 5 additions & 4 deletions main/src/main/scala/sbt/internal/LibraryManagement.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ private[sbt] object LibraryManagement {
!force &&
!depsUpdated &&
!inChanged &&
out.allFiles.forall(f => fileUptodate(f, out.stamps, log)) &&
fileUptodate(out.cachedDescriptor, out.stamps, log)
out.allFiles.forall(f => fileUptodate(f.toString, out.stamps, log)) &&
fileUptodate(out.cachedDescriptor.toString, out.stamps, log)
}

/* Skip resolve if last output exists, otherwise error. */
Expand Down Expand Up @@ -166,7 +166,8 @@ private[sbt] object LibraryManagement {
handler((extraInputHash, settings, withoutClock))
}

private[this] def fileUptodate(file: File, stamps: Map[File, Long], log: Logger): Boolean = {
private[this] def fileUptodate(file0: String, stamps: Map[String, Long], log: Logger): Boolean = {
val file = File(file0)
val exists = file.exists
// https://github.com/sbt/sbt/issues/5292 warn the user that the file is missing since this indicates
// that UpdateReport was persisted but Coursier cache was not.
Expand All @@ -175,7 +176,7 @@ private[sbt] object LibraryManagement {
}
// coursier doesn't populate stamps
val timeStampIsSame = stamps
.get(file)
.get(file0)
.forall(_ == IO.getModifiedTimeOrZero(file))
exists && timeStampIsSame
}
Expand Down
4 changes: 3 additions & 1 deletion main/src/main/scala/sbt/internal/Load.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ private[sbt] object Load {
Attributed.blankSeq(provider.mainClasspath.toIndexedSeq ++ scalaProvider.jars.toIndexedSeq)
val ivyConfiguration =
InlineIvyConfiguration()
.withPaths(IvyPaths(baseDirectory, bootIvyHome(state.configuration)))
.withPaths(
IvyPaths(baseDirectory.toString, bootIvyHome(state.configuration).map(_.toString))
)
.withResolvers(Resolver.combineDefaultResolvers(Vector.empty))
.withLog(log)
val dependencyResolution = IvyDependencyResolution(ivyConfiguration)
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object Dependencies {
// sbt modules
private val ioVersion = nightlyVersion.getOrElse("1.8.0")
private val lmVersion =
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("2.0.0-alpha12")
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("2.0.0-alpha13")
val zincVersion = nightlyVersion.getOrElse("2.0.0-alpha6")

private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ abstract class IvyBridgeProviderSpecification
val resolvers = resolvers0.toVector
val chainResolver = ChainedResolver("zinc-chain", resolvers)
InlineIvyConfiguration()
.withPaths(IvyPaths(baseDirectory, Some(ivyHome)))
.withPaths(IvyPaths(baseDirectory.toString, Some(ivyHome.toString)))
.withResolvers(resolvers)
.withModuleConfigurations(Vector(ModuleConfiguration("*", chainResolver)))
.withLock(None)
Expand Down

0 comments on commit 527919d

Please sign in to comment.