Merge pull request #3303 from sbt/wip/watchservice

Adapt to use the new `WatchService`
This commit is contained in:
Dale Wijnand 2017-07-06 13:14:39 +01:00 committed by GitHub
commit d464383722
64 changed files with 134 additions and 105 deletions

View File

@ -133,7 +133,7 @@ lazy val testingProj = (project in file("testing"))
.settings( .settings(
baseSettings, baseSettings,
name := "Testing", name := "Testing",
libraryDependencies ++= Seq(testInterface, launcherInterface, sjsonNewScalaJson), libraryDependencies ++= Seq(testInterface, launcherInterface, sjsonNewScalaJson.value),
managedSourceDirectories in Compile += managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala", baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@ -205,7 +205,7 @@ lazy val actionsProj = (project in file("main-actions"))
.settings( .settings(
testedBaseSettings, testedBaseSettings,
name := "Actions", name := "Actions",
libraryDependencies += sjsonNewScalaJson libraryDependencies += sjsonNewScalaJson.value
) )
.configure( .configure(
addSbtCompilerClasspath, addSbtCompilerClasspath,
@ -226,7 +226,7 @@ lazy val protocolProj = (project in file("protocol"))
.settings( .settings(
testedBaseSettings, testedBaseSettings,
name := "Protocol", name := "Protocol",
libraryDependencies ++= Seq(sjsonNewScalaJson), libraryDependencies ++= Seq(sjsonNewScalaJson.value),
managedSourceDirectories in Compile += managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala", baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@ -241,7 +241,7 @@ lazy val commandProj = (project in file("main-command"))
.settings( .settings(
testedBaseSettings, testedBaseSettings,
name := "Command", name := "Command",
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson, templateResolverApi), libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi),
managedSourceDirectories in Compile += managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala", baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",

View File

@ -120,7 +120,7 @@ object Package {
"Input file mappings:\n\t" + (sources map { case (f, s) => s + "\n\t " + f } mkString ("\n\t")) "Input file mappings:\n\t" + (sources map { case (f, s) => s + "\n\t " + f } mkString ("\n\t"))
implicit def manifestEquiv: Equiv[Manifest] = defaultEquiv implicit def manifestEquiv: Equiv[Manifest] = defaultEquiv
implicit def manifestFormat: JsonFormat[Manifest] = project[Manifest, Array[Byte]]( implicit def manifestFormat: JsonFormat[Manifest] = projectFormat[Manifest, Array[Byte]](
m => { m => {
val bos = new java.io.ByteArrayOutputStream() val bos = new java.io.ByteArrayOutputStream()
m write bos m write bos

View File

@ -12,7 +12,7 @@ class CacheIvyTest extends Properties("CacheIvy") {
import sjsonnew._ import sjsonnew._
import sjsonnew.support.scalajson.unsafe.Converter import sjsonnew.support.scalajson.unsafe.Converter
import scala.json.ast.unsafe.JValue import scalajson.ast.unsafe.JValue
private class InMemoryStore(converter: SupportConverter[JValue]) extends CacheStore { private class InMemoryStore(converter: SupportConverter[JValue]) extends CacheStore {
private var content: JValue = _ private var content: JValue = _

View File

@ -3,7 +3,7 @@
*/ */
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait CommandSourceFormats { self: sjsonnew.BasicJsonProtocol => trait CommandSourceFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val CommandSourceFormat: JsonFormat[sbt.CommandSource] = new JsonFormat[sbt.CommandSource] { implicit lazy val CommandSourceFormat: JsonFormat[sbt.CommandSource] = new JsonFormat[sbt.CommandSource] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.CommandSource = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.CommandSource = {

View File

@ -3,7 +3,7 @@
*/ */
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait ExecFormats { self: CommandSourceFormats with sjsonnew.BasicJsonProtocol => trait ExecFormats { self: CommandSourceFormats with sjsonnew.BasicJsonProtocol =>
implicit lazy val ExecFormat: JsonFormat[sbt.Exec] = new JsonFormat[sbt.Exec] { implicit lazy val ExecFormat: JsonFormat[sbt.Exec] = new JsonFormat[sbt.Exec] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.Exec = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.Exec = {

View File

@ -14,7 +14,7 @@ final class CommandSource private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (17 + channelName.##) 37 * (37 * (17 + "CommandSource".##) + channelName.##)
} }
override def toString: String = { override def toString: String = {
"CommandSource(" + channelName + ")" "CommandSource(" + channelName + ")"

View File

@ -16,7 +16,7 @@ final class Exec private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (37 * (17 + commandLine.##) + execId.##) + source.##) 37 * (37 * (37 * (37 * (17 + "Exec".##) + commandLine.##) + execId.##) + source.##)
} }
override def toString: String = { override def toString: String = {
"Exec(" + commandLine + ", " + execId + ", " + source + ")" "Exec(" + commandLine + ", " + execId + ", " + source + ")"

View File

@ -6,30 +6,35 @@ package sbt
import BasicCommandStrings.ClearOnFailure import BasicCommandStrings.ClearOnFailure
import State.FailureWall import State.FailureWall
import annotation.tailrec import annotation.tailrec
import java.io.File import java.nio.file.FileSystems
import sbt.io.PathFinder import scala.concurrent.duration._
import sbt.internal.io.{ SourceModificationWatch, WatchState }
import sbt.io.WatchService
import sbt.internal.io.{ Source, SourceModificationWatch, WatchState }
import sbt.internal.util.AttributeKey import sbt.internal.util.AttributeKey
import sbt.internal.util.Types.const import sbt.internal.util.Types.const
trait Watched { trait Watched {
/** The files watched when an action is run with a preceeding ~ */ /** The files watched when an action is run with a preceeding ~ */
def watchPaths(s: State): Seq[File] = Nil def watchSources(s: State): Seq[Source] = Nil
def terminateWatch(key: Int): Boolean = Watched.isEnter(key) def terminateWatch(key: Int): Boolean = Watched.isEnter(key)
/** /**
* The time in milliseconds between checking for changes. The actual time between the last change made to a file and the * The time in milliseconds between checking for changes. The actual time between the last change made to a file and the
* execution time is between `pollInterval` and `pollInterval*2`. * execution time is between `pollInterval` and `pollInterval*2`.
*/ */
def pollInterval: Int = Watched.PollDelayMillis def pollInterval: FiniteDuration = Watched.PollDelay
/** The message to show when triggered execution waits for sources to change.*/ /** The message to show when triggered execution waits for sources to change.*/
private[sbt] def watchingMessage(s: WatchState): String = Watched.defaultWatchingMessage(s) private[sbt] def watchingMessage(s: WatchState): String = Watched.defaultWatchingMessage(s)
/** The message to show before an action is run. */ /** The message to show before an action is run. */
private[sbt] def triggeredMessage(s: WatchState): String = Watched.defaultTriggeredMessage(s) private[sbt] def triggeredMessage(s: WatchState): String = Watched.defaultTriggeredMessage(s)
/** The `WatchService` to use to monitor the file system. */
private[sbt] def watchService(): WatchService = FileSystems.getDefault.newWatchService()
} }
object Watched { object Watched {
@ -43,7 +48,7 @@ object Watched {
def multi(base: Watched, paths: Seq[Watched]): Watched = def multi(base: Watched, paths: Seq[Watched]): Watched =
new AWatched { new AWatched {
override def watchPaths(s: State) = (base.watchPaths(s) /: paths)(_ ++ _.watchPaths(s)) override def watchSources(s: State) = (base.watchSources(s) /: paths)(_ ++ _.watchSources(s))
override def terminateWatch(key: Int): Boolean = base.terminateWatch(key) override def terminateWatch(key: Int): Boolean = base.terminateWatch(key)
override val pollInterval = (base +: paths).map(_.pollInterval).min override val pollInterval = (base +: paths).map(_.pollInterval).min
override def watchingMessage(s: WatchState) = base.watchingMessage(s) override def watchingMessage(s: WatchState) = base.watchingMessage(s)
@ -51,15 +56,16 @@ object Watched {
} }
def empty: Watched = new AWatched def empty: Watched = new AWatched
val PollDelayMillis = 500 val PollDelay: FiniteDuration = 500.milliseconds
def isEnter(key: Int): Boolean = key == 10 || key == 13 def isEnter(key: Int): Boolean = key == 10 || key == 13
def printIfDefined(msg: String) = if (!msg.isEmpty) System.out.println(msg) def printIfDefined(msg: String) = if (!msg.isEmpty) System.out.println(msg)
def executeContinuously(watched: Watched, s: State, next: String, repeat: String): State = { def executeContinuously(watched: Watched, s: State, next: String, repeat: String): State = {
@tailrec def shouldTerminate: Boolean = @tailrec def shouldTerminate: Boolean =
(System.in.available > 0) && (watched.terminateWatch(System.in.read()) || shouldTerminate) (System.in.available > 0) && (watched.terminateWatch(System.in.read()) || shouldTerminate)
val sourcesFinder = PathFinder { watched watchPaths s } val sources = watched.watchSources(s)
val watchState = s get ContinuousState getOrElse WatchState.empty val service = watched.watchService()
val watchState = s get ContinuousState getOrElse WatchState.empty(service, sources)
if (watchState.count > 0) if (watchState.count > 0)
printIfDefined(watched watchingMessage watchState) printIfDefined(watched watchingMessage watchState)
@ -67,8 +73,7 @@ object Watched {
val (triggered, newWatchState) = val (triggered, newWatchState) =
try { try {
val (triggered, newWatchState) = val (triggered, newWatchState) =
SourceModificationWatch.watch(sourcesFinder, watched.pollInterval, watchState)( SourceModificationWatch.watch(watched.pollInterval, watchState)(shouldTerminate)
shouldTerminate)
(triggered, newWatchState) (triggered, newWatchState)
} catch { } catch {
case e: Exception => case e: Exception =>
@ -84,7 +89,8 @@ object Watched {
(ClearOnFailure :: next :: FailureWall :: repeat :: s).put(ContinuousState, newWatchState) (ClearOnFailure :: next :: FailureWall :: repeat :: s).put(ContinuousState, newWatchState)
} else { } else {
while (System.in.available() > 0) System.in.read() while (System.in.available() > 0) System.in.read()
s.put(ContinuousState, WatchState.empty) service.close()
s.remove(ContinuousState)
} }
} }
val ContinuousState = val ContinuousState =

View File

@ -5,6 +5,7 @@ package sbt
import Def.{ Initialize, ScopedKey, Setting, SettingsDefinition } import Def.{ Initialize, ScopedKey, Setting, SettingsDefinition }
import java.io.{ File, PrintWriter } import java.io.{ File, PrintWriter }
import java.nio.file.FileSystems
import java.net.{ URI, URL } import java.net.{ URI, URL }
import java.util.Optional import java.util.Optional
import java.util.concurrent.{ TimeUnit, Callable } import java.util.concurrent.{ TimeUnit, Callable }
@ -23,7 +24,7 @@ import sbt.internal._
import sbt.internal.CommandStrings.ExportStream import sbt.internal.CommandStrings.ExportStream
import sbt.internal.inc.ZincUtil import sbt.internal.inc.ZincUtil
import sbt.internal.inc.JavaInterfaceUtil._ import sbt.internal.inc.JavaInterfaceUtil._
import sbt.internal.io.WatchState import sbt.internal.io.{ Source, WatchState }
import sbt.internal.librarymanagement._ import sbt.internal.librarymanagement._
import sbt.internal.librarymanagement.mavenint.{ import sbt.internal.librarymanagement.mavenint.{
PomExtraDependencyAttributes, PomExtraDependencyAttributes,
@ -47,7 +48,8 @@ import sbt.io.{
PathFinder, PathFinder,
SimpleFileFilter, SimpleFileFilter,
DirectoryFilter, DirectoryFilter,
Hash Hash,
WatchService
}, Path._ }, Path._
import sbt.librarymanagement.Artifact.{ DocClassifier, SourceClassifier } import sbt.librarymanagement.Artifact.{ DocClassifier, SourceClassifier }
import sbt.librarymanagement.Configurations.{ import sbt.librarymanagement.Configurations.{
@ -250,7 +252,10 @@ object Defaults extends BuildCommon {
Previous.references :== new Previous.References, Previous.references :== new Previous.References,
concurrentRestrictions := defaultRestrictions.value, concurrentRestrictions := defaultRestrictions.value,
parallelExecution :== true, parallelExecution :== true,
pollInterval :== 500, pollInterval :== new FiniteDuration(500, TimeUnit.MILLISECONDS),
watchService :== { () =>
FileSystems.getDefault.newWatchService
},
logBuffered :== false, logBuffered :== false,
commands :== Nil, commands :== Nil,
showSuccess :== true, showSuccess :== true,
@ -317,7 +322,12 @@ object Defaults extends BuildCommon {
unmanagedSources := collectFiles(unmanagedSourceDirectories, unmanagedSources := collectFiles(unmanagedSourceDirectories,
includeFilter in unmanagedSources, includeFilter in unmanagedSources,
excludeFilter in unmanagedSources).value, excludeFilter in unmanagedSources).value,
watchSources in ConfigGlobal ++= unmanagedSources.value, watchSources in ConfigGlobal ++= {
val bases = unmanagedSourceDirectories.value
val include = (includeFilter in unmanagedSources).value
val exclude = (excludeFilter in unmanagedSources).value
bases.map(b => new Source(b, include, exclude))
},
managedSourceDirectories := Seq(sourceManaged.value), managedSourceDirectories := Seq(sourceManaged.value),
managedSources := generate(sourceGenerators).value, managedSources := generate(sourceGenerators).value,
sourceGenerators :== Nil, sourceGenerators :== Nil,
@ -337,7 +347,12 @@ object Defaults extends BuildCommon {
unmanagedResources := collectFiles(unmanagedResourceDirectories, unmanagedResources := collectFiles(unmanagedResourceDirectories,
includeFilter in unmanagedResources, includeFilter in unmanagedResources,
excludeFilter in unmanagedResources).value, excludeFilter in unmanagedResources).value,
watchSources in ConfigGlobal ++= unmanagedResources.value, watchSources in ConfigGlobal ++= {
val bases = unmanagedResourceDirectories.value
val include = (includeFilter in unmanagedResources).value
val exclude = (excludeFilter in unmanagedResources).value
bases.map(b => new Source(b, include, exclude))
},
resourceGenerators :== Nil, resourceGenerators :== Nil,
resourceGenerators += Def.task { resourceGenerators += Def.task {
PluginDiscovery.writeDescriptors(discoveredSbtPlugins.value, resourceManaged.value) PluginDiscovery.writeDescriptors(discoveredSbtPlugins.value, resourceManaged.value)
@ -537,7 +552,7 @@ object Defaults extends BuildCommon {
def generate(generators: SettingKey[Seq[Task[Seq[File]]]]): Initialize[Task[Seq[File]]] = def generate(generators: SettingKey[Seq[Task[Seq[File]]]]): Initialize[Task[Seq[File]]] =
generators { _.join.map(_.flatten) } generators { _.join.map(_.flatten) }
def watchTransitiveSourcesTask: Initialize[Task[Seq[File]]] = { def watchTransitiveSourcesTask: Initialize[Task[Seq[Source]]] = {
import ScopeFilter.Make.{ inDependencies => inDeps, _ } import ScopeFilter.Make.{ inDependencies => inDeps, _ }
val selectDeps = ScopeFilter(inAggregates(ThisProject) || inDeps(ThisProject)) val selectDeps = ScopeFilter(inAggregates(ThisProject) || inDeps(ThisProject))
val allWatched = (watchSources ?? Nil).all(selectDeps) val allWatched = (watchSources ?? Nil).all(selectDeps)
@ -554,6 +569,7 @@ object Defaults extends BuildCommon {
def watchSetting: Initialize[Watched] = def watchSetting: Initialize[Watched] =
Def.setting { Def.setting {
val getService = watchService.value
val interval = pollInterval.value val interval = pollInterval.value
val base = thisProjectRef.value val base = thisProjectRef.value
val msg = watchingMessage.value val msg = watchingMessage.value
@ -564,7 +580,9 @@ object Defaults extends BuildCommon {
override def pollInterval = interval override def pollInterval = interval
override def watchingMessage(s: WatchState) = msg(s) override def watchingMessage(s: WatchState) = msg(s)
override def triggeredMessage(s: WatchState) = trigMsg(s) override def triggeredMessage(s: WatchState) = trigMsg(s)
override def watchPaths(s: State) = EvaluateTask(Project structure s, key, s, base) match { override def watchService() = getService()
override def watchSources(s: State) =
EvaluateTask(Project structure s, key, s, base) match {
case Some((_, Value(ps))) => ps case Some((_, Value(ps))) => ps
case Some((_, Inc(i))) => throw i case Some((_, Inc(i))) => throw i
case None => sys.error("key not found: " + Def.displayFull(key)) case None => sys.error("key not found: " + Def.displayFull(key))
@ -2153,7 +2171,7 @@ object Classpaths {
f: Map[ModuleID, Set[String]] => UpdateReport): UpdateReport = { f: Map[ModuleID, Set[String]] => UpdateReport): UpdateReport = {
import sbt.librarymanagement.LibraryManagementCodec._ import sbt.librarymanagement.LibraryManagementCodec._
import sbt.util.FileBasedStore import sbt.util.FileBasedStore
implicit val isoString: sjsonnew.IsoString[scala.json.ast.unsafe.JValue] = implicit val isoString: sjsonnew.IsoString[scalajson.ast.unsafe.JValue] =
sjsonnew.IsoString.iso( sjsonnew.IsoString.iso(
sjsonnew.support.scalajson.unsafe.CompactPrinter.apply, sjsonnew.support.scalajson.unsafe.CompactPrinter.apply,
sjsonnew.support.scalajson.unsafe.Parser.parseUnsafe sjsonnew.support.scalajson.unsafe.Parser.parseUnsafe

View File

@ -36,8 +36,8 @@ import sbt.internal.{
SessionSettings, SessionSettings,
LogManager LogManager
} }
import sbt.io.FileFilter import sbt.io.{ FileFilter, WatchService }
import sbt.internal.io.WatchState import sbt.internal.io.{ Source, WatchState }
import sbt.internal.util.{ AttributeKey, SourcePosition } import sbt.internal.util.{ AttributeKey, SourcePosition }
import sbt.librarymanagement.Configurations.CompilerPlugin import sbt.librarymanagement.Configurations.CompilerPlugin
@ -130,9 +130,10 @@ object Keys {
val analysis = AttributeKey[CompileAnalysis]("analysis", "Analysis of compilation, including dependencies and generated outputs.", DSetting) val analysis = AttributeKey[CompileAnalysis]("analysis", "Analysis of compilation, including dependencies and generated outputs.", DSetting)
val watch = SettingKey(BasicKeys.watch) val watch = SettingKey(BasicKeys.watch)
val suppressSbtShellNotification = SettingKey[Boolean]("suppressSbtShellNotification", """True to suppress the "Executing in batch mode.." message.""", CSetting) val suppressSbtShellNotification = SettingKey[Boolean]("suppressSbtShellNotification", """True to suppress the "Executing in batch mode.." message.""", CSetting)
val pollInterval = SettingKey[Int]("poll-interval", "Interval between checks for modified sources by the continuous execution command.", BMinusSetting) val pollInterval = SettingKey[FiniteDuration]("poll-interval", "Interval between checks for modified sources by the continuous execution command.", BMinusSetting)
val watchSources = TaskKey[Seq[File]]("watch-sources", "Defines the sources in this project for continuous execution to watch for changes.", BMinusSetting) val watchService = SettingKey[() => WatchService]("watch-service", "Service to use to monitor file system changes.", BMinusSetting)
val watchTransitiveSources = TaskKey[Seq[File]]("watch-transitive-sources", "Defines the sources in all projects for continuous execution to watch.", CSetting) val watchSources = TaskKey[Seq[Source]]("watch-sources", "Defines the sources in this project for continuous execution to watch for changes.", BMinusSetting)
val watchTransitiveSources = TaskKey[Seq[Source]]("watch-transitive-sources", "Defines the sources in all projects for continuous execution to watch.", CSetting)
val watchingMessage = SettingKey[WatchState => String]("watching-message", "The message to show when triggered execution waits for sources to change.", DSetting) val watchingMessage = SettingKey[WatchState => String]("watching-message", "The message to show when triggered execution waits for sources to change.", DSetting)
val triggeredMessage = SettingKey[WatchState => String]("triggered-message", "The message to show before triggered execution executes an action after sources change.", DSetting) val triggeredMessage = SettingKey[WatchState => String]("triggered-message", "The message to show before triggered execution executes an action after sources change.", DSetting)

View File

@ -22,7 +22,7 @@ object AltLibraryManagementCodec extends LibraryManagementCodec {
} }
implicit val altRawRepositoryJsonFormat: JsonFormat[RawRepository] = implicit val altRawRepositoryJsonFormat: JsonFormat[RawRepository] =
project(_.name, FakeRawRepository.create) projectFormat(_.name, FakeRawRepository.create)
// Redefine to add RawRepository, and switch to unionFormat // Redefine to add RawRepository, and switch to unionFormat
override lazy implicit val ResolverFormat: JsonFormat[Resolver] = override lazy implicit val ResolverFormat: JsonFormat[Resolver] =
@ -65,7 +65,7 @@ object AltLibraryManagementCodec extends LibraryManagementCodec {
None) None)
} }
project[InlineIvyConfiguration, InlineIvyHL](inlineIvyToHL, hlToInlineIvy) projectFormat[InlineIvyConfiguration, InlineIvyHL](inlineIvyToHL, hlToInlineIvy)
} }
// Redefine to use a subset of properties, that are serialisable // Redefine to use a subset of properties, that are serialisable
@ -82,7 +82,7 @@ object AltLibraryManagementCodec extends LibraryManagementCodec {
Vector.empty) Vector.empty)
} }
project[ExternalIvyConfiguration, ExternalIvyHL](externalIvyToHL, hlToExternalIvy) projectFormat[ExternalIvyConfiguration, ExternalIvyHL](externalIvyToHL, hlToExternalIvy)
} }
// Redefine to switch to unionFormat // Redefine to switch to unionFormat

View File

@ -250,7 +250,7 @@ object BuildStreams {
def mkStreams(units: Map[URI, LoadedBuildUnit], def mkStreams(units: Map[URI, LoadedBuildUnit],
root: URI, root: URI,
data: Settings[Scope]): State => Streams = s => { data: Settings[Scope]): State => Streams = s => {
implicit val isoString: sjsonnew.IsoString[scala.json.ast.unsafe.JValue] = implicit val isoString: sjsonnew.IsoString[scalajson.ast.unsafe.JValue] =
sjsonnew.IsoString.iso(sjsonnew.support.scalajson.unsafe.CompactPrinter.apply, sjsonnew.IsoString.iso(sjsonnew.support.scalajson.unsafe.CompactPrinter.apply,
sjsonnew.support.scalajson.unsafe.Parser.parseUnsafe) sjsonnew.support.scalajson.unsafe.Parser.parseUnsafe)
(s get Keys.stateStreams) getOrElse { (s get Keys.stateStreams) getOrElse {

View File

@ -10,7 +10,7 @@ import sbt.util.Level
import sbt.internal.util._ import sbt.internal.util._
import sbt.protocol.LogEvent import sbt.protocol.LogEvent
import sbt.internal.util.codec._ import sbt.internal.util.codec._
import scala.json.ast.unsafe._ import scalajson.ast.unsafe._
class RelayAppender(name: String) class RelayAppender(name: String)
extends AbstractAppender(name, null, PatternLayout.createDefaultLayout(), true) { extends AbstractAppender(name, null, PatternLayout.createDefaultLayout(), true) {

View File

@ -6,7 +6,7 @@ package internal
package server package server
import java.net.URI import java.net.URI
import scala.json.ast.unsafe.JValue import scalajson.ast.unsafe.JValue
import scala.util.{ Left, Right } import scala.util.{ Left, Right }
import sbt.util.{ SomeJsonWriter, NoJsonWriter } import sbt.util.{ SomeJsonWriter, NoJsonWriter }
import sbt.librarymanagement.LibraryManagementCodec._ import sbt.librarymanagement.LibraryManagementCodec._

View File

@ -188,7 +188,7 @@ object SettingQueryTest extends org.specs2.mutable.Specification {
"setting query" should { "setting query" should {
"t/scalaVersion" in qok("\"2.12.1\"", "java.lang.String") "t/scalaVersion" in qok("\"2.12.1\"", "java.lang.String")
"t/pollInterval" in qok("500", "Int") // "t/pollInterval" in qok("500", "Int")
"t/sourcesInBase" in qok("true", "Boolean") "t/sourcesInBase" in qok("true", "Boolean")
"t/startYear" in qok("null", "scala.Option[Int]") "t/startYear" in qok("null", "scala.Option[Int]")
"t/scalaArtifacts" in qok( "t/scalaArtifacts" in qok(

View File

@ -32,7 +32,7 @@ object ContrabandConfig {
case "sbt.testing.Status" => { _ => case "sbt.testing.Status" => { _ =>
"sbt.internal.testing.StatusFormats" :: Nil "sbt.internal.testing.StatusFormats" :: Nil
} }
case "scala.json.ast.unsafe.JValue" => { _ => case "scalajson.ast.unsafe.JValue" => { _ =>
"sbt.internal.util.codec.JValueFormats" :: Nil "sbt.internal.util.codec.JValueFormats" :: Nil
} }
} }

View File

@ -1,5 +1,6 @@
import sbt._ import sbt._
import Keys._ import Keys._
import sbt.contraband.ContrabandPlugin.autoImport._
object Dependencies { object Dependencies {
val scala282 = "2.8.2" val scala282 = "2.8.2"
@ -11,10 +12,10 @@ object Dependencies {
val baseScalaVersion = scala212 val baseScalaVersion = scala212
// sbt modules // sbt modules
private val ioVersion = "1.0.0-M11" private val ioVersion = "1.0.0-M12"
private val utilVersion = "1.0.0-M24" private val utilVersion = "1.0.0-M25"
private val lmVersion = "1.0.0-X15" private val lmVersion = "1.0.0-X16"
private val zincVersion = "1.0.0-X16" private val zincVersion = "1.0.0-X17"
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
@ -108,8 +109,7 @@ object Dependencies {
def addSbtZincCompile(p: Project): Project = def addSbtZincCompile(p: Project): Project =
addSbtModule(p, sbtZincPath, "zincCompile", zincCompile) addSbtModule(p, sbtZincPath, "zincCompile", zincCompile)
val sjsonNewScalaJson = "com.eed3si9n" %% "sjson-new-scalajson" % "0.7.0" val sjsonNewScalaJson = Def.setting { "com.eed3si9n" %% "sjson-new-scalajson" % contrabandSjsonNewVersion.value }
val scalatest = "org.scalatest" %% "scalatest" % "3.0.1" val scalatest = "org.scalatest" %% "scalatest" % "3.0.1"
val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.13.4" val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.13.4"
val specs2 = "org.specs2" %% "specs2" % "2.4.17" val specs2 = "org.specs2" %% "specs2" % "2.4.17"

View File

@ -7,6 +7,6 @@ scalacOptions ++= Seq("-feature", "-language:postfixOps")
// addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0") // addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0")
// addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.2.0") // addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.2.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.4.0") addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.4.0")
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0-M5") addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0-M7")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.3") addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.3")

View File

@ -14,7 +14,7 @@ final class ChannelAcceptedEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (17 + channelName.##) 37 * (37 * (17 + "ChannelAcceptedEvent".##) + channelName.##)
} }
override def toString: String = { override def toString: String = {
"ChannelAcceptedEvent(" + channelName + ")" "ChannelAcceptedEvent(" + channelName + ")"

View File

@ -15,7 +15,7 @@ override def equals(o: Any): Boolean = o match {
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
17 37 * (17 + "CommandMessage".##)
} }
override def toString: String = { override def toString: String = {
"CommandMessage()" "CommandMessage()"

View File

@ -15,7 +15,7 @@ override def equals(o: Any): Boolean = o match {
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
17 37 * (17 + "EventMessage".##)
} }
override def toString: String = { override def toString: String = {
"EventMessage()" "EventMessage()"

View File

@ -16,7 +16,7 @@ final class ExecCommand private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (17 + commandLine.##) + execId.##) 37 * (37 * (37 * (17 + "ExecCommand".##) + commandLine.##) + execId.##)
} }
override def toString: String = { override def toString: String = {
"ExecCommand(" + commandLine + ", " + execId + ")" "ExecCommand(" + commandLine + ", " + execId + ")"

View File

@ -18,7 +18,7 @@ final class ExecStatusEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (37 * (37 * (17 + status.##) + channelName.##) + execId.##) + commandQueue.##) 37 * (37 * (37 * (37 * (37 * (17 + "ExecStatusEvent".##) + status.##) + channelName.##) + execId.##) + commandQueue.##)
} }
override def toString: String = { override def toString: String = {
"ExecStatusEvent(" + status + ", " + channelName + ", " + execId + ", " + commandQueue + ")" "ExecStatusEvent(" + status + ", " + channelName + ", " + execId + ", " + commandQueue + ")"

View File

@ -16,7 +16,7 @@ final class ExecutionEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (17 + success.##) + commandLine.##) 37 * (37 * (37 * (17 + "ExecutionEvent".##) + success.##) + commandLine.##)
} }
override def toString: String = { override def toString: String = {
"ExecutionEvent(" + success + ", " + commandLine + ")" "ExecutionEvent(" + success + ", " + commandLine + ")"

View File

@ -16,7 +16,7 @@ final class LogEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (17 + level.##) + message.##) 37 * (37 * (37 * (17 + "LogEvent".##) + level.##) + message.##)
} }
override def toString: String = { override def toString: String = {
"LogEvent(" + level + ", " + message + ")" "LogEvent(" + level + ", " + message + ")"

View File

@ -14,7 +14,7 @@ final class SettingQuery private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (17 + setting.##) 37 * (37 * (17 + "SettingQuery".##) + setting.##)
} }
override def toString: String = { override def toString: String = {
"SettingQuery(" + setting + ")" "SettingQuery(" + setting + ")"

View File

@ -14,7 +14,7 @@ final class SettingQueryFailure private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (17 + message.##) 37 * (37 * (17 + "SettingQueryFailure".##) + message.##)
} }
override def toString: String = { override def toString: String = {
"SettingQueryFailure(" + message + ")" "SettingQueryFailure(" + message + ")"

View File

@ -14,7 +14,7 @@ override def equals(o: Any): Boolean = o match {
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
17 37 * (17 + "SettingQueryResponse".##)
} }
override def toString: String = { override def toString: String = {
"SettingQueryResponse()" "SettingQueryResponse()"

View File

@ -5,7 +5,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol package sbt.protocol
final class SettingQuerySuccess private ( final class SettingQuerySuccess private (
val value: scala.json.ast.unsafe.JValue, val value: scalajson.ast.unsafe.JValue,
val contentType: String) extends sbt.protocol.SettingQueryResponse() with Serializable { val contentType: String) extends sbt.protocol.SettingQueryResponse() with Serializable {
@ -15,15 +15,15 @@ final class SettingQuerySuccess private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (17 + value.##) + contentType.##) 37 * (37 * (37 * (17 + "SettingQuerySuccess".##) + value.##) + contentType.##)
} }
override def toString: String = { override def toString: String = {
"SettingQuerySuccess(" + value + ", " + contentType + ")" "SettingQuerySuccess(" + value + ", " + contentType + ")"
} }
protected[this] def copy(value: scala.json.ast.unsafe.JValue = value, contentType: String = contentType): SettingQuerySuccess = { protected[this] def copy(value: scalajson.ast.unsafe.JValue = value, contentType: String = contentType): SettingQuerySuccess = {
new SettingQuerySuccess(value, contentType) new SettingQuerySuccess(value, contentType)
} }
def withValue(value: scala.json.ast.unsafe.JValue): SettingQuerySuccess = { def withValue(value: scalajson.ast.unsafe.JValue): SettingQuerySuccess = {
copy(value = value) copy(value = value)
} }
def withContentType(contentType: String): SettingQuerySuccess = { def withContentType(contentType: String): SettingQuerySuccess = {
@ -32,5 +32,5 @@ final class SettingQuerySuccess private (
} }
object SettingQuerySuccess { object SettingQuerySuccess {
def apply(value: scala.json.ast.unsafe.JValue, contentType: String): SettingQuerySuccess = new SettingQuerySuccess(value, contentType) def apply(value: scalajson.ast.unsafe.JValue, contentType: String): SettingQuerySuccess = new SettingQuerySuccess(value, contentType)
} }

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait ChannelAcceptedEventFormats { self: sjsonnew.BasicJsonProtocol => trait ChannelAcceptedEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val ChannelAcceptedEventFormat: JsonFormat[sbt.protocol.ChannelAcceptedEvent] = new JsonFormat[sbt.protocol.ChannelAcceptedEvent] { implicit lazy val ChannelAcceptedEventFormat: JsonFormat[sbt.protocol.ChannelAcceptedEvent] = new JsonFormat[sbt.protocol.ChannelAcceptedEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ChannelAcceptedEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ChannelAcceptedEvent = {

View File

@ -4,7 +4,8 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder }
import _root_.sjsonnew.JsonFormat
trait CommandMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.codec.ExecCommandFormats with sbt.protocol.codec.SettingQueryFormats => trait CommandMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.codec.ExecCommandFormats with sbt.protocol.codec.SettingQueryFormats =>
implicit lazy val CommandMessageFormat: JsonFormat[sbt.protocol.CommandMessage] = flatUnionFormat2[sbt.protocol.CommandMessage, sbt.protocol.ExecCommand, sbt.protocol.SettingQuery]("type") implicit lazy val CommandMessageFormat: JsonFormat[sbt.protocol.CommandMessage] = flatUnionFormat2[sbt.protocol.CommandMessage, sbt.protocol.ExecCommand, sbt.protocol.SettingQuery]("type")
} }

View File

@ -4,7 +4,8 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder }
import _root_.sjsonnew.JsonFormat
trait EventMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.codec.ChannelAcceptedEventFormats with sbt.protocol.codec.LogEventFormats with sbt.protocol.codec.ExecStatusEventFormats with sbt.internal.util.codec.JValueFormats with sbt.protocol.codec.SettingQuerySuccessFormats with sbt.protocol.codec.SettingQueryFailureFormats => trait EventMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.codec.ChannelAcceptedEventFormats with sbt.protocol.codec.LogEventFormats with sbt.protocol.codec.ExecStatusEventFormats with sbt.internal.util.codec.JValueFormats with sbt.protocol.codec.SettingQuerySuccessFormats with sbt.protocol.codec.SettingQueryFailureFormats =>
implicit lazy val EventMessageFormat: JsonFormat[sbt.protocol.EventMessage] = flatUnionFormat5[sbt.protocol.EventMessage, sbt.protocol.ChannelAcceptedEvent, sbt.protocol.LogEvent, sbt.protocol.ExecStatusEvent, sbt.protocol.SettingQuerySuccess, sbt.protocol.SettingQueryFailure]("type") implicit lazy val EventMessageFormat: JsonFormat[sbt.protocol.EventMessage] = flatUnionFormat5[sbt.protocol.EventMessage, sbt.protocol.ChannelAcceptedEvent, sbt.protocol.LogEvent, sbt.protocol.ExecStatusEvent, sbt.protocol.SettingQuerySuccess, sbt.protocol.SettingQueryFailure]("type")
} }

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait ExecCommandFormats { self: sjsonnew.BasicJsonProtocol => trait ExecCommandFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val ExecCommandFormat: JsonFormat[sbt.protocol.ExecCommand] = new JsonFormat[sbt.protocol.ExecCommand] { implicit lazy val ExecCommandFormat: JsonFormat[sbt.protocol.ExecCommand] = new JsonFormat[sbt.protocol.ExecCommand] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ExecCommand = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ExecCommand = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait ExecStatusEventFormats { self: sjsonnew.BasicJsonProtocol => trait ExecStatusEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val ExecStatusEventFormat: JsonFormat[sbt.protocol.ExecStatusEvent] = new JsonFormat[sbt.protocol.ExecStatusEvent] { implicit lazy val ExecStatusEventFormat: JsonFormat[sbt.protocol.ExecStatusEvent] = new JsonFormat[sbt.protocol.ExecStatusEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ExecStatusEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ExecStatusEvent = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait ExecutionEventFormats { self: sjsonnew.BasicJsonProtocol => trait ExecutionEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val ExecutionEventFormat: JsonFormat[sbt.protocol.ExecutionEvent] = new JsonFormat[sbt.protocol.ExecutionEvent] { implicit lazy val ExecutionEventFormat: JsonFormat[sbt.protocol.ExecutionEvent] = new JsonFormat[sbt.protocol.ExecutionEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ExecutionEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ExecutionEvent = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait LogEventFormats { self: sjsonnew.BasicJsonProtocol => trait LogEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val LogEventFormat: JsonFormat[sbt.protocol.LogEvent] = new JsonFormat[sbt.protocol.LogEvent] { implicit lazy val LogEventFormat: JsonFormat[sbt.protocol.LogEvent] = new JsonFormat[sbt.protocol.LogEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.LogEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.LogEvent = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait SettingQueryFailureFormats { self: sjsonnew.BasicJsonProtocol => trait SettingQueryFailureFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val SettingQueryFailureFormat: JsonFormat[sbt.protocol.SettingQueryFailure] = new JsonFormat[sbt.protocol.SettingQueryFailure] { implicit lazy val SettingQueryFailureFormat: JsonFormat[sbt.protocol.SettingQueryFailure] = new JsonFormat[sbt.protocol.SettingQueryFailure] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.SettingQueryFailure = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.SettingQueryFailure = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait SettingQueryFormats { self: sjsonnew.BasicJsonProtocol => trait SettingQueryFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val SettingQueryFormat: JsonFormat[sbt.protocol.SettingQuery] = new JsonFormat[sbt.protocol.SettingQuery] { implicit lazy val SettingQueryFormat: JsonFormat[sbt.protocol.SettingQuery] = new JsonFormat[sbt.protocol.SettingQuery] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.SettingQuery = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.SettingQuery = {

View File

@ -4,7 +4,8 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder }
import _root_.sjsonnew.JsonFormat
trait SettingQueryResponseFormats { self: sbt.internal.util.codec.JValueFormats with sjsonnew.BasicJsonProtocol with sbt.protocol.codec.SettingQuerySuccessFormats with sbt.protocol.codec.SettingQueryFailureFormats => trait SettingQueryResponseFormats { self: sbt.internal.util.codec.JValueFormats with sjsonnew.BasicJsonProtocol with sbt.protocol.codec.SettingQuerySuccessFormats with sbt.protocol.codec.SettingQueryFailureFormats =>
implicit lazy val SettingQueryResponseFormat: JsonFormat[sbt.protocol.SettingQueryResponse] = flatUnionFormat2[sbt.protocol.SettingQueryResponse, sbt.protocol.SettingQuerySuccess, sbt.protocol.SettingQueryFailure]("type") implicit lazy val SettingQueryResponseFormat: JsonFormat[sbt.protocol.SettingQueryResponse] = flatUnionFormat2[sbt.protocol.SettingQueryResponse, sbt.protocol.SettingQuerySuccess, sbt.protocol.SettingQueryFailure]("type")
} }

View File

@ -4,14 +4,14 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.codec package sbt.protocol.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait SettingQuerySuccessFormats { self: sbt.internal.util.codec.JValueFormats with sjsonnew.BasicJsonProtocol => trait SettingQuerySuccessFormats { self: sbt.internal.util.codec.JValueFormats with sjsonnew.BasicJsonProtocol =>
implicit lazy val SettingQuerySuccessFormat: JsonFormat[sbt.protocol.SettingQuerySuccess] = new JsonFormat[sbt.protocol.SettingQuerySuccess] { implicit lazy val SettingQuerySuccessFormat: JsonFormat[sbt.protocol.SettingQuerySuccess] = new JsonFormat[sbt.protocol.SettingQuerySuccess] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.SettingQuerySuccess = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.SettingQuerySuccess = {
jsOpt match { jsOpt match {
case Some(js) => case Some(js) =>
unbuilder.beginObject(js) unbuilder.beginObject(js)
val value = unbuilder.readField[scala.json.ast.unsafe.JValue]("value") val value = unbuilder.readField[scalajson.ast.unsafe.JValue]("value")
val contentType = unbuilder.readField[String]("contentType") val contentType = unbuilder.readField[String]("contentType")
unbuilder.endObject() unbuilder.endObject()
sbt.protocol.SettingQuerySuccess(value, contentType) sbt.protocol.SettingQuerySuccess(value, contentType)

View File

@ -43,7 +43,7 @@ type ExecStatusEvent implements EventMessage {
interface SettingQueryResponse implements EventMessage {} interface SettingQueryResponse implements EventMessage {}
type SettingQuerySuccess implements SettingQueryResponse { type SettingQuerySuccess implements SettingQueryResponse {
value: scala.json.ast.unsafe.JValue! value: scalajson.ast.unsafe.JValue!
contentType: String! contentType: String!
} }

View File

@ -6,7 +6,7 @@ package protocol
import sjsonnew.JsonFormat import sjsonnew.JsonFormat
import sjsonnew.support.scalajson.unsafe.{ Parser, Converter, CompactPrinter } import sjsonnew.support.scalajson.unsafe.{ Parser, Converter, CompactPrinter }
import scala.json.ast.unsafe.{ JValue, JObject, JString } import scalajson.ast.unsafe.{ JValue, JObject, JString }
import java.nio.ByteBuffer import java.nio.ByteBuffer
import scala.util.{ Success, Failure } import scala.util.{ Success, Failure }
import sbt.internal.util.StringEvent import sbt.internal.util.StringEvent

View File

@ -38,7 +38,7 @@ final class ForkOptions private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + javaHome.##) + outputStrategy.##) + bootJars.##) + workingDirectory.##) + runJVMOptions.##) + connectInput.##) + envVars.##) 37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + "ForkOptions".##) + javaHome.##) + outputStrategy.##) + bootJars.##) + workingDirectory.##) + runJVMOptions.##) + connectInput.##) + envVars.##)
} }
override def toString: String = { override def toString: String = {
"ForkOptions(" + javaHome + ", " + outputStrategy + ", " + bootJars + ", " + workingDirectory + ", " + runJVMOptions + ", " + connectInput + ", " + envVars + ")" "ForkOptions(" + javaHome + ", " + outputStrategy + ", " + bootJars + ", " + workingDirectory + ", " + runJVMOptions + ", " + connectInput + ", " + envVars + ")"

View File

@ -1,4 +1,4 @@
import sjsonnew.BasicJsonProtocol.{ project => _, _ } import sjsonnew.BasicJsonProtocol._
lazy val x = taskKey[Int]("x") lazy val x = taskKey[Int]("x")
lazy val y = taskKey[Int]("y") lazy val y = taskKey[Int]("y")

View File

@ -2,7 +2,7 @@ import complete.Parser
import complete.DefaultParsers._ import complete.DefaultParsers._
import sbinary.DefaultProtocol._ import sbinary.DefaultProtocol._
import Def.Initialize import Def.Initialize
import sjsonnew.BasicJsonProtocol.{ project => _, _ } import sjsonnew.BasicJsonProtocol._
val keep = taskKey[Int]("") val keep = taskKey[Int]("")
val persist = taskKey[Int]("") val persist = taskKey[Int]("")

View File

@ -16,7 +16,7 @@ final class EndTestGroupErrorEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (17 + name.##) + error.##) 37 * (37 * (37 * (17 + "EndTestGroupErrorEvent".##) + name.##) + error.##)
} }
override def toString: String = { override def toString: String = {
"EndTestGroupErrorEvent(" + name + ", " + error + ")" "EndTestGroupErrorEvent(" + name + ", " + error + ")"

View File

@ -16,7 +16,7 @@ final class EndTestGroupEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (17 + name.##) + result.##) 37 * (37 * (37 * (17 + "EndTestGroupEvent".##) + name.##) + result.##)
} }
override def toString: String = { override def toString: String = {
"EndTestGroupEvent(" + name + ", " + result + ")" "EndTestGroupEvent(" + name + ", " + result + ")"

View File

@ -15,7 +15,7 @@ final class StartTestGroupEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (17 + name.##) 37 * (37 * (17 + "StartTestGroupEvent".##) + name.##)
} }
override def toString: String = { override def toString: String = {
"StartTestGroupEvent(" + name + ")" "StartTestGroupEvent(" + name + ")"

View File

@ -15,7 +15,7 @@ final class TestCompleteEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (17 + result.##) 37 * (37 * (17 + "TestCompleteEvent".##) + result.##)
} }
override def toString: String = { override def toString: String = {
"TestCompleteEvent(" + result + ")" "TestCompleteEvent(" + result + ")"

View File

@ -14,7 +14,7 @@ override def equals(o: Any): Boolean = o match {
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
17 37 * (17 + "TestInitEvent".##)
} }
override def toString: String = { override def toString: String = {
"TestInitEvent()" "TestInitEvent()"

View File

@ -26,7 +26,7 @@ final class TestItemDetail private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (37 * (17 + fullyQualifiedName.##) + status.##) + duration.##) 37 * (37 * (37 * (37 * (17 + "TestItemDetail".##) + fullyQualifiedName.##) + status.##) + duration.##)
} }
override def toString: String = { override def toString: String = {
"TestItemDetail(" + fullyQualifiedName + ", " + status + ", " + duration + ")" "TestItemDetail(" + fullyQualifiedName + ", " + status + ", " + duration + ")"

View File

@ -16,7 +16,7 @@ final class TestItemEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (37 * (17 + result.##) + detail.##) 37 * (37 * (37 * (17 + "TestItemEvent".##) + result.##) + detail.##)
} }
override def toString: String = { override def toString: String = {
"TestItemEvent(" + result + ", " + detail + ")" "TestItemEvent(" + result + ", " + detail + ")"

View File

@ -15,7 +15,7 @@ override def equals(o: Any): Boolean = o match {
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
17 37 * (17 + "TestMessage".##)
} }
override def toString: String = { override def toString: String = {
"TestMessage()" "TestMessage()"

View File

@ -14,7 +14,7 @@ final class TestStringEvent private (
case _ => false case _ => false
} }
override def hashCode: Int = { override def hashCode: Int = {
37 * (17 + value.##) 37 * (37 * (17 + "TestStringEvent".##) + value.##)
} }
override def toString: String = { override def toString: String = {
value value

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait EndTestGroupErrorEventFormats { self: sjsonnew.BasicJsonProtocol => trait EndTestGroupErrorEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val EndTestGroupErrorEventFormat: JsonFormat[sbt.protocol.testing.EndTestGroupErrorEvent] = new JsonFormat[sbt.protocol.testing.EndTestGroupErrorEvent] { implicit lazy val EndTestGroupErrorEventFormat: JsonFormat[sbt.protocol.testing.EndTestGroupErrorEvent] = new JsonFormat[sbt.protocol.testing.EndTestGroupErrorEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.EndTestGroupErrorEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.EndTestGroupErrorEvent = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait EndTestGroupEventFormats { self: sbt.protocol.testing.codec.TestResultFormats with sjsonnew.BasicJsonProtocol => trait EndTestGroupEventFormats { self: sbt.protocol.testing.codec.TestResultFormats with sjsonnew.BasicJsonProtocol =>
implicit lazy val EndTestGroupEventFormat: JsonFormat[sbt.protocol.testing.EndTestGroupEvent] = new JsonFormat[sbt.protocol.testing.EndTestGroupEvent] { implicit lazy val EndTestGroupEventFormat: JsonFormat[sbt.protocol.testing.EndTestGroupEvent] = new JsonFormat[sbt.protocol.testing.EndTestGroupEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.EndTestGroupEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.EndTestGroupEvent = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait StartTestGroupEventFormats { self: sjsonnew.BasicJsonProtocol => trait StartTestGroupEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val StartTestGroupEventFormat: JsonFormat[sbt.protocol.testing.StartTestGroupEvent] = new JsonFormat[sbt.protocol.testing.StartTestGroupEvent] { implicit lazy val StartTestGroupEventFormat: JsonFormat[sbt.protocol.testing.StartTestGroupEvent] = new JsonFormat[sbt.protocol.testing.StartTestGroupEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.StartTestGroupEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.StartTestGroupEvent = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait TestCompleteEventFormats { self: sbt.protocol.testing.codec.TestResultFormats with sjsonnew.BasicJsonProtocol => trait TestCompleteEventFormats { self: sbt.protocol.testing.codec.TestResultFormats with sjsonnew.BasicJsonProtocol =>
implicit lazy val TestCompleteEventFormat: JsonFormat[sbt.protocol.testing.TestCompleteEvent] = new JsonFormat[sbt.protocol.testing.TestCompleteEvent] { implicit lazy val TestCompleteEventFormat: JsonFormat[sbt.protocol.testing.TestCompleteEvent] = new JsonFormat[sbt.protocol.testing.TestCompleteEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestCompleteEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestCompleteEvent = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait TestInitEventFormats { self: sjsonnew.BasicJsonProtocol => trait TestInitEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val TestInitEventFormat: JsonFormat[sbt.protocol.testing.TestInitEvent] = new JsonFormat[sbt.protocol.testing.TestInitEvent] { implicit lazy val TestInitEventFormat: JsonFormat[sbt.protocol.testing.TestInitEvent] = new JsonFormat[sbt.protocol.testing.TestInitEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestInitEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestInitEvent = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait TestItemDetailFormats { self: sbt.internal.testing.StatusFormats with sjsonnew.BasicJsonProtocol => trait TestItemDetailFormats { self: sbt.internal.testing.StatusFormats with sjsonnew.BasicJsonProtocol =>
implicit lazy val TestItemDetailFormat: JsonFormat[sbt.protocol.testing.TestItemDetail] = new JsonFormat[sbt.protocol.testing.TestItemDetail] { implicit lazy val TestItemDetailFormat: JsonFormat[sbt.protocol.testing.TestItemDetail] = new JsonFormat[sbt.protocol.testing.TestItemDetail] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestItemDetail = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestItemDetail = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait TestItemEventFormats { self: sbt.protocol.testing.codec.TestResultFormats with sbt.protocol.testing.codec.TestItemDetailFormats with sjsonnew.BasicJsonProtocol => trait TestItemEventFormats { self: sbt.protocol.testing.codec.TestResultFormats with sbt.protocol.testing.codec.TestItemDetailFormats with sjsonnew.BasicJsonProtocol =>
implicit lazy val TestItemEventFormat: JsonFormat[sbt.protocol.testing.TestItemEvent] = new JsonFormat[sbt.protocol.testing.TestItemEvent] { implicit lazy val TestItemEventFormat: JsonFormat[sbt.protocol.testing.TestItemEvent] = new JsonFormat[sbt.protocol.testing.TestItemEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestItemEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestItemEvent = {

View File

@ -4,7 +4,8 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder }
import _root_.sjsonnew.JsonFormat
trait TestMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.testing.codec.TestStringEventFormats with sbt.protocol.testing.codec.TestInitEventFormats with sbt.protocol.testing.codec.TestResultFormats with sbt.protocol.testing.codec.TestCompleteEventFormats with sbt.protocol.testing.codec.StartTestGroupEventFormats with sbt.protocol.testing.codec.EndTestGroupEventFormats with sbt.protocol.testing.codec.EndTestGroupErrorEventFormats with sbt.protocol.testing.codec.TestItemDetailFormats with sbt.protocol.testing.codec.TestItemEventFormats => trait TestMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.testing.codec.TestStringEventFormats with sbt.protocol.testing.codec.TestInitEventFormats with sbt.protocol.testing.codec.TestResultFormats with sbt.protocol.testing.codec.TestCompleteEventFormats with sbt.protocol.testing.codec.StartTestGroupEventFormats with sbt.protocol.testing.codec.EndTestGroupEventFormats with sbt.protocol.testing.codec.EndTestGroupErrorEventFormats with sbt.protocol.testing.codec.TestItemDetailFormats with sbt.protocol.testing.codec.TestItemEventFormats =>
implicit lazy val TestMessageFormat: JsonFormat[sbt.protocol.testing.TestMessage] = flatUnionFormat7[sbt.protocol.testing.TestMessage, sbt.protocol.testing.TestStringEvent, sbt.protocol.testing.TestInitEvent, sbt.protocol.testing.TestCompleteEvent, sbt.protocol.testing.StartTestGroupEvent, sbt.protocol.testing.EndTestGroupEvent, sbt.protocol.testing.EndTestGroupErrorEvent, sbt.protocol.testing.TestItemEvent]("type") implicit lazy val TestMessageFormat: JsonFormat[sbt.protocol.testing.TestMessage] = flatUnionFormat7[sbt.protocol.testing.TestMessage, sbt.protocol.testing.TestStringEvent, sbt.protocol.testing.TestInitEvent, sbt.protocol.testing.TestCompleteEvent, sbt.protocol.testing.StartTestGroupEvent, sbt.protocol.testing.EndTestGroupEvent, sbt.protocol.testing.EndTestGroupErrorEvent, sbt.protocol.testing.TestItemEvent]("type")
} }

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait TestResultFormats { self: sjsonnew.BasicJsonProtocol => trait TestResultFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val TestResultFormat: JsonFormat[sbt.protocol.testing.TestResult] = new JsonFormat[sbt.protocol.testing.TestResult] { implicit lazy val TestResultFormat: JsonFormat[sbt.protocol.testing.TestResult] = new JsonFormat[sbt.protocol.testing.TestResult] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestResult = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestResult = {

View File

@ -4,7 +4,7 @@
// DO NOT EDIT MANUALLY // DO NOT EDIT MANUALLY
package sbt.protocol.testing.codec package sbt.protocol.testing.codec
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder } import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait TestStringEventFormats { self: sjsonnew.BasicJsonProtocol => trait TestStringEventFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val TestStringEventFormat: JsonFormat[sbt.protocol.testing.TestStringEvent] = new JsonFormat[sbt.protocol.testing.TestStringEvent] { implicit lazy val TestStringEventFormat: JsonFormat[sbt.protocol.testing.TestStringEvent] = new JsonFormat[sbt.protocol.testing.TestStringEvent] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestStringEvent = { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.testing.TestStringEvent = {