scala-steward
scala-steward copied to clipboard
Support mill version and mill plugin version upgrades
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.
Let's focus on the mill version first. I think we need three modifications:
- The first step is to modify
MillAlg#getDependencies
such that it also includes mill-main as a dependency similar to how it is done inSbtAlg
viagetSbtDependency
. With this change Scala Steward would read the mill version from.mill-version
and then check if there is an appropriate update formill-main
with the previously read version. - Scala Steward needs to be allowed to modify
.mill-version
files by adding it to thedefaultFileExtensions
. - Since
.mill-version
contains nothing but the version, we need to modifyUpdateHeuristic.specific
such that in case ofmill-main
updatesreplaceVersion
bumps the version if the input string only contains whitespace and the current mill version.
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.
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 forimport $ivy
lines) - for mill update, modify also all Ammonite imports that contain a mill binary platform suffix
The support for Mill plugins is now also implemented in PR #2701
Closing this issue as completely solved.