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

Prevent builds from failing w/ configuration cache enabled on Gradle 7.4+ #585

Merged

Conversation

eygraber
Copy link
Collaborator

@eygraber eygraber commented Feb 4, 2022

No description provided.

private void callIncompatibleWithConfigurationCache() {
String methodName = "notCompatibleWithConfigurationCache"
Object[] methodArgs = ["The gradle-versions-plugin isn't compatible with the configuration cache"]
metaClass.invokeMethod(this, methodName, methodArgs)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can simply invoke the method since it is dynamically typed? Our other usages only guard before making the method call directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not the most well versed on Groovy because that's what I thought as well, but the IDE was showing it as red. I didn't actually try running it though.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, me neither. I just use VSCode and pray =)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just double checked and it won't run. I'm assuming the compiler can't see it because the version of the Gradle API needs to be bumped, but not sure if that is desired at the moment.

Copy link
Owner

@ben-manes ben-manes Feb 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks! (Let's keep your code as is)

Copy link
Owner

@ben-manes ben-manes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this and the tests!

@ben-manes
Copy link
Owner

You are welcome to merge and make a release. To do that simply increment the build's version, create the release (it will create a tag), and the github action will publish it to the portal.

@eygraber eygraber force-pushed the dont-fail-w-configuration-cache branch from cf74039 to 2e75446 Compare February 4, 2022 05:08
@eygraber eygraber merged commit b53e44f into ben-manes:master Feb 4, 2022
@eygraber eygraber deleted the dont-fail-w-configuration-cache branch February 4, 2022 05:21
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

2 participants