= The Mill Meta-Build
:page-aliases: The_Mill_Meta_Build.adoc



The meta-build manages the compilation of the `build.mill`.
Customizing the meta-build gives you greater control over how exactly your
`build.mill` evaluates. The meta-build lives in the `mill-build/` directory,
and needs to contain a top-level module of type `MillBuildRootModule`.

If you don't configure it explicitly, a built-in synthetic meta-build is used.
Meta-builds are recursive, which means they can themselves have nested meta-builds, and so on.

To run a task on a meta-build, you specify the `--meta-level` option to select
the meta-build level.

== Meta-build Tasks

include::partial$example/extending/metabuild/3-meta-tasks.adoc[]

== Finding plugin updates

Mill plugins are defined as `mvnDeps` in the meta-build.
Hence, you can easily search for updates with the external `mill.scalalib.Dependency` module.

.Check for Mill Plugin updates
----
$ mill --meta-level 1 mill.scalalib.Dependency/showUpdates
Found 1 dependency update for
de.tototec:de.tobiasroeser.mill.vcs.version_mill0.11_2.13 : 0.3.1-> 0.4.0
----

== Sharing Libraries between `build.mill` and Application Code

include::partial$example/extending/metabuild/4-meta-build.adoc[]

== Sharing Source Code between `build.mill` and Application Code

include::partial$example/extending/metabuild/5-meta-shared-sources.adoc[]