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

Fix missing setProperty error when using Gradle 6 #1884

Merged
merged 3 commits into from
Aug 18, 2021

Conversation

fawind
Copy link
Contributor

@fawind fawind commented Aug 18, 2021

Before this PR

With #1875, baseline is build using Gradle 7 and transitively Groovy 3.x.
As a result, projects that still use Gradle 6 and thus Groovy 2.x fail with the following error when applying the BaselinEclipse or BaselineIdea plugin (both are the only plugins that are still Groovy and not Java classes) (example):

Caused by: java.lang.AbstractMethodError: Receiver class com.palantir.baseline.plugins.BaselineEclipse does not define or inherit an implementation of the resolved method 'abstract void setProperty(java.lang.String, java.lang.Object)' of interface groovy.lang.GroovyObject.
	at com.palantir.baseline.plugins.BaselineEclipse.apply(BaselineEclipse.groovy:69)
	at com.palantir.baseline.plugins.BaselineEclipse.apply(BaselineEclipse.groovy)
	at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)

Haven't gotten completely on the bottom of this but the issue seems to be that going from Groovy 2.x to 3.x GroovyObjectSupport is no longer provided per default.

Relevant issue: https://issues.apache.org/jira/browse/GROOVY-4855

After this PR

Adding extends GroovyObjectSupport adds default implementations of Groovy methods including setProperty.

Tested it on two internal repos and compiled again.

==COMMIT_MSG==
Fix missing setProperty error when using Gradle 6
==COMMIT_MSG==

@changelog-app
Copy link

changelog-app bot commented Aug 18, 2021

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Fix missing setProperty error when using Gradle 6

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from ferozco August 18, 2021 12:24
@fawind fawind requested a review from CRogers August 18, 2021 12:25
@fawind
Copy link
Contributor Author

fawind commented Aug 18, 2021

Want to sanity double check this on CI quickly 👍

@bulldozer-bot bulldozer-bot bot merged commit 2e04127 into develop Aug 18, 2021
@bulldozer-bot bulldozer-bot bot deleted the fw/fix-groovy-plugins branch August 18, 2021 12:30
@svc-autorelease
Copy link
Collaborator

Released 4.20.0

This was referenced Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants