package sbt.internal.worker
@target(Scala)
@codecPackage("sbt.internal.worker.codec")
@fullCodec("JsonProtocol")

type FilePath {
  path: java.net.URI!
  digest: String!
}

type JvmRunInfo {
  args: [String],
  classpath: [sbt.internal.worker.FilePath],
  mainClass: String!
  connectInput: Boolean!
  javaHome: java.net.URI
  outputStrategy: String
  workingDirectory: java.net.URI
  jvmOptions: [String]
  environmentVariables: StringStringMap!
  inputs: [sbt.internal.worker.FilePath] @since("0.1.0"),
  outputs: [sbt.internal.worker.FilePath] @since("0.1.0"),
}

type NativeRunInfo {
  cmd: String!,
  args: [String],
  connectInput: Boolean!
  outputStrategy: String
  workingDirectory: java.net.URI
  environmentVariables: StringStringMap!
  inputs: [sbt.internal.worker.FilePath] @since("0.1.0"),
  outputs: [sbt.internal.worker.FilePath] @since("0.1.0"),
}

type RunInfo {
  jvm: Boolean!
  jvmRunInfo: sbt.internal.worker.JvmRunInfo,
  nativeRunInfo: sbt.internal.worker.NativeRunInfo @since("0.1.0"),
  windowTitle: String,
}

## Client-side job support.
##
## Notification: sbt/clientJob
##
## Parameter for the sbt/clientJob notification.
## A client-side job represents a unit of work that sbt server
## can outsourse back to the client, for example for run task.
type ClientJobParams {
  runInfo: sbt.internal.worker.RunInfo
}

## Configuration for creating a ScalaInstance in forked process.
type ScalaInstanceConfig {
  scalaVersion: String!
  libraryJars: [java.net.URI]
  allCompilerJars: [java.net.URI]
  extraToolJars: [java.net.URI] @since("0.1.0")
}
