summaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorrockjam <5min4eq.unity@gmail.com>2018-01-10 01:19:55 +0300
committerrockjam <5min4eq.unity@gmail.com>2018-01-10 01:21:07 +0300
commitd13b6b1f306c1e660da66ab7b8bf5595772af55c (patch)
tree87f96d0fe73b6db66ec02cd866b106f5f46715a8 /readme.md
parent7abb8cd2ce9df949723ab6a47c92e73c4e54d0fa (diff)
downloadmill-d13b6b1f306c1e660da66ab7b8bf5595772af55c.tar.gz
mill-d13b6b1f306c1e660da66ab7b8bf5595772af55c.tar.bz2
mill-d13b6b1f306c1e660da66ab7b8bf5595772af55c.zip
add command line examples to readme.md
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md65
1 files changed, 65 insertions, 0 deletions
diff --git a/readme.md b/readme.md
index 27d29655..46fbae26 100644
--- a/readme.md
+++ b/readme.md
@@ -66,6 +66,71 @@ Lastly, you can generate IntelliJ Scala project files using Mill via
Allowing you to import a Mill project into Intellij without using SBT
+### Command line
+
+There is a number of ways to run targets via command line:
+
+* Run single target:
+```bash
+mill core.compile
+```
+
+* Run single command with arguments:
+```bash
+mill bridges[2.12.4].publish --credentials foo --gpgPassphrase bar
+```
+
+* Run multiple targets:
+```bash
+mill --all core.test scalalib.test
+```
+
+**Note**: don't forget to put `--all` flag when you run multiple commands, otherwise the only first command will be run, and subsequent commands will be passed as arguments to the first one.
+
+* Run multiple commands with arguments:
+```bash
+mill --all bridges[2.11.11].publish bridges[2.12.4].publish -- --credentials foo --gpgPassphrase bar
+```
+
+Here `--credentials foo --gpgPassphrase bar` arguments will be passed to both `bridges[2.11.11].publish` and `bridges[2.12.4].publish` command.
+
+**Note**: arguments list should be separated with `--` from command list.
+
+
+Sometimes it is tedious to write multiple targets when you want to run same targets on multiple modules, or multiple targets on one module.
+Here brace expansion from bash(or another shell that support brace expansion) comes to rescue. It allows you to make some "shortcuts" for multiple commands.
+
+* Run same targets in multiple modules with brace expansion:
+```bash
+mill --all {core,scalalib,scalajslib,integration}.test
+```
+
+will run `test` target in `core`, `scalalib`, `scalajslib` and `integration` modules.
+
+* Run multiple targets in one module with brace expansion:
+```bash
+mill --all scalalib.{compile,test}
+```
+
+will run `compile` and `test` targets in `scalalib` module.
+
+* Run multiple targets in multiple modules:
+```bash
+mill --show --all {core,scalalib}.{scalaVersion,scalaBinaryVersion}
+```
+
+will run `scalaVersion` and `scalaBinaryVersion` targets in both `core` and `scalalib` modules.
+
+* Run targets in different cross build modules
+```bash
+mill --all bridges[{2.11.11,2.12.4}].publish -- --credentials foo --gpgPassphrase bar
+```
+
+will run `publish` command in both `brides[2.11.11]` and `bridges[2.12.4]` modules
+
+**Note**: When you run multiple targets with `--all` flag, they are not guaranteed to run in that exact order.
+Mill will build task evaluation graph and run targets in correct order.
+
### REPL
Mill provides a build REPL, which lets you explore the build interactively and