kierendavies / mill-explicit-deps   0.2.0

MIT License GitHub
Scala versions: 2.13
{Artifact, BinaryVersion, Project, Version, UserState, Env} Mill plugins: 0.10 0.9

mill-explicit-deps

A Mill plugin for enforcing explicit dependencies. Inspired by sbt-explicit-dependencies.

It allows you to check that ivyDeps and ivyCompileDeps accurately reflect the direct dependencies of your source code.

Quickstart

Import the plugin in your build.sc:

import $ivy.`io.github.kierendavies::mill-explicit-deps::0.2.0`
import io.github.kierendavies.mill.explicitdeps.ExplicitDepsModule

Use the mixin:

object foo extends ScalaModule with ExplicitDepsModule {
    // ...
}

Then you can run the command mill -k __.checkExplicitDeps. It will fail if it finds any transitive dependencies which are either

  • imported by a source file but not declared (in ivyDeps or compileIvyDeps), or
  • declared but not imported by any source files.

Compatibility

This plugin requires Mill 0.10.

It has been tested with Scala 2.13.10 and 3.2.1.