From 155e3b106d58741cb3f3330a9ec4fb78c0fc5c31 Mon Sep 17 00:00:00 2001 From: rockjam <5min4eq.unity@gmail.com> Date: Wed, 4 Apr 2018 21:05:29 +0300 Subject: fix minor typos in docs --- docs/pages/1 - Intro to Mill.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/pages/1 - Intro to Mill.md b/docs/pages/1 - Intro to Mill.md index d0ce29c7..305721d4 100644 --- a/docs/pages/1 - Intro to Mill.md +++ b/docs/pages/1 - Intro to Mill.md @@ -453,13 +453,12 @@ res2: mill.scalalib.CompilationResult = CompilationResult( ) ``` -You can run `mill` alone to open a build REPL; this is a Scala console with your +You can run `mill -i` to open a build REPL; this is a Scala console with your `build.sc` loaded, which lets you run tasks interactively. The task-running syntax is slightly different from the command-line, but more in-line with how you would depend on tasks from within your build file. -You can use this REPL to run build commands quicker, due to keeping the JVM warm -between runs, or to interactively explore your build to see what is available. +You can use this REPL to interactively explore your build to see what is available. ## Deploying your code @@ -543,6 +542,5 @@ You also need to specify `release` as `true` or `false`, depending on whether you just want to stage your module on `oss.sonatype.org` or you want Mill to complete the release process to Maven Central. -If you are publishing multiple artifacts, you can also use `target/bin/mill -mill.scalalib.PublishModule/publishAll1 as described +If you are publishing multiple artifacts, you can also use `mill mill.scalalib.PublishModule/publishAll` as described [here](http://www.lihaoyi.com/mill/page/common-project-layouts.html#publishing) -- cgit v1.2.3 From 7d80dd1f0847e38db54966ea7fbd08400840ba7d Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Wed, 4 Apr 2018 16:36:16 -0700 Subject: bump ammonite/upickle version --- build.sc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sc b/build.sc index 1890edf2..5898913e 100755 --- a/build.sc +++ b/build.sc @@ -65,7 +65,6 @@ trait MillModule extends MillPublishModule{ outer => object clientserver extends MillModule{ def ivyDeps = Agg( - ivy"com.lihaoyi:::ammonite:1.1.0-12-f07633d", ivy"org.scala-sbt.ipcsocket:ipcsocket:1.0.0" ) val test = new Tests(implicitly) @@ -80,7 +79,7 @@ object core extends MillModule { def ivyDeps = Agg( ivy"com.lihaoyi::sourcecode:0.1.4", - ivy"com.lihaoyi:::ammonite:1.1.0-12-f07633d", + ivy"com.lihaoyi:::ammonite:1.1.0-14-037b8eb", ) def generatedSources = T { -- cgit v1.2.3 From 36eb8bd6bfd534d002b01f8800e4b5d896aa4e77 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sun, 1 Apr 2018 22:57:43 -0700 Subject: - Add `mill version` command - Make `Evaluator` robust against `null` results --- core/src/mill/eval/Evaluator.scala | 6 +++--- main/src/mill/main/MainModule.scala | 6 +++++- main/test/src/mill/eval/EvaluationTests.scala | 26 ++++++++++++++++++++++++++ main/test/src/mill/util/TestGraphs.scala | 17 +++++++++++++++++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/core/src/mill/eval/Evaluator.scala b/core/src/mill/eval/Evaluator.scala index f423092b..a1bbf142 100644 --- a/core/src/mill/eval/Evaluator.scala +++ b/core/src/mill/eval/Evaluator.scala @@ -171,10 +171,10 @@ case class Evaluator[T](home: Path, newResults(labelledNamedTask.task) match{ case Result.Failure(_, Some((v, hashCode))) => - handleTaskResult(v, v.hashCode, paths.meta, inputsHash, labelledNamedTask) + handleTaskResult(v, v.##, paths.meta, inputsHash, labelledNamedTask) case Result.Success((v, hashCode)) => - handleTaskResult(v, v.hashCode, paths.meta, inputsHash, labelledNamedTask) + handleTaskResult(v, v.##, paths.meta, inputsHash, labelledNamedTask) case _ => // Wipe out any cached meta.json file that exists, so @@ -301,7 +301,7 @@ case class Evaluator[T](home: Path, newResults(task) = for(v <- res) yield { (v, if (task.isInstanceOf[Worker[_]]) inputsHash - else v.hashCode + else v.## ) } } diff --git a/main/src/mill/main/MainModule.scala b/main/src/mill/main/MainModule.scala index 7c84f74a..32281407 100644 --- a/main/src/mill/main/MainModule.scala +++ b/main/src/mill/main/MainModule.scala @@ -30,7 +30,11 @@ trait MainModule extends mill.Module{ implicit def millDiscover: mill.define.Discover[_] implicit def millScoptTasksReads[T] = new mill.main.Tasks.Scopt[T]() implicit def millScoptEvaluatorReads[T] = new mill.main.EvaluatorScopt[T]() - + def version() = mill.T.command { + val res = System.getProperty("MILL_VERSION") + println(res) + res + } /** * Resolves a mill query string and prints out the tasks it resolves to. */ diff --git a/main/test/src/mill/eval/EvaluationTests.scala b/main/test/src/mill/eval/EvaluationTests.scala index 66147963..9c215086 100644 --- a/main/test/src/mill/eval/EvaluationTests.scala +++ b/main/test/src/mill/eval/EvaluationTests.scala @@ -247,6 +247,32 @@ object EvaluationTests extends TestSuite{ !overriden.contains("object1") ) } + 'nullTasks - { + import nullTasks._ + val checker = new Checker(nullTasks) + checker(nullTarget1, null, Agg(nullTarget1), extraEvaled = -1) + checker(nullTarget1, null, Agg(), extraEvaled = -1) + checker(nullTarget2, null, Agg(nullTarget2), extraEvaled = -1) + checker(nullTarget2, null, Agg(), extraEvaled = -1) + checker(nullTarget3, null, Agg(nullTarget3), extraEvaled = -1) + checker(nullTarget3, null, Agg(), extraEvaled = -1) + checker(nullTarget4, null, Agg(nullTarget4), extraEvaled = -1) + checker(nullTarget4, null, Agg(), extraEvaled = -1) + + val nc1 = nullCommand1() + val nc2 = nullCommand2() + val nc3 = nullCommand3() + val nc4 = nullCommand4() + + checker(nc1, null, Agg(nc1), extraEvaled = -1, secondRunNoOp = false) + checker(nc1, null, Agg(nc1), extraEvaled = -1, secondRunNoOp = false) + checker(nc2, null, Agg(nc2), extraEvaled = -1, secondRunNoOp = false) + checker(nc2, null, Agg(nc2), extraEvaled = -1, secondRunNoOp = false) + checker(nc3, null, Agg(nc3), extraEvaled = -1, secondRunNoOp = false) + checker(nc3, null, Agg(nc3), extraEvaled = -1, secondRunNoOp = false) + checker(nc4, null, Agg(nc4), extraEvaled = -1, secondRunNoOp = false) + checker(nc4, null, Agg(nc4), extraEvaled = -1, secondRunNoOp = false) + } 'tasksAreUncached - { // Make sure the tasks `left` and `middle` re-compute every time, while diff --git a/main/test/src/mill/util/TestGraphs.scala b/main/test/src/mill/util/TestGraphs.scala index 11f72d02..83e03576 100644 --- a/main/test/src/mill/util/TestGraphs.scala +++ b/main/test/src/mill/util/TestGraphs.scala @@ -196,6 +196,23 @@ object TestGraphs{ override lazy val millDiscover: Discover[this.type] = Discover[this.type] } + object nullTasks extends TestUtil.BaseModule{ + val nullString: String = null + def nullTask1 = T.task{ nullString } + def nullTask2 = T.task{ nullTask1() } + + def nullTarget1 = T{ nullString } + def nullTarget2 = T{ nullTarget1() } + def nullTarget3 = T{ nullTask1() } + def nullTarget4 = T{ nullTask2() } + + def nullCommand1() = T.command{ nullString } + def nullCommand2() = T.command{ nullTarget1() } + def nullCommand3() = T.command{ nullTask1() } + def nullCommand4() = T.command{ nullTask2() } + + override lazy val millDiscover: Discover[this.type] = Discover[this.type] + } object singleCross extends TestUtil.BaseModule { object cross extends mill.Cross[Cross]("210", "211", "212") -- cgit v1.2.3