Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve without the versions plugin #125

Merged
merged 9 commits into from
Dec 22, 2023
Merged

Resolve without the versions plugin #125

merged 9 commits into from
Dec 22, 2023

Conversation

hvisser
Copy link
Contributor

@hvisser hvisser commented Dec 4, 2023

Initial version of resolving dependencies without the versions plugin.

Behavioural changes

In this PR these changes are behind a flag for testing, set the nl.littlerobots.vcu.resolver property to true (in gradle.properties or by passing -Pnl.littlerobots.vcu.resolver=true to switch to the new update task.

For resolving the TOML file is used as the source of the dependencies to check for updates. Therefore:

  • Unused dependencies will also get updates
  • Dependencies that would be "hidden" from the versions plugin, such as dependencies in buildSrc. Included builds and other "special" modules will just work as it only looks at the TOML file now.
  • There's no way to detect unused dependencies, so most of the keep settings will not work / are not needed. Only the keeping of unused versions remains.
  • The option to create a TOML file is no longer available

Changes not directly related to not using the versions plugin:

  • Unresolved libs and plugins will show a warning and will not be auto corrected
  • Exceeded libs and plugins (invalid versions, with a correct version available) will show a warning, but not be auto corrected
  • Rich versions handling is improved as the version is resolved first before emitting a warning.

For selecting components use the versionSelector method on the extension. This function should return true to select a version, false otherwise.

versionCatalogUpdate {
    versionSelector {
        // function from the version plugin docs
        !isNonStable(it.candidate.version)
    }
}

If omitted, a default will now be set: non-stable versions are allowed if the current version is non-stable, otherwise only a stable version is allowed. Implementation for this is basically the same as in the versions plugin README. This means less configuration too.

ref #123 #111 #122

@hvisser hvisser marked this pull request as draft December 4, 2023 22:36
@hvisser hvisser marked this pull request as ready for review December 20, 2023 14:34
* Add current version to component selection, similar to versions plugin
* Resolve / handle rich versions
* Return unresolved / exceeded / rich versions that can be updated
* Detect errors in component selector function
Instead of rejecting versions, select versions.
@hvisser hvisser merged commit 538c5c5 into main Dec 22, 2023
1 check passed
@hvisser hvisser deleted the feature/resolve-versions branch December 22, 2023 09:02
@TWiStErRob
Copy link

The option to create a TOML file is no longer available

:( that was one of the main reasons I used this plugin, there's nothing else that can do it. I use Renovate to update version catalogs, because I want CI to be executed on every bump.

@hvisser
Copy link
Contributor Author

hvisser commented Dec 22, 2023

@TWiStErRob that's good to know, thanks for that feedback. If there are more folks find that functionality useful then an option would be to keep depending on the versions plugin for that functionality in some shape or form, but it would definitely complicate things a bit.

@TWiStErRob
Copy link

It's tricky to get this feedback, because this means that I only used it once per project and I only use it once every few months. There are a lot more legacy projects to migrate at work. It's unclear though if it's worth it for you to support this. It's definitely a good tech challenge. :) If I were you I would consider creating a separate plugin for the new behaviour rather than flagging, although that might double the maintenance.

@extmkv

This comment was marked as off-topic.

@hvisser

This comment was marked as off-topic.

@extmkv

This comment was marked as off-topic.

@hvisser

This comment was marked as off-topic.

@extmkv

This comment was marked as off-topic.

@extmkv

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants