diff --git a/example/basic/2-custom-build-logic/build.sc b/example/basic/2-custom-build-logic/build.sc index 025a2f7d28a..aa15c6a0e7d 100644 --- a/example/basic/2-custom-build-logic/build.sc +++ b/example/basic/2-custom-build-logic/build.sc @@ -22,14 +22,14 @@ object foo extends RootModule with ScalaModule { /** Usage -> ./mill run +> mill run ... Line Count: 11 -> ./mill show lineCount +> mill show lineCount 11 -> ./mill inspect lineCount +> mill inspect lineCount lineCount(build.sc:12) Total number of lines in module's source files Inputs: @@ -39,7 +39,7 @@ Inputs: // Above, `def lineCount` is a new build target we define, which makes use of // `allSourceFiles` (an existing target) and is in-turn used in our override of // `resources` (also an existing target). This generated file can then be -// loaded and used at runtime, as see in the output of `./mill run` +// loaded and used at runtime, as see in the output of `mill run` // // While this is a toy example, it shows how easy it is to customize your Mill // build to include the kinds of custom logic common in the build config of diff --git a/example/basic/3-multi-module/build.sc b/example/basic/3-multi-module/build.sc index 53198966d85..f8e1c39c13b 100644 --- a/example/basic/3-multi-module/build.sc +++ b/example/basic/3-multi-module/build.sc @@ -55,15 +55,15 @@ object bar extends MyModule { /** Usage -> ./mill resolve __.run +> mill resolve __.run foo.run bar.run -> ./mill foo.run --foo-text hello --bar-text world +> mill foo.run --foo-text hello --bar-text world Foo.value: hello Bar.value:

world

-> ./mill bar.run world +> mill bar.run world Bar.value:

world

*/ diff --git a/example/basic/4-builtin-commands/build.sc b/example/basic/4-builtin-commands/build.sc index b9450941952..8902380e8ab 100644 --- a/example/basic/4-builtin-commands/build.sc +++ b/example/basic/4-builtin-commands/build.sc @@ -26,7 +26,7 @@ object bar extends MyModule { /** Usage -> ./mill resolve _ +> mill resolve _ foo bar clean @@ -40,10 +40,10 @@ version visualize visualizePlan -> ./mill resolve _.compile +> mill resolve _.compile foo.compile -> ./mill resolve foo._ +> mill resolve foo._ foo.allSourceFiles foo.allSources foo.ammoniteReplClasspath @@ -61,14 +61,14 @@ foo.artifactName /** Usage -> ./mill resolve foo.{compile,run} -> ./mill resolve "foo.{compile,run}" -> ./mill resolve foo.compile foo.run -> ./mill resolve _.compile # list the compile tasks for every top-level module -> ./mill resolve __.compile # list the compile tasks for every module -> ./mill resolve _ # list every top level module and task -> ./mill resolve foo._ # list every task directly within the foo module -> ./mill resolve __ # list every module and task recursively +> mill resolve foo.{compile,run} +> mill resolve "foo.{compile,run}" +> mill resolve foo.compile foo.run +> mill resolve _.compile # list the compile tasks for every top-level module +> mill resolve __.compile # list the compile tasks for every module +> mill resolve _ # list every top level module and task +> mill resolve foo._ # list every task directly within the foo module +> mill resolve __ # list every module and task recursively */ @@ -81,7 +81,7 @@ foo.artifactName /** Usage -> ./mill inspect foo.run +> mill inspect foo.run foo.run(JavaModule.scala:...) Runs this module's code in a subprocess and waits for it to finish Inputs: @@ -107,7 +107,7 @@ Inputs: /** Usage -> ./mill show foo.scalaVersion +> mill show foo.scalaVersion "2.13.11" */ @@ -119,7 +119,7 @@ Inputs: /** Usage -> ./mill show foo.compile +> mill show foo.compile { "analysisFile": ".../out/foo/compile.dest/zinc", "classes": ".../out/foo/compile.dest/classes" @@ -130,12 +130,12 @@ Inputs: /** Usage -> ./mill show foo.sources +> mill show foo.sources [ ".../foo/src" ] -> ./mill show foo.compileClasspath +> mill show foo.compileClasspath [ ".../org/scala-lang/scala-library/2.13.11/scala-library-2.13.11.jar", ... @@ -152,7 +152,7 @@ Inputs: /** Usage -> ./mill show "foo.{sources,compileClasspath}" +> mill show "foo.{sources,compileClasspath}" { "foo.sources": [ ".../foo/src" @@ -173,7 +173,7 @@ Inputs: /** Usage -> ./mill showNamed "foo.{sources,compileClasspath}" +> mill showNamed "foo.{sources,compileClasspath}" { "foo.sources": [ ".../foo/src" @@ -192,12 +192,12 @@ Inputs: // `mill path` prints out a dependency chain between the first task and the // second. It is very useful for exploring the build graph and trying to figure // out how data gets from one task to another, or trying to figure out why -// running `./mill foo` ends up running another task `bar` that you didn't +// running `mill foo` ends up running another task `bar` that you didn't // expect it to. /** Usage -> ./mill path foo.assembly foo.sources +> mill path foo.assembly foo.sources foo.sources foo.allSources foo.allSourceFiles @@ -221,7 +221,7 @@ foo.assembly /** Usage -> ./mill plan foo.compileClasspath +> mill plan foo.compileClasspath foo.transitiveCompileClasspath foo.compileResources foo.unmanagedClasspath @@ -242,7 +242,7 @@ foo.compileClasspath /** Usage -> ./mill clean +> mill clean */ @@ -251,14 +251,14 @@ foo.compileClasspath /** Usage -> ./mill clean # clean all outputs -> ./mill clean foo # clean all outputs for module 'foo' (including nested modules) -> ./mill clean foo.compile # only clean outputs for task 'compile' in module 'foo' -> ./mill clean foo.{compile,run} -> ./mill clean "foo.{compile,run}" -> ./mill clean foo.compile foo.run -> ./mill clean _.compile -> ./mill clean __.compile +> mill clean # clean all outputs +> mill clean foo # clean all outputs for module 'foo' (including nested modules) +> mill clean foo.compile # only clean outputs for task 'compile' in module 'foo' +> mill clean foo.{compile,run} +> mill clean "foo.{compile,run}" +> mill clean foo.compile foo.run +> mill clean _.compile +> mill clean __.compile */ @@ -271,9 +271,9 @@ foo.compileClasspath /** Usage -> ./mill mill.scalalib.Dependency/showUpdates +> mill mill.scalalib.Dependency/showUpdates -> ./mill mill.scalalib.Dependency/showUpdates --allowPreRelease true # also show pre-release versions +> mill mill.scalalib.Dependency/showUpdates --allowPreRelease true # also show pre-release versions */ diff --git a/example/cross/1-simple/build.sc b/example/cross/1-simple/build.sc index 11542fba78f..f1c51073895 100644 --- a/example/cross/1-simple/build.sc +++ b/example/cross/1-simple/build.sc @@ -23,24 +23,24 @@ trait FooModule extends Cross.Module[String] { /** Usage -> ./mill show foo[2.10].suffix +> mill show foo[2.10].suffix "_2.10" -> ./mill show foo[2.10].bigSuffix +> mill show foo[2.10].bigSuffix "[[[_2.10]]]" -> ./mill show foo[2.10].sources +> mill show foo[2.10].sources [ ".../foo" ] -> ./mill show foo[2.12].suffix +> mill show foo[2.12].suffix "_2.12" -> ./mill show foo[2.12].bigSuffix +> mill show foo[2.12].bigSuffix "[[[_2.12]]]" -> ./mill show foo[2.12].sources +> mill show foo[2.12].sources [ ".../foo" ] diff --git a/example/cross/10-static-blog/build.sc b/example/cross/10-static-blog/build.sc index b9038fa0da4..fbcf6850c3b 100644 --- a/example/cross/10-static-blog/build.sc +++ b/example/cross/10-static-blog/build.sc @@ -79,7 +79,7 @@ def dist = T { /** Usage -> ./mill dist +> mill dist > cat out/dist.dest/index.html # root index page ... @@ -100,14 +100,14 @@ def dist = T { // `post/` folder, and when you edit your posts it only re-parses and // re-renders the markdown files that you changed. You can use `-w` to watch // the posts folder to automatically re-run the `dist` command if a post -// changes, or `-j` e.g. `./mill -j 4 dist` to enable parallelism if there are +// changes, or `-j` e.g. `mill -j 4 dist` to enable parallelism if there are // enough posts that the build is becoming noticeably slow. // // You can also build each individual post directly: /** Usage -> ./mill show "post[1-My-First-Post.md].render" +> mill show "post[1-My-First-Post.md].render" ".../out/post/1-My-First-Post.md/render.dest/1-my-first-post.html" > cat out/post/1-My-First-Post.md/render.dest/1-my-first-post.html diff --git a/example/cross/11-default-cross-module/build.sc b/example/cross/11-default-cross-module/build.sc index 4e7d2a631f2..4ddbdc1800d 100644 --- a/example/cross/11-default-cross-module/build.sc +++ b/example/cross/11-default-cross-module/build.sc @@ -16,13 +16,13 @@ object bar extends Cross[FooModule]("2.10", "2.11", "2.12") { /** Usage -> ./mill show foo[2.10].suffix +> mill show foo[2.10].suffix "_2.10" -> ./mill show foo[].suffix +> mill show foo[].suffix "_2.10" -> ./mill show bar[].suffix +> mill show bar[].suffix "_2.12" */ diff --git a/example/cross/2-cross-source-path/build.sc b/example/cross/2-cross-source-path/build.sc index 5b5c2a2cc37..7c821159800 100644 --- a/example/cross/2-cross-source-path/build.sc +++ b/example/cross/2-cross-source-path/build.sc @@ -17,17 +17,17 @@ trait FooModule extends Cross.Module[String] { /** Usage -> ./mill show foo[2.10].sources +> mill show foo[2.10].sources [ ".../foo/2.10" ] -> ./mill show foo[2.11].sources +> mill show foo[2.11].sources [ ".../foo/2.11" ] -> ./mill show foo[2.12].sources +> mill show foo[2.12].sources [ ".../foo/2.12" ] diff --git a/example/cross/3-outside-dependency/build.sc b/example/cross/3-outside-dependency/build.sc index 9c695f68309..7bca911409d 100644 --- a/example/cross/3-outside-dependency/build.sc +++ b/example/cross/3-outside-dependency/build.sc @@ -18,13 +18,13 @@ def qux = T { s"hello ${foo("2.10").suffix()} world ${foo("2.12").suffix()}" } /** Usage -> ./mill show foo[2.10].suffix +> mill show foo[2.10].suffix "_2.10" -> ./mill show bar +> mill show bar "hello _2.10" -> ./mill show qux +> mill show qux "hello _2.10 world _2.12" */ \ No newline at end of file diff --git a/example/cross/4-cross-dependencies/build.sc b/example/cross/4-cross-dependencies/build.sc index 43af0c8bcee..339d2d4218d 100644 --- a/example/cross/4-cross-dependencies/build.sc +++ b/example/cross/4-cross-dependencies/build.sc @@ -21,14 +21,14 @@ trait BarModule extends Cross.Module[String] { /** Usage -> ./mill showNamed foo[__].suffix +> mill showNamed foo[__].suffix { "foo[2.10].suffix": "_2.10", "foo[2.11].suffix": "_2.11", "foo[2.12].suffix": "_2.12" } -> ./mill showNamed bar[__].bigSuffix +> mill showNamed bar[__].bigSuffix { "bar[2.10].bigSuffix": "[[[_2.10]]]", "bar[2.11].bigSuffix": "[[[_2.11]]]", diff --git a/example/cross/5-multiple-cross-axes/build.sc b/example/cross/5-multiple-cross-axes/build.sc index b0b606e73ad..d007f3c24ea 100644 --- a/example/cross/5-multiple-cross-axes/build.sc +++ b/example/cross/5-multiple-cross-axes/build.sc @@ -28,10 +28,10 @@ def bar = T { s"hello ${foo("2.10", "jvm").suffix()}" } /** Usage -> ./mill show foo[2.10,jvm].suffix +> mill show foo[2.10,jvm].suffix "_2.10_jvm" -> ./mill showNamed foo[__].suffix +> mill showNamed foo[__].suffix { "foo[2.10,jvm].suffix": "_2.10_jvm", "foo[2.10,js].suffix": "_2.10_js", diff --git a/example/cross/6-axes-extension/build.sc b/example/cross/6-axes-extension/build.sc index bd146804eb1..81e557099b6 100644 --- a/example/cross/6-axes-extension/build.sc +++ b/example/cross/6-axes-extension/build.sc @@ -34,26 +34,26 @@ trait FooModule3 extends FooModule2 with Cross.Module3[String, Int, Boolean] { /** Usage -> ./mill show foo[a].param1 +> mill show foo[a].param1 "Param Value: a" -> ./mill show foo[b].param1 +> mill show foo[b].param1 "Param Value: b" -> ./mill show foo2[a,1].param1 +> mill show foo2[a,1].param1 "Param Value: a" -> ./mill show foo2[b,2].param2 +> mill show foo2[b,2].param2 "Param Value: 2" -> ./mill show foo3[b,2,false].param3 +> mill show foo3[b,2,false].param3 "Param Value: false" > sed -i 's/, true//g' build.sc > sed -i 's/, false//g' build.sc -> ./mill show foo3[b,2,false].param3 +> mill show foo3[b,2,false].param3 error: ...object foo3 extends Cross[FooModule3](("a", 1), ("b", 2)) error: ... ^ error: ...value _3 is not a member of (String, Int) diff --git a/example/cross/7-inner-cross-module/build.sc b/example/cross/7-inner-cross-module/build.sc index 81ecd1e5f50..c11e0d09741 100644 --- a/example/cross/7-inner-cross-module/build.sc +++ b/example/cross/7-inner-cross-module/build.sc @@ -31,13 +31,13 @@ def baz = T { s"hello ${foo("a").bar.param()}" } /** Usage -> ./mill show foo[a].bar.param +> mill show foo[a].bar.param "Bar Param Value: a" -> ./mill show foo[b].qux.param +> mill show foo[b].qux.param "Qux Param Value: b" -> ./mill show baz +> mill show baz "hello Bar Param Value: a" */ \ No newline at end of file diff --git a/example/cross/8-resolvers/build.sc b/example/cross/8-resolvers/build.sc index 4c14b8980a2..76c76db5b7f 100644 --- a/example/cross/8-resolvers/build.sc +++ b/example/cross/8-resolvers/build.sc @@ -29,7 +29,7 @@ trait BarModule extends MyModule { /** Usage -> ./mill show bar[2.10].bigSuffix +> mill show bar[2.10].bigSuffix ... "[[[_2.10]]]" diff --git a/example/cross/9-dynamic-cross-modules/build.sc b/example/cross/9-dynamic-cross-modules/build.sc index 6be561c2bcb..9f76d4ebca0 100644 --- a/example/cross/9-dynamic-cross-modules/build.sc +++ b/example/cross/9-dynamic-cross-modules/build.sc @@ -20,28 +20,28 @@ trait FolderModule extends ScalaModule with Cross.Module[String]{ /** Usage -> ./mill resolve modules[_] +> mill resolve modules[_] modules[bar] modules[foo] modules[qux] -> ./mill modules[bar].run +> mill modules[bar].run Hello World Bar -> ./mill modules[new].run +> mill modules[new].run error: Cannot resolve modules[new]... > cp -r modules/bar modules/new > sed -i 's/Bar/New/g' modules/new/src/Example.scala -> ./mill resolve modules[_] +> mill resolve modules[_] modules[bar] modules[foo] modules[qux] modules[new] -> ./mill modules[new].run +> mill modules[new].run Hello World New */ diff --git a/example/misc/3-import-file-ivy/build.sc b/example/misc/3-import-file-ivy/build.sc index 3ae2328d512..97fab9d34e0 100644 --- a/example/misc/3-import-file-ivy/build.sc +++ b/example/misc/3-import-file-ivy/build.sc @@ -33,14 +33,14 @@ object foo extends RootModule with ScalaModule { /** Usage -> ./mill compile +> mill compile compiling 1 Scala source... ... -> ./mill run +> mill run generated snippet.txt resource:

hello

world

-> ./mill show assembly +> mill show assembly ".../out/assembly.dest/out.jar" > ./out/assembly.dest/out.jar # mac/linux diff --git a/example/misc/4-mill-build-folder/build.sc b/example/misc/4-mill-build-folder/build.sc index 5e153dbaa76..eac7f4b71d2 100644 --- a/example/misc/4-mill-build-folder/build.sc +++ b/example/misc/4-mill-build-folder/build.sc @@ -46,15 +46,15 @@ object foo extends RootModule with ScalaModule { /** Usage -> ./mill compile +> mill compile compiling 1 Scala source... ... -> ./mill run +> mill run Foo.value:

hello

scalatagsVersion: 0.12.0 -> ./mill show assembly +> mill show assembly ".../out/assembly.dest/out.jar" > ./out/assembly.dest/out.jar # mac/linux @@ -68,13 +68,13 @@ scalatagsVersion: 0.12.0 /** Usage -> ./mill --meta-level 1 show sources +> mill --meta-level 1 show sources [ .../build.sc", .../mill-build/src" ] -> ./mill --meta-level 2 show sources +> mill --meta-level 2 show sources .../mill-build/build.sc" diff --git a/example/misc/5-module-run-task/build.sc b/example/misc/5-module-run-task/build.sc index 73f0c2a362d..96ff9bf060d 100644 --- a/example/misc/5-module-run-task/build.sc +++ b/example/misc/5-module-run-task/build.sc @@ -27,7 +27,7 @@ object bar extends ScalaModule{ /** Usage -> ./mill foo.run +> mill foo.run ... Foo.value: HELLO diff --git a/example/misc/6-contrib-import/build.sc b/example/misc/6-contrib-import/build.sc index f77e7977381..740838a904c 100644 --- a/example/misc/6-contrib-import/build.sc +++ b/example/misc/6-contrib-import/build.sc @@ -17,7 +17,7 @@ object foo extends ScalaModule with BuildInfo { /** Usage -> ./mill foo.run +> mill foo.run ... foo.BuildInfo.scalaVersion: 2.13.10 diff --git a/example/scalabuilds/1-common-config/build.sc b/example/scalabuilds/1-common-config/build.sc index 5decb64d493..886c86fb053 100644 --- a/example/scalabuilds/1-common-config/build.sc +++ b/example/scalabuilds/1-common-config/build.sc @@ -74,7 +74,7 @@ object foo extends RootModule with ScalaModule { /** Usage -> ./mill run +> mill run Foo2.value:

hello2

Foo.value:

hello

FooA.value: hello A @@ -85,7 +85,7 @@ MyOtherResource: My Other Resource Contents my.custom.property: my-prop-value MY_CUSTOM_ENV: my-env-value -> ./mill show assembly +> mill show assembly ".../out/assembly.dest/out.jar" > ./out/assembly.dest/out.jar # mac/linux @@ -100,7 +100,7 @@ my.custom.property: my-prop-value > sed -i 's/Foo2 {/Foo2 { println(this + "hello")/g' custom-src/Foo2.scala -> ./mill compile # demonstrate -deprecation/-Xfatal-warnings flags +> mill compile # demonstrate -deprecation/-Xfatal-warnings flags error: object Foo2 { println(this + "hello") error: ^ error: ...Implicit injection of + is deprecated. Convert to String to call +... diff --git a/example/scalabuilds/10-scala-realistic/build.sc b/example/scalabuilds/10-scala-realistic/build.sc index f9d6eab5be6..bab450804bb 100644 --- a/example/scalabuilds/10-scala-realistic/build.sc +++ b/example/scalabuilds/10-scala-realistic/build.sc @@ -79,7 +79,7 @@ object qux extends JavaModule with MyModule /** Usage -> ./mill resolve __.run +> mill resolve __.run bar[2.13.8].run bar[2.13.8].test.run bar[3.2.2].run @@ -90,34 +90,34 @@ foo[3.2.2].run foo[3.2.2].test.run qux.run -> ./mill foo[2.13.8].run +> mill foo[2.13.8].run foo version 0.0.1 Foo.value:

hello

Bar.value:

world Specific code for Scala 2.x

Qux.value: 31337 -> ./mill bar[3.2.2].test +> mill bar[3.2.2].test + bar.BarTests.test ...

world Specific code for Scala 3.x

-> ./mill qux.run +> mill qux.run Qux.value: 31337 -> ./mill __.compile +> mill __.compile -> ./mill __.test +> mill __.test + bar.BarTests.test ...

world Specific code for Scala 2.x

+ bar.BarTests.test ...

world Specific code for Scala 3.x

+ foo.FooTests.test ...

hello

+ foo.FooTests.test ...

hello

-> ./mill __.publishLocal +> mill __.publishLocal Publishing Artifact(com.lihaoyi,foo_2.13,0.0.1) to ivy repo... Publishing Artifact(com.lihaoyi,bar_2.13,0.0.1) to ivy repo... Publishing Artifact(com.lihaoyi,foo_3,0.0.1) to ivy repo... Publishing Artifact(com.lihaoyi,bar_3,0.0.1) to ivy repo... Publishing Artifact(com.lihaoyi,qux,0.0.1) to ivy repo... -> ./mill show foo[2.13.8].assembly # mac/linux +> mill show foo[2.13.8].assembly # mac/linux ".../out/foo/2.13.8/assembly.dest/out.jar" > ./out/foo/2.13.8/assembly.dest/out.jar # mac/linux diff --git a/example/scalabuilds/2-custom-tasks/build.sc b/example/scalabuilds/2-custom-tasks/build.sc index e8f372a16ad..00f59871f67 100644 --- a/example/scalabuilds/2-custom-tasks/build.sc +++ b/example/scalabuilds/2-custom-tasks/build.sc @@ -66,15 +66,15 @@ object foo extends RootModule with ScalaModule { /** Usage -> ./mill run --text hello +> mill run --text hello text: hello MyDeps.value: List((com.lihaoyi,mainargs,0.4.0)) my.line.count: 12 -> ./mill show lineCount +> mill show lineCount 12 -> ./mill printLineCount +> mill printLineCount 12 */ diff --git a/example/scalabuilds/3-override-tasks/build.sc b/example/scalabuilds/3-override-tasks/build.sc index 1dab13a11cc..a88f1f00305 100644 --- a/example/scalabuilds/3-override-tasks/build.sc +++ b/example/scalabuilds/3-override-tasks/build.sc @@ -60,7 +60,7 @@ object foo3 extends ScalaModule { /** Usage -> ./mill foo.run +> mill foo.run Compiling... Running... Hello World diff --git a/example/scalabuilds/4-nested-modules/build.sc b/example/scalabuilds/4-nested-modules/build.sc index 7e20e3e281c..8931377dcbe 100644 --- a/example/scalabuilds/4-nested-modules/build.sc +++ b/example/scalabuilds/4-nested-modules/build.sc @@ -34,23 +34,23 @@ object baz extends MyModule { /** Usage -> ./mill resolve __.run +> mill resolve __.run foo.bar.run foo.qux.run baz.run -> ./mill foo.run --bar-text hello --qux-text world --foo-text today +> mill foo.run --bar-text hello --qux-text world --foo-text today Bar.value:

hello

Qux.value:

world

Foo.value:

today

-> ./mill baz.run --bar-text hello --qux-text world --foo-text today --baz-text yay +> mill baz.run --bar-text hello --qux-text world --foo-text today --baz-text yay Bar.value:

hello

Qux.value:

world

Foo.value:

today

Baz.value:

yay

-> ./mill foo.qux.run --bar-text hello --qux-text world +> mill foo.qux.run --bar-text hello --qux-text world Bar.value:

hello

Qux.value:

world

diff --git a/example/scalabuilds/5-test-suite/build.sc b/example/scalabuilds/5-test-suite/build.sc index 547acbc0ad0..a2b722b17ef 100644 --- a/example/scalabuilds/5-test-suite/build.sc +++ b/example/scalabuilds/5-test-suite/build.sc @@ -17,17 +17,17 @@ object foo extends ScalaModule { /** Usage -> ./mill foo.compile +> mill foo.compile compiling 1 Scala source... -> ./mill foo.test.compile +> mill foo.test.compile compiling 1 Scala source... -> ./mill foo.test.test +> mill foo.test.test + foo.FooTests.hello ... + foo.FooTests.world ... -> ./mill foo.test +> mill foo.test + foo.FooTests.hello ... + foo.FooTests.world ... @@ -54,7 +54,7 @@ object bar extends ScalaModule { /** Usage -> ./mill bar.test +> mill bar.test + bar.BarTests.hello ... + bar.BarTests.world ... @@ -77,7 +77,7 @@ object bar extends ScalaModule { /** Usage -> ./mill bar.test bar.BarTests.hello +> mill bar.test bar.BarTests.hello + bar.BarTests.hello ... */ @@ -100,14 +100,14 @@ object qux extends ScalaModule { /** Usage -> ./mill qux.test +> mill qux.test + qux.QuxTests.hello ... + qux.QuxTests.world ... -> ./mill qux.integration +> mill qux.integration + qux.QuxIntegrationTests.helloworld ... -> ./mill qux.{test,integration} +> mill qux.{test,integration} + qux.QuxTests.hello ... + qux.QuxTests.world ... + qux.QuxIntegrationTests.helloworld ... diff --git a/example/scalabuilds/6-publish-module/build.sc b/example/scalabuilds/6-publish-module/build.sc index b48735c3ba7..f55fad145a9 100644 --- a/example/scalabuilds/6-publish-module/build.sc +++ b/example/scalabuilds/6-publish-module/build.sc @@ -24,7 +24,7 @@ object foo extends ScalaModule with PublishModule { /** Usage -> ./mill foo.publishLocal +> mill foo.publishLocal Publishing Artifact(com.lihaoyi,foo_2.13,0.0.1) to ivy repo... */ diff --git a/example/scalabuilds/7-cross-scala-version/build.sc b/example/scalabuilds/7-cross-scala-version/build.sc index 3e89e93b250..3d8418a365d 100644 --- a/example/scalabuilds/7-cross-scala-version/build.sc +++ b/example/scalabuilds/7-cross-scala-version/build.sc @@ -23,25 +23,25 @@ trait BarModule extends CrossScalaModule /** Usage -> ./mill resolve __.run +> mill resolve __.run foo[2.12.17].run foo[2.13.8].run bar[2.12.17].run bar[2.13.8].run -> ./mill foo[2.12.17].run +> mill foo[2.12.17].run Foo.value: Hello World Scala library version 2.12.17... Bar.value: bar-value Specific code for Scala 2.x Specific code for Scala 2.12.x -> ./mill foo[2.13.8].run +> mill foo[2.13.8].run Foo.value: Hello World Scala library version 2.13.8... Bar.value: bar-value Specific code for Scala 2.x Specific code for Scala 2.13.x -> ./mill bar[2.13.8].run +> mill bar[2.13.8].run Bar.value: bar-value */ diff --git a/example/scalabuilds/8-sbt-compat-modules/build.sc b/example/scalabuilds/8-sbt-compat-modules/build.sc index dd005376827..f5592847158 100644 --- a/example/scalabuilds/8-sbt-compat-modules/build.sc +++ b/example/scalabuilds/8-sbt-compat-modules/build.sc @@ -39,22 +39,22 @@ trait BarModule extends CrossSbtModule { /** Usage -> ./mill foo.compile +> mill foo.compile compiling 1 Scala source... -> ./mill foo.test.compile +> mill foo.test.compile compiling 1 Scala source... -> ./mill foo.test.test +> mill foo.test.test + foo.FooTests.hello ... -> ./mill foo.test +> mill foo.test + foo.FooTests.hello ... -> ./mill bar[2.13.8].run +> mill bar[2.13.8].run Bar.value: Hello World Scala library version 2.13.8... -> ./mill bar[2.12.17].run +> mill bar[2.12.17].run Bar.value: Hello World Scala library version 2.12.17... */ \ No newline at end of file diff --git a/example/scalabuilds/9-java-modules/build.sc b/example/scalabuilds/9-java-modules/build.sc index 1294a6dc51c..d876daeb642 100644 --- a/example/scalabuilds/9-java-modules/build.sc +++ b/example/scalabuilds/9-java-modules/build.sc @@ -17,18 +17,18 @@ object bar extends JavaModule /** Usage -> ./mill resolve __.run +> mill resolve __.run foo.run bar.run -> ./mill foo.compile +> mill foo.compile compiling 1 Java source... -> ./mill foo.run +> mill foo.run Foo.value: 31337 Bar.value: 271828 -> ./mill foo.test +> mill foo.test Test run started ... Test run finished: 0 failed, 0 ignored, 2 total... diff --git a/example/src/mill/integration/ExampleTestSuite.scala b/example/src/mill/integration/ExampleTestSuite.scala index 142e83dc325..2a12357c460 100644 --- a/example/src/mill/integration/ExampleTestSuite.scala +++ b/example/src/mill/integration/ExampleTestSuite.scala @@ -84,29 +84,8 @@ object ExampleTestSuite extends IntegrationTestSuite { workspaceRoot: os.Path, expectedSnippets: Vector[String], commandStr: String - ) = { + ): Unit = { BashTokenizer.tokenize(commandStr) match { - case Seq(s"./$command", rest @ _*) => - val evalResult = command match { - case "mill" => evalStdout(rest) - case cmd => - val tokens = cmd +: rest - val executable = workspaceRoot / os.SubPath(tokens.head) - if (!os.exists(executable)) { - throw new Exception( - s"Executable $executable not found.\n" + - s"Other files present include ${os.list(executable / os.up)}" - ) - } - val res = os - .proc(executable, tokens.tail) - .call(stdout = os.Pipe, stderr = os.Pipe, cwd = workspaceRoot) - - IntegrationTestSuite.EvalResult(res.exitCode == 0, res.out.text(), res.err.text()) - } - - validateEval(expectedSnippets, evalResult) - case Seq("cp", "-r", from, to) => os.copy(os.Path(from, workspaceRoot), os.Path(to, workspaceRoot)) @@ -164,11 +143,33 @@ object ExampleTestSuite extends IntegrationTestSuite { expectedSnippets, IntegrationTestSuite.EvalResult(true, boas.toString("UTF-8"), "") ) - } finally { zipFile.close() } + } finally { + zipFile.close() + } case Seq("printf", literal, ">>", path) => mangleFile(os.Path(path, workspacePath), _ + ujson.read(s""""${literal}"""").str) + case Seq(command, rest @ _*) => + val evalResult = command match { + case "./mill" | "mill" => evalStdout(rest) + case s"./$cmd" => + val tokens = cmd +: rest + val executable = workspaceRoot / os.SubPath(tokens.head) + if (!os.exists(executable)) { + throw new Exception( + s"Executable $executable not found.\n" + + s"Other files present include ${os.list(executable / os.up)}" + ) + } + val res = os + .proc(executable, tokens.tail) + .call(stdout = os.Pipe, stderr = os.Pipe, cwd = workspaceRoot) + + IntegrationTestSuite.EvalResult(res.exitCode == 0, res.out.text(), res.err.text()) + } + + validateEval(expectedSnippets, evalResult) } }