Skip to content

Conversation

@knutwannheden
Copy link
Contributor

Gradle 9 embeds Groovy 4.0.28, while RewriteGradleProject.groovy is compiled against Gradle 6.1.1 (Groovy 3.x). The Groovy version mismatch prevented proper type attribution during parsing.

Solution:

  1. Replace localGroovy() with explicit groovy-all:3.0.25 to maintain Groovy 3.x consistency
  2. Replace gradleApi() with explicit Gradle 6.1.1 module dependencies to avoid pulling in Gradle 9's API
  3. Add gradle-tooling-api:6.1.1 for GradleConnector support without Gradle 9's full API
  4. Change rewrite-gradle-tooling-model/model to use compileOnly(gradleApi()) to prevent leaking Gradle 9 API

Gradle 9 embeds Groovy 4.0.28, while RewriteGradleProject.groovy is compiled against Gradle 6.1.1 (Groovy 3.x). The Groovy version mismatch prevented proper type attribution during parsing.

**Solution:**
1. Replace `localGroovy()` with explicit `groovy-all:3.0.25` to maintain Groovy 3.x consistency
2. Replace `gradleApi()` with explicit Gradle 6.1.1 module dependencies to avoid pulling in Gradle 9's API
3. Add `gradle-tooling-api:6.1.1` for GradleConnector support without Gradle 9's full API
4. Change `rewrite-gradle-tooling-model/model` to use `compileOnly(gradleApi())` to prevent leaking Gradle 9 API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants