You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When mimaPreviousArtifacts is already set by another plugin that happens to run before SbtVersionPolicyPlugin, the value gets overriden (in the case of Scalafix, mimaPreviousArtifacts is set to compare module_2.13.$n against module_2.13.${n-1} through a local plugin for example).
Suggestion: when the value is already set (non-empty), do not provide a default.
The text was updated successfully, but these errors were encountered:
IIUC, the suggested fix is to rely on the fact that, by default, the MiMa plugin sets mimaPreviousArtifacts to an empty collection. So, if it is not empty, it means that someone set it and we don’t want to overwrite it. However, maybe in some cases, people do want sbt-version-policy to overwrite a value otherwise incorrectly set by another plugin. I wonder if the correct way to fix this issue is to change the order of application of the plugins (like you did)?
I wonder if the correct way to fix this issue is to change the order of application of the plugins (like you did)?
It should be yes, unfortunately, I don't know a way in sbt to control the order of application of plugins you don't define yourself (I was lucky to be in control as it was an internal plugin that can be made aware of the presence of SbtVersionPolicyPlugin).
Suggestion: when the value is already set (non-empty), do not provide a default.
Now I realize this suggestion is not good, as it relies on the plugin application order (somewhat stable, but not deterministic/speced). SbtVersionPolicyPlugin might run first, and the value it sets may get overriden by another plugin, so it's a general problem.
Found via scalacenter/scalafix#1673.
When
mimaPreviousArtifacts
is already set by another plugin that happens to run beforeSbtVersionPolicyPlugin
, the value gets overriden (in the case of Scalafix,mimaPreviousArtifacts
is set to comparemodule_2.13.$n
againstmodule_2.13.${n-1}
through a local plugin for example).Suggestion: when the value is already set (non-empty), do not provide a default.
The text was updated successfully, but these errors were encountered: