From ceb1ea8aadb935b5118d059ad8ed938d7f0a270a Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 18 Oct 2022 10:08:23 -0400 Subject: [PATCH] bump Zinc, which uses current util --- build.sbt | 11 ++++++-- .../internal/util/SourcePositionMacro.scala | 6 ++-- main/src/main/scala/sbt/Defaults.scala | 28 +++++++++---------- project/Dependencies.scala | 8 +++--- .../sbt/internal/util/HListFormats.scala | 8 +++--- .../scala-2/sbt/internal/util/KList.scala | 2 +- 6 files changed, 35 insertions(+), 28 deletions(-) diff --git a/build.sbt b/build.sbt index 29d3b2ddb..7b32d11a5 100644 --- a/build.sbt +++ b/build.sbt @@ -10,7 +10,7 @@ import scala.util.Try // ThisBuild settings take lower precedence, // but can be shared across the multi projects. ThisBuild / version := { - val v = "2.0.0-alpha2-SNAPSHOT" + val v = "2.0.0-alpha5-SNAPSHOT" nightlyVersion.getOrElse(v) } ThisBuild / version2_13 := "2.0.0-alpha1-SNAPSHOT" @@ -922,7 +922,14 @@ lazy val mainProj = (project in file("main")) } }, libraryDependencies ++= - (Seq(scalaXml.value, launcherInterface, caffeine, lmCoursierShaded) ++ log4jModules), + (Seq( + scalaXml.value, + sjsonNewScalaJson.value, + sjsonNewCore.value, + launcherInterface, + caffeine, + lmCoursierShaded, + ) ++ log4jModules), libraryDependencies ++= (scalaVersion.value match { case v if v.startsWith("2.12.") => List() case _ => List(scalaPar) diff --git a/internal/util-position/src/main/scala-2/sbt/internal/util/SourcePositionMacro.scala b/internal/util-position/src/main/scala-2/sbt/internal/util/SourcePositionMacro.scala index a4a38e744..e872a124e 100644 --- a/internal/util-position/src/main/scala-2/sbt/internal/util/SourcePositionMacro.scala +++ b/internal/util-position/src/main/scala-2/sbt/internal/util/SourcePositionMacro.scala @@ -14,7 +14,8 @@ import scala.reflect.internal.util.UndefinedPosition abstract class SourcePositionImpl { - /** Creates a SourcePosition by using the enclosing position of the invocation of this method. + /** + * Creates a SourcePosition by using the enclosing position of the invocation of this method. * @return SourcePosition */ def fromEnclosing(): SourcePosition = macro SourcePositionMacro.fromEnclosingImpl @@ -30,8 +31,7 @@ final class SourcePositionMacro(val c: blackbox.Context) { val name = constant[String](ownerSource(f.path, f.name)) val line = constant[Int](pos.line) reify { LinePosition(name.splice, line.splice) } - } else - reify { NoPosition } + } else reify { NoPosition } } private[this] def ownerSource(path: String, name: String): String = { diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index d466bb689..23a0c363f 100644 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -3850,8 +3850,8 @@ object Classpaths { val outCacheStore = cacheStoreFactory make "output_dsp" val f = Tracked.inputChanged(cacheStoreFactory make "input_dsp") { (inChanged: Boolean, in: Seq[ModuleID]) => - implicit val NoPositionFormat: JsonFormat[NoPosition.type] = asSingleton(NoPosition) - implicit val LinePositionFormat: IsoLList.Aux[LinePosition, String :*: Int :*: LNil] = + given NoPositionFormat: JsonFormat[NoPosition.type] = asSingleton(NoPosition) + given LinePositionFormat: IsoLList.Aux[LinePosition, String :*: Int :*: LNil] = LList.iso( { (l: LinePosition) => ("path", l.path) :*: ("startLine", l.startLine) :*: LNil @@ -3860,7 +3860,7 @@ object Classpaths { LinePosition(in.head, in.tail.head) } ) - implicit val LineRangeFormat: IsoLList.Aux[LineRange, Int :*: Int :*: LNil] = LList.iso( + given LineRangeFormat: IsoLList.Aux[LineRange, Int :*: Int :*: LNil] = LList.iso( { (l: LineRange) => ("start", l.start) :*: ("end", l.end) :*: LNil }, @@ -3868,19 +3868,19 @@ object Classpaths { LineRange(in.head, in.tail.head) } ) - implicit val RangePositionFormat - : IsoLList.Aux[RangePosition, String :*: LineRange :*: LNil] = LList.iso( - { (r: RangePosition) => - ("path", r.path) :*: ("range", r.range) :*: LNil - }, - { (in: String :*: LineRange :*: LNil) => - RangePosition(in.head, in.tail.head) - } - ) - implicit val SourcePositionFormat: JsonFormat[SourcePosition] = + given RangePositionFormat: IsoLList.Aux[RangePosition, String :*: LineRange :*: LNil] = + LList.iso( + { (r: RangePosition) => + ("path", r.path) :*: ("range", r.range) :*: LNil + }, + { (in: String :*: LineRange :*: LNil) => + RangePosition(in.head, in.tail.head) + } + ) + given SourcePositionFormat: JsonFormat[SourcePosition] = unionFormat3[SourcePosition, NoPosition.type, LinePosition, RangePosition] - implicit val midJsonKeyFmt: sjsonnew.JsonKeyFormat[ModuleID] = moduleIdJsonKeyFormat + given midJsonKeyFmt: sjsonnew.JsonKeyFormat[ModuleID] = moduleIdJsonKeyFormat val outCache = Tracked.lastOutput[Seq[ModuleID], Map[ModuleID, SourcePosition]](outCacheStore) { case (_, Some(out)) if !inChanged => out diff --git a/project/Dependencies.scala b/project/Dependencies.scala index ee9569b33..465268b31 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -6,7 +6,7 @@ object Dependencies { // WARNING: Please Scala update versions in PluginCross.scala too val scala212 = "2.12.17" val scala213 = "2.13.8" - val scala3 = "3.1.3" + val scala3 = "3.2.0" val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up") val baseScalaVersion = scala3 def nightlyVersion: Option[String] = @@ -15,8 +15,8 @@ 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-alpha1") - val zincVersion = nightlyVersion.getOrElse("2.0.0-alpha2") + sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("2.0.0-alpha6") + val zincVersion = nightlyVersion.getOrElse("2.0.0-alpha5") 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-alpha2" - lazy val sjsonNewVersion = "0.11.0" + lazy val sjsonNewVersion = "0.12.0" def sjsonNew(n: String) = Def.setting( "com.eed3si9n" %% n % sjsonNewVersion ) // contrabandSjsonNewVersion.value diff --git a/util-collection/src/main/scala-2/sbt/internal/util/HListFormats.scala b/util-collection/src/main/scala-2/sbt/internal/util/HListFormats.scala index 4143861b2..04d8fc694 100644 --- a/util-collection/src/main/scala-2/sbt/internal/util/HListFormats.scala +++ b/util-collection/src/main/scala-2/sbt/internal/util/HListFormats.scala @@ -28,8 +28,8 @@ trait HListFormats { } } - implicit def hconsFormat[H, T <: HList]( - implicit hf: JsonFormat[H], + implicit def hconsFormat[H, T <: HList](implicit + hf: JsonFormat[H], tf: HListJF[T] ): JsonFormat[H :+: T] = new JsonFormat[H :+: T] { @@ -56,8 +56,8 @@ trait HListFormats { def write[J](obj: A, builder: Builder[J]): Unit } - implicit def hconsHListJF[H, T <: HList]( - implicit hf: JsonFormat[H], + implicit def hconsHListJF[H, T <: HList](implicit + hf: JsonFormat[H], tf: HListJF[T] ): HListJF[H :+: T] = new HListJF[H :+: T] { diff --git a/util-collection/src/main/scala-2/sbt/internal/util/KList.scala b/util-collection/src/main/scala-2/sbt/internal/util/KList.scala index 2761d8172..c64869f99 100644 --- a/util-collection/src/main/scala-2/sbt/internal/util/KList.scala +++ b/util-collection/src/main/scala-2/sbt/internal/util/KList.scala @@ -23,7 +23,7 @@ sealed trait KList[+M[_]] { /** Applies `f` to the elements of this list in the applicative functor defined by `ap`. */ def apply[N[x] >: M[x], Z](f: Transform[Id] => Z)(implicit ap: Applicative[N]): N[Z] - /** Equivalent to `transform(f) . apply(x => x)`, this is the essence of the iterator at the level of natural transformations.*/ + /** Equivalent to `transform(f) . apply(x => x)`, this is the essence of the iterator at the level of natural transformations. */ def traverse[N[_], P[_]](f: M ~> (N ∙ P)#l)(implicit np: Applicative[N]): N[Transform[P]] /** Discards the heterogeneous type information and constructs a plain List from this KList's elements. */