scala-steward icon indicating copy to clipboard operation
scala-steward copied to clipboard

Support mill version and mill plugin version upgrades

Open lefou opened this issue 4 years ago • 3 comments

As scala-steward is all about version upgrades, we should also try to upgrade the used mill version as well as the used mill plugin versions.

For scala-steward, this would mean to check if there is a .mill-version and if, read it as current mill version and try to update it.

Mill also support the MILL_VERSION env variable, but I think we can ignore it, as it's hard to provide a patch for it.

lefou avatar Jun 25 '20 07:06 lefou

Let's focus on the mill version first. I think we need three modifications:

  1. The first step is to modify MillAlg#getDependencies such that it also includes mill-main as a dependency similar to how it is done in SbtAlg via getSbtDependency. With this change Scala Steward would read the mill version from .mill-version and then check if there is an appropriate update for mill-main with the previously read version.
  2. Scala Steward needs to be allowed to modify .mill-version files by adding it to the defaultFileExtensions.
  3. Since .mill-version contains nothing but the version, we need to modify UpdateHeuristic.specific such that in case of mill-main updates replaceVersion bumps the version if the input string only contains whitespace and the current mill version.

fthomas avatar May 05 '21 19:05 fthomas

I implemented the mill version update in PR #2135.

Once, this is reviewed, I'm glad to tackle mill plugin updates (aka Ammonite $ivy-import updates), if this isn't supported or worked on.

lefou avatar Sep 18 '21 09:09 lefou

Although updating Ammonite script imports is worth a standalone feature, imports for mill build script may be special, as we encode the mill binary platform in the artifact ID. This is typically a _mill0.9 for any mill 0.9.x release and a _mill0.10.0-M2 for a milestone release 0.10.0-M2. It would make sense to derive this property from the parsed mill version (if present) and also bump it in case we raise the mill version to the next binary platform.

So this is essentially two features:

  • Update Ammonite script imports (in all *.sc files look for import $ivy lines)
  • for mill update, modify also all Ammonite imports that contain a mill binary platform suffix

lefou avatar Sep 18 '21 09:09 lefou

The support for Mill plugins is now also implemented in PR #2701

Closing this issue as completely solved.

lefou avatar Sep 01 '22 06:09 lefou