mirror of https://github.com/sbt/sbt.git
Remove sjson stuff
Too much fluff to compute a simple hash…
This commit is contained in:
parent
a554ec4f06
commit
16574d8fc8
|
|
@ -19,7 +19,7 @@ val coursierVersion = "1.1.0-M8"
|
||||||
|
|
||||||
lazy val `lm-coursier` = project
|
lazy val `lm-coursier` = project
|
||||||
.in(file("modules/lm-coursier"))
|
.in(file("modules/lm-coursier"))
|
||||||
.enablePlugins(ContrabandPlugin, JsonCodecPlugin)
|
.enablePlugins(ContrabandPlugin)
|
||||||
.settings(
|
.settings(
|
||||||
shared,
|
shared,
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
/**
|
|
||||||
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
|
|
||||||
*/
|
|
||||||
|
|
||||||
// DO NOT EDIT MANUALLY
|
|
||||||
package coursier.lmcoursier
|
|
||||||
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
|
|
||||||
trait CoursierConfigurationFormats { self: sbt.internal.librarymanagement.formats.LoggerFormat with sbt.librarymanagement.ResolverFormats with sjsonnew.BasicJsonProtocol =>
|
|
||||||
implicit lazy val CoursierConfigurationFormat: JsonFormat[coursier.lmcoursier.CoursierConfiguration] = new JsonFormat[coursier.lmcoursier.CoursierConfiguration] {
|
|
||||||
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): coursier.lmcoursier.CoursierConfiguration = {
|
|
||||||
jsOpt match {
|
|
||||||
case Some(js) =>
|
|
||||||
unbuilder.beginObject(js)
|
|
||||||
val log = unbuilder.readField[Option[xsbti.Logger]]("log")
|
|
||||||
val resolvers = unbuilder.readField[Vector[sbt.librarymanagement.Resolver]]("resolvers")
|
|
||||||
val otherResolvers = unbuilder.readField[Vector[sbt.librarymanagement.Resolver]]("otherResolvers")
|
|
||||||
val reorderResolvers = unbuilder.readField[Boolean]("reorderResolvers")
|
|
||||||
val parallelDownloads = unbuilder.readField[Int]("parallelDownloads")
|
|
||||||
val maxIterations = unbuilder.readField[Int]("maxIterations")
|
|
||||||
val sbtScalaOrganization = unbuilder.readField[Option[String]]("sbtScalaOrganization")
|
|
||||||
val sbtScalaVersion = unbuilder.readField[Option[String]]("sbtScalaVersion")
|
|
||||||
val sbtScalaJars = unbuilder.readField[Vector[java.io.File]]("sbtScalaJars")
|
|
||||||
unbuilder.endObject()
|
|
||||||
coursier.lmcoursier.CoursierConfiguration(log, resolvers, otherResolvers, reorderResolvers, parallelDownloads, maxIterations, sbtScalaOrganization, sbtScalaVersion, sbtScalaJars)
|
|
||||||
case None =>
|
|
||||||
deserializationError("Expected JsObject but found None")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
override def write[J](obj: coursier.lmcoursier.CoursierConfiguration, builder: Builder[J]): Unit = {
|
|
||||||
builder.beginObject()
|
|
||||||
builder.addField("log", obj.log)
|
|
||||||
builder.addField("resolvers", obj.resolvers)
|
|
||||||
builder.addField("otherResolvers", obj.otherResolvers)
|
|
||||||
builder.addField("reorderResolvers", obj.reorderResolvers)
|
|
||||||
builder.addField("parallelDownloads", obj.parallelDownloads)
|
|
||||||
builder.addField("maxIterations", obj.maxIterations)
|
|
||||||
builder.addField("sbtScalaOrganization", obj.sbtScalaOrganization)
|
|
||||||
builder.addField("sbtScalaVersion", obj.sbtScalaVersion)
|
|
||||||
builder.addField("sbtScalaJars", obj.sbtScalaJars)
|
|
||||||
builder.endObject()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package coursier.lmcoursier
|
|
||||||
|
|
||||||
import sbt.librarymanagement.LibraryManagementCodec
|
|
||||||
|
|
||||||
trait CoursierLibraryManagementCodec
|
|
||||||
extends sjsonnew.BasicJsonProtocol
|
|
||||||
with LibraryManagementCodec
|
|
||||||
// with sbt.internal.librarymanagement.formats.GlobalLockFormat
|
|
||||||
with sbt.internal.librarymanagement.formats.LoggerFormat
|
|
||||||
with sbt.librarymanagement.ResolverFormats
|
|
||||||
with CoursierConfigurationFormats
|
|
||||||
|
|
||||||
object CoursierLibraryManagementCodec extends CoursierLibraryManagementCodec
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package coursier.lmcoursier
|
package coursier.lmcoursier
|
||||||
|
|
||||||
import sbt.librarymanagement._
|
import sbt.librarymanagement._
|
||||||
import sjsonnew.support.murmurhash.Hasher
|
|
||||||
|
|
||||||
final case class CoursierModuleDescriptor(
|
final case class CoursierModuleDescriptor(
|
||||||
descriptor: ModuleDescriptorConfiguration,
|
descriptor: ModuleDescriptorConfiguration,
|
||||||
|
|
@ -17,8 +16,6 @@ final case class CoursierModuleDescriptor(
|
||||||
def moduleSettings: CoursierModuleSettings =
|
def moduleSettings: CoursierModuleSettings =
|
||||||
CoursierModuleSettings()
|
CoursierModuleSettings()
|
||||||
|
|
||||||
lazy val extraInputHash: Long = {
|
lazy val extraInputHash: Long =
|
||||||
import CustomLibraryManagementCodec._
|
conf.##
|
||||||
Hasher.hash(conf).toOption.fold(0L)(_.toLong)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
package coursier.lmcoursier
|
|
||||||
|
|
||||||
import sbt.librarymanagement.Resolver
|
|
||||||
import sjsonnew.JsonFormat
|
|
||||||
|
|
||||||
object CustomLibraryManagementCodec extends CoursierLibraryManagementCodec {
|
|
||||||
|
|
||||||
private type ConfFormat = (
|
|
||||||
Vector[Resolver],
|
|
||||||
Vector[Resolver],
|
|
||||||
Boolean,
|
|
||||||
Int,
|
|
||||||
Int
|
|
||||||
)
|
|
||||||
|
|
||||||
private def from(c: CoursierConfiguration): ConfFormat =
|
|
||||||
(
|
|
||||||
c.resolvers,
|
|
||||||
c.otherResolvers,
|
|
||||||
c.reorderResolvers,
|
|
||||||
c.parallelDownloads,
|
|
||||||
c.maxIterations
|
|
||||||
)
|
|
||||||
|
|
||||||
private def to(c: ConfFormat): CoursierConfiguration =
|
|
||||||
CoursierConfiguration()
|
|
||||||
.withResolvers(c._1)
|
|
||||||
.withOtherResolvers(c._2)
|
|
||||||
.withReorderResolvers(c._3)
|
|
||||||
.withParallelDownloads(c._4)
|
|
||||||
.withMaxIterations(c._5)
|
|
||||||
|
|
||||||
// Redefine to use a subset of properties, that are serializable
|
|
||||||
override implicit lazy val CoursierConfigurationFormat: JsonFormat[CoursierConfiguration] =
|
|
||||||
projectFormat[CoursierConfiguration, ConfFormat](from, to)
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue