mill icon indicating copy to clipboard operation
mill copied to clipboard

Add and implement new `--onlydeps` option

Open lefou opened this issue 1 year ago • 2 comments

With the new --onlydeps CLI option, we can evaluate all dependencies except the requested targets itself. This comes in handy to prepare some offline work. It's also useful when a target itself is able to watch an handle a change of it's inputs (like a Spring Boot or Vaadin app) but Mill is still needed to watch and re-build all the other dependencies.

Example: Just re-prepare the dependencies but don't restart the server

$ mill server.runBackground
$ mill --watch --onlydeps server.runBackground

The name --onlydeps is borrowed from emerge the CLI of the Gentoo package manager Portage.

Depends on

  • [x] https://github.com/com-lihaoyi/mill/pull/2789

Fix https://github.com/com-lihaoyi/mill/issues/2748

lefou avatar Sep 20 '23 11:09 lefou

I looked around and saw this PR. I wonder if it would be possible to provide a tool from mill to expose all ivy as json as the lock file. Later we can use this lockfile to download it w/ coursier to prepare the build artifacts for no network building. A dirty hack has been achieved in https://github.com/chipsalliance/t1/blob/master/nix/pkgs/mill-builder.nix I wonder if there are some clean way to use. E.g. this PR.

sequencer avatar Apr 23 '24 20:04 sequencer

I wonder if it would be possible to provide a tool from mill to expose all ivy as json as the lock file.

It certainly is possible, but it looks unrelated to this PR. --onlydeps in this context means: "build only the target dependencies".

@sequencer Please open a dedicated discussion for your topic, thanks.

lefou avatar Apr 23 '24 20:04 lefou