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

Gradle: Support gradle plugin dependencies using variables to specify the plugin version #6063

Closed
Jnosh opened this issue Apr 27, 2020 · 1 comment · Fixed by #6064
Closed
Labels
manager:gradle Gradle package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@Jnosh
Copy link
Contributor

Jnosh commented Apr 27, 2020

What would you like Renovate to be able to do?
Renovate should update gradle plugins for which the version is defined in settings.gradle.kts using delegated variables set from gradle.properties.

Describe the solution you'd like
Renovate already handles variables for setting dependency versions in build.gradle.kts so the same should be supported for gradle plugins.

Describe alternatives you've considered
Don't implement this feature, require users to set plugin versions as strings instead of using variables.

Additional context
I added an example repository demonstrating this issue here: https://github.com/Jnosh/renovate-issue

As can be seen in the renovate master issue, renovate correctly detects the plugin dependencies and that they need to be updated but fails to create pull requests to perform the updates when the plugin version is specified using a variable.
Relevant settings.gradle.kts and gradle.properties.

Relevant code seems to be in lib/manager/gradle/build-gradle.ts.
If I interpret the code correctly, the issue seems to be that gradle plugins use a different dependency specification format that only includes the dependency group.

Renovate already has a matcher for detecting these dependencies (kotlinPluginStringVersionFormatMatch) but is missing a matcher to identify the version variables for this case to add them to the version variable map.

@JamieMagee JamieMagee added manager:gradle Gradle package manager type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others review labels Apr 27, 2020
JamieMagee added a commit that referenced this issue Apr 29, 2020
…6064)

* feat(gradle): gradle plugin dependency versions in variables (#6063)

* chore: Replace uses of RegExp with util/regEx in build-gradle.ts

Co-authored-by: Jamie Magee <JamieMagee@users.noreply.github.com>
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 19.223.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:gradle Gradle package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants