mirror of https://github.com/sbt/sbt.git
Update to lm 2.0.0-alpha13 for sjson-new
This commit is contained in:
parent
dd2dd44de3
commit
08966370b1
|
|
@ -17,7 +17,15 @@ import sbt.util.CacheImplicits._
|
|||
import sbt.util.{ CacheStore, FileInfo }
|
||||
import sbt.io.IO
|
||||
import sbt.librarymanagement.LibraryManagementCodec
|
||||
import sjsonnew.{ Builder, JsonFormat, Unbuilder, deserializationError }
|
||||
import sjsonnew.{
|
||||
Builder,
|
||||
IsoString,
|
||||
IsoStringLong,
|
||||
JsonFormat,
|
||||
PathOnlyFormats,
|
||||
Unbuilder,
|
||||
deserializationError,
|
||||
}
|
||||
import xsbti.{ FileConverter, VirtualFileRef }
|
||||
|
||||
/**
|
||||
|
|
@ -126,11 +134,20 @@ object Sync {
|
|||
}
|
||||
}
|
||||
|
||||
private lazy val fileIsoString: IsoString[File] =
|
||||
val iso = summon[IsoStringLong[File]]
|
||||
IsoString.iso(
|
||||
(file: File) => iso.to(file)._1,
|
||||
(s: String) => iso.from((s, 0)),
|
||||
)
|
||||
|
||||
def writeInfo[F <: FileInfo](
|
||||
store: CacheStore,
|
||||
relation: Relation[File, File],
|
||||
info: Map[File, F]
|
||||
)(implicit infoFormat: JsonFormat[F]): Unit =
|
||||
given IsoString[File] = fileIsoString
|
||||
import PathOnlyFormats.given
|
||||
store.write((relation, info))
|
||||
|
||||
def writeInfoVirtual[F <: FileInfo](
|
||||
|
|
@ -213,6 +230,8 @@ object Sync {
|
|||
private def readUncaught[F <: FileInfo](
|
||||
store: CacheStore
|
||||
)(implicit infoFormat: JsonFormat[F]): RelationInfo[F] =
|
||||
given IsoString[File] = fileIsoString
|
||||
import PathOnlyFormats.given
|
||||
store.read(default = (Relation.empty[File, File], Map.empty[File, F]))
|
||||
|
||||
private def readUncaughtVirtual[F <: FileInfo](
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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],
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
|
@ -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.
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -82,7 +82,7 @@ object Dependencies {
|
|||
// val lmCoursierShaded = "io.get-coursier" %% "lm-coursier-shaded" % "2.0.10"
|
||||
val lmCoursierShaded = "org.scala-sbt" %% "librarymanagement-coursier" % "2.0.0-alpha6"
|
||||
|
||||
lazy val sjsonNewVersion = "0.13.0"
|
||||
lazy val sjsonNewVersion = "0.14.0-M1"
|
||||
def sjsonNew(n: String) = Def.setting(
|
||||
"com.eed3si9n" %% n % sjsonNewVersion
|
||||
) // contrabandSjsonNewVersion.value
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue