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.util.{ CacheStore, FileInfo }
|
||||||
import sbt.io.IO
|
import sbt.io.IO
|
||||||
import sbt.librarymanagement.LibraryManagementCodec
|
import sbt.librarymanagement.LibraryManagementCodec
|
||||||
import sjsonnew.{ Builder, JsonFormat, Unbuilder, deserializationError }
|
import sjsonnew.{
|
||||||
|
Builder,
|
||||||
|
IsoString,
|
||||||
|
IsoStringLong,
|
||||||
|
JsonFormat,
|
||||||
|
PathOnlyFormats,
|
||||||
|
Unbuilder,
|
||||||
|
deserializationError,
|
||||||
|
}
|
||||||
import xsbti.{ FileConverter, VirtualFileRef }
|
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](
|
def writeInfo[F <: FileInfo](
|
||||||
store: CacheStore,
|
store: CacheStore,
|
||||||
relation: Relation[File, File],
|
relation: Relation[File, File],
|
||||||
info: Map[File, F]
|
info: Map[File, F]
|
||||||
)(implicit infoFormat: JsonFormat[F]): Unit =
|
)(implicit infoFormat: JsonFormat[F]): Unit =
|
||||||
|
given IsoString[File] = fileIsoString
|
||||||
|
import PathOnlyFormats.given
|
||||||
store.write((relation, info))
|
store.write((relation, info))
|
||||||
|
|
||||||
def writeInfoVirtual[F <: FileInfo](
|
def writeInfoVirtual[F <: FileInfo](
|
||||||
|
|
@ -213,6 +230,8 @@ object Sync {
|
||||||
private def readUncaught[F <: FileInfo](
|
private def readUncaught[F <: FileInfo](
|
||||||
store: CacheStore
|
store: CacheStore
|
||||||
)(implicit infoFormat: JsonFormat[F]): RelationInfo[F] =
|
)(implicit infoFormat: JsonFormat[F]): RelationInfo[F] =
|
||||||
|
given IsoString[File] = fileIsoString
|
||||||
|
import PathOnlyFormats.given
|
||||||
store.read(default = (Relation.empty[File, File], Map.empty[File, F]))
|
store.read(default = (Relation.empty[File, File], Map.empty[File, F]))
|
||||||
|
|
||||||
private def readUncaughtVirtual[F <: FileInfo](
|
private def readUncaughtVirtual[F <: FileInfo](
|
||||||
|
|
|
||||||
|
|
@ -3043,7 +3043,10 @@ object Classpaths {
|
||||||
}
|
}
|
||||||
}).value,
|
}).value,
|
||||||
moduleName := normalizedName.value,
|
moduleName := normalizedName.value,
|
||||||
ivyPaths := IvyPaths(baseDirectory.value, bootIvyHome(appConfiguration.value)),
|
ivyPaths := IvyPaths(
|
||||||
|
baseDirectory.value.toString,
|
||||||
|
bootIvyHome(appConfiguration.value).map(_.toString)
|
||||||
|
),
|
||||||
csrCacheDirectory := {
|
csrCacheDirectory := {
|
||||||
val old = csrCacheDirectory.value
|
val old = csrCacheDirectory.value
|
||||||
val ac = appConfiguration.value
|
val ac = appConfiguration.value
|
||||||
|
|
@ -3055,7 +3058,7 @@ object Classpaths {
|
||||||
else if (ip.ivyHome == defaultIvyCache) old
|
else if (ip.ivyHome == defaultIvyCache) old
|
||||||
else
|
else
|
||||||
ip.ivyHome match {
|
ip.ivyHome match {
|
||||||
case Some(home) => home / "coursier-cache"
|
case Some(home) => new File(home) / "coursier-cache"
|
||||||
case _ => old
|
case _ => old
|
||||||
}
|
}
|
||||||
} else Classpaths.dummyCoursierDirectory(ac)
|
} else Classpaths.dummyCoursierDirectory(ac)
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ object RemoteCache {
|
||||||
val app = appConfiguration.value
|
val app = appConfiguration.value
|
||||||
val base = app.baseDirectory.getCanonicalFile
|
val base = app.baseDirectory.getCanonicalFile
|
||||||
// base is used only to resolve relative paths, which should never happen
|
// 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 =
|
val result2 =
|
||||||
paths.ivyHome match {
|
paths.ivyHome match {
|
||||||
case Some(ivyHome) =>
|
case Some(ivyHome) =>
|
||||||
val ivyHomeUri = ivyHome.getPath
|
val ivyHomeUri = ivyHome
|
||||||
result1 map {
|
result1 map {
|
||||||
case r: FileRepository =>
|
case r: FileRepository =>
|
||||||
val ivyPatterns = r.patterns.ivyPatterns map {
|
val ivyPatterns = r.patterns.ivyPatterns map {
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ object LMCoursier {
|
||||||
createLogger: Option[CacheLogger],
|
createLogger: Option[CacheLogger],
|
||||||
cacheDirectory: File,
|
cacheDirectory: File,
|
||||||
reconciliation: Seq[(ModuleMatchers, Reconciliation)],
|
reconciliation: Seq[(ModuleMatchers, Reconciliation)],
|
||||||
ivyHome: Option[File],
|
ivyHome: Option[String],
|
||||||
strict: Option[CStrict],
|
strict: Option[CStrict],
|
||||||
depsOverrides: Seq[ModuleID],
|
depsOverrides: Seq[ModuleID],
|
||||||
log: Logger
|
log: Logger
|
||||||
|
|
@ -140,7 +140,7 @@ object LMCoursier {
|
||||||
createLogger: Option[CacheLogger],
|
createLogger: Option[CacheLogger],
|
||||||
cacheDirectory: File,
|
cacheDirectory: File,
|
||||||
reconciliation: Seq[(ModuleMatchers, Reconciliation)],
|
reconciliation: Seq[(ModuleMatchers, Reconciliation)],
|
||||||
ivyHome: Option[File],
|
ivyHome: Option[String],
|
||||||
strict: Option[CStrict],
|
strict: Option[CStrict],
|
||||||
depsOverrides: Seq[ModuleID],
|
depsOverrides: Seq[ModuleID],
|
||||||
updateConfig: Option[UpdateConfiguration],
|
updateConfig: Option[UpdateConfiguration],
|
||||||
|
|
@ -192,7 +192,7 @@ object LMCoursier {
|
||||||
.withCache(cacheDirectory)
|
.withCache(cacheDirectory)
|
||||||
.withReconciliation(reconciliation.toVector)
|
.withReconciliation(reconciliation.toVector)
|
||||||
.withLog(log)
|
.withLog(log)
|
||||||
.withIvyHome(ivyHome)
|
.withIvyHome(ivyHome.map(new File(_)))
|
||||||
.withStrict(strict)
|
.withStrict(strict)
|
||||||
.withForceVersions(userForceVersions.toVector)
|
.withForceVersions(userForceVersions.toVector)
|
||||||
.withMissingOk(missingOk)
|
.withMissingOk(missingOk)
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,8 @@ private[sbt] object LibraryManagement {
|
||||||
!force &&
|
!force &&
|
||||||
!depsUpdated &&
|
!depsUpdated &&
|
||||||
!inChanged &&
|
!inChanged &&
|
||||||
out.allFiles.forall(f => fileUptodate(f, out.stamps, log)) &&
|
out.allFiles.forall(f => fileUptodate(f.toString, out.stamps, log)) &&
|
||||||
fileUptodate(out.cachedDescriptor, out.stamps, log)
|
fileUptodate(out.cachedDescriptor.toString, out.stamps, log)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip resolve if last output exists, otherwise error. */
|
/* Skip resolve if last output exists, otherwise error. */
|
||||||
|
|
@ -166,7 +166,8 @@ private[sbt] object LibraryManagement {
|
||||||
handler((extraInputHash, settings, withoutClock))
|
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
|
val exists = file.exists
|
||||||
// https://github.com/sbt/sbt/issues/5292 warn the user that the file is missing since this indicates
|
// 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.
|
// that UpdateReport was persisted but Coursier cache was not.
|
||||||
|
|
@ -175,7 +176,7 @@ private[sbt] object LibraryManagement {
|
||||||
}
|
}
|
||||||
// coursier doesn't populate stamps
|
// coursier doesn't populate stamps
|
||||||
val timeStampIsSame = stamps
|
val timeStampIsSame = stamps
|
||||||
.get(file)
|
.get(file0)
|
||||||
.forall(_ == IO.getModifiedTimeOrZero(file))
|
.forall(_ == IO.getModifiedTimeOrZero(file))
|
||||||
exists && timeStampIsSame
|
exists && timeStampIsSame
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,9 @@ private[sbt] object Load {
|
||||||
Attributed.blankSeq(provider.mainClasspath.toIndexedSeq ++ scalaProvider.jars.toIndexedSeq)
|
Attributed.blankSeq(provider.mainClasspath.toIndexedSeq ++ scalaProvider.jars.toIndexedSeq)
|
||||||
val ivyConfiguration =
|
val ivyConfiguration =
|
||||||
InlineIvyConfiguration()
|
InlineIvyConfiguration()
|
||||||
.withPaths(IvyPaths(baseDirectory, bootIvyHome(state.configuration)))
|
.withPaths(
|
||||||
|
IvyPaths(baseDirectory.toString, bootIvyHome(state.configuration).map(_.toString))
|
||||||
|
)
|
||||||
.withResolvers(Resolver.combineDefaultResolvers(Vector.empty))
|
.withResolvers(Resolver.combineDefaultResolvers(Vector.empty))
|
||||||
.withLog(log)
|
.withLog(log)
|
||||||
val dependencyResolution = IvyDependencyResolution(ivyConfiguration)
|
val dependencyResolution = IvyDependencyResolution(ivyConfiguration)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ object Dependencies {
|
||||||
// sbt modules
|
// sbt modules
|
||||||
private val ioVersion = nightlyVersion.getOrElse("1.8.0")
|
private val ioVersion = nightlyVersion.getOrElse("1.8.0")
|
||||||
private val lmVersion =
|
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")
|
val zincVersion = nightlyVersion.getOrElse("2.0.0-alpha6")
|
||||||
|
|
||||||
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
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 = "io.get-coursier" %% "lm-coursier-shaded" % "2.0.10"
|
||||||
val lmCoursierShaded = "org.scala-sbt" %% "librarymanagement-coursier" % "2.0.0-alpha6"
|
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(
|
def sjsonNew(n: String) = Def.setting(
|
||||||
"com.eed3si9n" %% n % sjsonNewVersion
|
"com.eed3si9n" %% n % sjsonNewVersion
|
||||||
) // contrabandSjsonNewVersion.value
|
) // contrabandSjsonNewVersion.value
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ abstract class IvyBridgeProviderSpecification
|
||||||
val resolvers = resolvers0.toVector
|
val resolvers = resolvers0.toVector
|
||||||
val chainResolver = ChainedResolver("zinc-chain", resolvers)
|
val chainResolver = ChainedResolver("zinc-chain", resolvers)
|
||||||
InlineIvyConfiguration()
|
InlineIvyConfiguration()
|
||||||
.withPaths(IvyPaths(baseDirectory, Some(ivyHome)))
|
.withPaths(IvyPaths(baseDirectory.toString, Some(ivyHome.toString)))
|
||||||
.withResolvers(resolvers)
|
.withResolvers(resolvers)
|
||||||
.withModuleConfigurations(Vector(ModuleConfiguration("*", chainResolver)))
|
.withModuleConfigurations(Vector(ModuleConfiguration("*", chainResolver)))
|
||||||
.withLock(None)
|
.withLock(None)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue