mirror of https://github.com/sbt/sbt.git
Actually, just kill the crazy MyCrazyReferences idea
This commit is contained in:
parent
301ec787f2
commit
b2b606f8aa
|
|
@ -4,9 +4,5 @@ import sjsonnew._
|
|||
import org.apache.ivy.plugins.resolver.DependencyResolver
|
||||
|
||||
trait DependencyResolverFormat { self: BasicJsonProtocol =>
|
||||
implicit lazy val DependencyResolverFormat: JsonFormat[DependencyResolver] =
|
||||
project(
|
||||
MyCrazyReferences.referenced _,
|
||||
(ref: String) => MyCrazyReferences(ref, classOf[DependencyResolver])
|
||||
)
|
||||
implicit lazy val DependencyResolverFormat: JsonFormat[DependencyResolver] = ???
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,5 @@ import sjsonnew._
|
|||
import xsbti._
|
||||
|
||||
trait GlobalLockFormat { self: BasicJsonProtocol =>
|
||||
implicit lazy val GlobalLockFormat: JsonFormat[GlobalLock] =
|
||||
project(MyCrazyReferences.referenced _, (ref: String) => MyCrazyReferences(ref, classOf[GlobalLock]))
|
||||
implicit lazy val GlobalLockFormat: JsonFormat[GlobalLock] = ???
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,5 @@ import sjsonnew._
|
|||
import xsbti._
|
||||
|
||||
trait LoggerFormat { self: BasicJsonProtocol =>
|
||||
implicit lazy val LoggerFormat: JsonFormat[Logger] =
|
||||
project(MyCrazyReferences.referenced _, (ref: String) => MyCrazyReferences(ref, classOf[Logger]))
|
||||
implicit lazy val LoggerFormat: JsonFormat[Logger] = ???
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
package sbt.internal.librarymanagement.formats
|
||||
|
||||
import scala.collection.mutable
|
||||
|
||||
object MyCrazyReferences {
|
||||
private val references: mutable.Map[String, Any] = mutable.Map.empty
|
||||
|
||||
def apply[T](key: String, clazz: Class[T]): T = synchronized(clazz.cast(references(key)))
|
||||
|
||||
def referenced[T](value: T): String = synchronized {
|
||||
val key = java.util.UUID.randomUUID.toString
|
||||
references(key) = value
|
||||
key
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,5 @@ import sjsonnew._
|
|||
import scala.xml._
|
||||
|
||||
trait NodeSeqFormat { self: BasicJsonProtocol =>
|
||||
implicit lazy val NodeSeqFormat: JsonFormat[NodeSeq] =
|
||||
project(MyCrazyReferences.referenced _, (ref: String) => MyCrazyReferences(ref, classOf[NodeSeq]))
|
||||
implicit lazy val NodeSeqFormat: JsonFormat[NodeSeq] = ???
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue