Mill
Getting Started
You can use Mill together with Bloop to speed up your development workflow and better integrate your build with your IDE.
Mill has built-in support for Bloop via mill-contrib
, so follow the instructions below to install the mill-bloop
module.
Requirements
- Your mill version needs to be >=
0.4.0-2-4dbbce
.
Install the plugin
Install bloop in build.sc
by replacing $MILL_VERSION
in the following
command:
import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION`
Export your build
The mill command mill mill.contrib.Bloop/install
exports your mill build to bloop.
The mill plugin generates a configuration file per every compile and test
sources in your build definition. For example, a build with a single Scala
project foo
generates two configuration files by default:
$ mill mill.contrib.Bloop/install
(...)
info Generated '/disk/foo/.bloop/foo.json'.
info Generated '/disk/foo/.bloop/foo-test.json'.
where:
foo
comes from the compile source set; and,foo-test
comes from the test source set and depends onfoo
Verify installation and export
If you haven't installed bloop and its CLI yet, follow these instructions before proceeding.
Verify your installation by running bloop projects
in the root of the mill workspace directory.
$ bloop projects
foo
foo-test
If the results of bloop projects
is empty, check that:
- You are running the command-line invocation in the root base directory (e.g.
/disk/foo
). - The mill build export process completed successfully.
- The
.bloop/
configuration directory contains bloop configuration files.
If you suspect bloop is loading the configuration files from somewhere else, run --verbose
:
$ bloop projects --verbose
[D] Projects loaded from '/my-project/.bloop':
foo
foo-test
Here's a list of bloop commands you can run next to start playing with bloop:
bloop compile --help
: shows the help section for compile.bloop compile foo-test
: compiles foo'ssrc/main
andsrc/test
.bloop test foo-test -w
: runs foo tests repeatedly with file watching enabled.
After verifying the export, you can continue using Bloop's command-line application or any build client integrating with Bloop, such as Metals.
Next steps after installation
Use an IDE such as Metals or IntelliJ to write code or play with the CLI if you want to explore what CLI options are available.
If you need help, you can always come over our Discord channel.