Skip to content

Commit

Permalink
bump Ammonite version
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Nov 18, 2018
1 parent 10169e0 commit c738534
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 21 deletions.
5 changes: 2 additions & 3 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import mill._
import mill.scalalib._
import publish._
import mill.modules.Jvm.createAssembly
import upickle.Js
trait MillPublishModule extends PublishModule{

def artifactName = "mill-" + super.artifactName()
Expand Down Expand Up @@ -88,7 +87,7 @@ object main extends MillModule {

def ivyDeps = Agg(
// Keep synchronized with ammonite in Versions.scala
ivy"com.lihaoyi:::ammonite:1.4.2",
ivy"com.lihaoyi:::ammonite:1.4.4",
// Necessary so we can share the JNA classes throughout the build process
ivy"net.java.dev.jna:jna:4.5.0",
ivy"net.java.dev.jna:jna-platform:4.5.0"
Expand Down Expand Up @@ -521,7 +520,7 @@ def uploadToGithub(authKey: String) = T.command{
scalaj.http.Http("https://api.github.com/repos/lihaoyi/mill/releases")
.postData(
ujson.write(
Js.Obj(
ujson.Js.Obj(
"tag_name" -> releaseTag,
"name" -> releaseTag
)
Expand Down
3 changes: 1 addition & 2 deletions main/core/src/mill/eval/Evaluator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import mill.eval.Result.OuterStack
import mill.util
import mill.util._
import mill.util.Strict.Agg
import upickle.Js

import scala.collection.mutable
import scala.util.control.NonFatal
Expand Down Expand Up @@ -346,7 +345,7 @@ case class Evaluator(home: os.Path,


object Evaluator{
case class Cached(value: Js.Value,
case class Cached(value: ujson.Value,
valueHash: Int,
inputsHash: Int)
object Cached{
Expand Down
15 changes: 7 additions & 8 deletions main/core/src/mill/util/JsonFormatters.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mill.util

import upickle.Js
import upickle.default.{ReadWriter => RW}
import scala.util.matching.Regex
object JsonFormatters extends JsonFormatters
Expand Down Expand Up @@ -29,14 +28,14 @@ trait JsonFormatters {
implicit lazy val modFormat: RW[coursier.Module] = upickle.default.macroRW
implicit lazy val depFormat: RW[coursier.Dependency]= upickle.default.macroRW
implicit lazy val attrFormat: RW[coursier.Attributes] = upickle.default.macroRW
implicit val stackTraceRW = upickle.default.readwriter[Js.Obj].bimap[StackTraceElement](
ste => Js.Obj(
"declaringClass" -> Js.Str(ste.getClassName),
"methodName" -> Js.Str(ste.getMethodName),
"fileName" -> Js.Str(ste.getFileName),
"lineNumber" -> Js.Num(ste.getLineNumber)
implicit val stackTraceRW = upickle.default.readwriter[ujson.Obj].bimap[StackTraceElement](
ste => ujson.Obj(
"declaringClass" -> ujson.Str(ste.getClassName),
"methodName" -> ujson.Str(ste.getMethodName),
"fileName" -> ujson.Str(ste.getFileName),
"lineNumber" -> ujson.Num(ste.getLineNumber)
),
{case json: Js.Obj =>
{case json: ujson.Obj =>
new StackTraceElement(
json("declaringClass").str.toString,
json("methodName").str.toString,
Expand Down
3 changes: 1 addition & 2 deletions main/src/mill/main/MainModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import mill.define.{NamedTask, Task}
import mill.eval.{Evaluator, PathRef, Result}
import mill.util.{Ctx, PrintLogger, Watched}
import pprint.{Renderer, Truncated}
import upickle.Js
object MainModule{
def resolveTasks[T](evaluator: Evaluator, targets: Seq[String], multiSelect: Boolean)
(f: List[NamedTask[Any]] => T) = {
Expand All @@ -17,7 +16,7 @@ object MainModule{
}
}
def evaluateTasks[T](evaluator: Evaluator, targets: Seq[String], multiSelect: Boolean)
(f: Seq[(Any, Option[Js.Value])] => T) = {
(f: Seq[(Any, Option[ujson.Value])] => T) = {
RunScript.evaluateTasks(evaluator, targets, multiSelect) match{
case Left(err) => Result.Failure(err)
case Right((watched, Left(err))) => Result.Failure(err, Some(Watched((), watched)))
Expand Down
7 changes: 3 additions & 4 deletions main/src/mill/main/RunScript.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import mill.define._
import mill.eval.{Evaluator, PathRef, Result}
import mill.util.{EitherOps, Logger, ParseArgs, Watched}
import mill.util.Strict.Agg
import upickle.Js

import scala.collection.mutable
import scala.reflect.ClassTag
Expand All @@ -30,7 +29,7 @@ object RunScript{
stateCache: Option[Evaluator.State],
log: Logger,
env : Map[String, String])
: (Res[(Evaluator, Seq[PathRef], Either[String, Seq[Js.Value]])], Seq[(os.Path, Long)]) = {
: (Res[(Evaluator, Seq[PathRef], Either[String, Seq[ujson.Value]])], Seq[(os.Path, Long)]) = {

val (evalState, interpWatched) = stateCache match{
case Some(s) if watchedSigUnchanged(s.watched) => Res.Success(s) -> s.watched
Expand Down Expand Up @@ -198,7 +197,7 @@ object RunScript{
}

def evaluate(evaluator: Evaluator,
targets: Agg[Task[Any]]): (Seq[PathRef], Either[String, Seq[(Any, Option[upickle.Js.Value])]]) = {
targets: Agg[Task[Any]]): (Seq[PathRef], Either[String, Seq[(Any, Option[ujson.Value])]]) = {
val evaluated = evaluator.evaluate(targets)
val watched = evaluated.results
.iterator
Expand Down Expand Up @@ -239,7 +238,7 @@ object RunScript{
val jsonFile = Evaluator
.resolveDestPaths(evaluator.outPath, t.ctx.segments)
.meta
val metadata = upickle.default.readJs[Evaluator.Cached](ujson.read(jsonFile.toIO))
val metadata = upickle.default.read[Evaluator.Cached](ujson.read(jsonFile.toIO))
Some(metadata.value)

case _ => None
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ optimizer without classpath conflicts.

## Changelog

### 0.3.5

- Bump uPickle to 0.7.1

### 0.3.4

- Mill is now bundled with [OS-Lib](https://github.com/lihaoyi/os-lib),
Expand Down
2 changes: 1 addition & 1 deletion scalalib/src/mill/scalalib/JavaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ trait TestModule extends JavaModule with TaskModule {

try {
val jsonOutput = ujson.read(outputPath.toIO)
val (doneMsg, results) = upickle.default.readJs[(String, Seq[TestRunner.Result])](jsonOutput)
val (doneMsg, results) = upickle.default.read[(String, Seq[TestRunner.Result])](jsonOutput)
TestModule.handleResults(doneMsg, results)
}catch{case e: Throwable =>
Result.Failure("Test reporting failed: " + e)
Expand Down
2 changes: 1 addition & 1 deletion scalalib/src/mill/scalalib/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package mill.scalalib

object Versions {
// Keep synchronized with ammonite dependency in core in build.sc
val ammonite = "1.4.0"
val ammonite = "1.4.4"
// Keep synchronized with zinc dependency in scalalib.worker in build.sc
val zinc = "1.2.1"
}

0 comments on commit c738534

Please sign in to comment.