forked from scalacenter/scastie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor sbt-runners to use NonBlockingProcess
- Loading branch information
1 parent
d100ad5
commit c9f2af7
Showing
59 changed files
with
1,914 additions
and
1,280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ brew install openjdk sbt nodejs yarn | |
### Get latest Scala.js Bundler | ||
|
||
git clone [email protected]:scalacenter/scalajs-bundler.git | ||
git checkout master | ||
sbt publishLocal | ||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
api/src/main/scala/com.olegych.scastie.api/ProcessOutput.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.olegych.scastie.api | ||
|
||
import play.api.libs.json._ | ||
|
||
trait ProcessOutputType | ||
object ProcessOutputType { | ||
case object StdOut extends ProcessOutputType | ||
case object StdErr extends ProcessOutputType | ||
|
||
implicit object ProcessOutputTypeFormat extends Format[ProcessOutputType] { | ||
def writes(processOutputType: ProcessOutputType): JsValue = { | ||
JsString(processOutputType.toString) | ||
} | ||
|
||
private val values = | ||
List( | ||
StdOut, | ||
StdErr | ||
).map(v => (v.toString, v)).toMap | ||
|
||
def reads(json: JsValue): JsResult[ProcessOutputType] = { | ||
json match { | ||
case JsString(tpe) => { | ||
values.get(tpe) match { | ||
case Some(v) => JsSuccess(v) | ||
case _ => JsError(Seq()) | ||
} | ||
} | ||
case _ => JsError(Seq()) | ||
} | ||
} | ||
} | ||
} | ||
|
||
object ProcessOutput { | ||
implicit val formatProcessOutput: OFormat[ProcessOutput] = | ||
Json.format[ProcessOutput] | ||
} | ||
|
||
case class ProcessOutput( | ||
line: String, | ||
tpe: ProcessOutputType | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.