Skip to content

Gradle 9.2.0#836

Merged
timtebeek merged 7 commits intomainfrom
feature/gradle-9-2-0
Oct 31, 2025
Merged

Gradle 9.2.0#836
timtebeek merged 7 commits intomainfrom
feature/gradle-9-2-0

Conversation

@timtebeek
Copy link
Member

Use this link to re-run the recipe: https://app.moderne.io/builder/Sh3Bg6DMd?organizationId=QUxML09wZW4gU291cmNlL09wZW5SZXdyaXRl

Co-authored-by: Moderne <team@moderne.io>
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Oct 29, 2025
@timtebeek timtebeek self-assigned this Oct 29, 2025
@greg-at-moderne
Copy link
Contributor

1261 tests completed, 2 failed, 9 skipped

One is:

CleanupMockitoImportsTest > doNotRemoveMockitoImportsForKotlin() FAILED
    java.lang.IllegalStateException: LST contains missing or invalid type information
    MethodInvocation->Block->MethodDeclaration->Block->ClassDeclaration->CompilationUnit
    /*~~(MethodInvocation type is missing or malformed)~~>*/org.mockito.Mockito.mock(Foo::class.java)

The other one is:

GradleUseJunitJupiterTest > tasksWithTypeTest() FAILED
    org.opentest4j.AssertionFailedError: [Unexpected result in "build.gradle":
[...]
    expected: 
      "plugins {
          id 'java'
      }
      tasks.withType(Test) {
          useJUnitPlatform()
      }"
     but was: 
      "plugins {
          id 'java'
      }
      tasks.withType(Test) {
      }
      tasks.withType(Test).configureEach {
          useJUnitPlatform()
      }"

@Laurens-W
Copy link
Contributor

Laurens-W commented Oct 30, 2025

Second test failure is also due to type information on the Gradle API missing, tasks is of type java.lang.Object whilst the recipe expects org.gradle.api.tasks.TaskContainer

@timtebeek
Copy link
Member Author

Ah that might be the Gradle 9 use of Groovy 4 not quite working well for us then I suppose; let me see if we can work around the issue.

@timtebeek
Copy link
Member Author

timtebeek commented Oct 30, 2025

Hmm; I've adjusted the failing test, but that already fails on the main branch as well:

    @Test
    void tasksWithTypeTest() {
        rewriteRun(
          //language=groovy
          buildGradle(
            """
              plugins {
                  id 'java'
              }
              tasks.withType(Test) {
              }
              """,
            """
              plugins {
                  id 'java'
              }
              tasks.withType(Test) {
                  useJUnitPlatform()
              }
              """,
            spec -> spec.beforeRecipe(cu -> {
                String string = TreeVisitingPrinter.printTree(cu);
                System.out.println(string);
                JavaType tasksType = ((J.MethodInvocation) cu.getStatements().getLast()).getSelect().getType();
                assertTrue(TypeUtils.isAssignableTo("org.gradle.api.tasks.TaskContainer", tasksType), tasksType.toString());
            })
          )
        );
    }

If I pin back the plugins on the main branch then the above passes;

plugins {
    id("org.openrewrite.build.recipe-library") version "2.5.6"
    id("org.openrewrite.build.moderne-source-available-license") version "2.5.6"
}

@timtebeek timtebeek merged commit 37e86b7 into main Oct 31, 2025
2 checks passed
@timtebeek timtebeek deleted the feature/gradle-9-2-0 branch October 31, 2025 09:20
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Oct 31, 2025
mergify bot added a commit to robfrank/linklift that referenced this pull request Nov 10, 2025
…rom 3.20.0 to 3.21.2 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-testing-frameworks](https://github.com/openrewrite/rewrite-testing-frameworks) from 3.20.0 to 3.21.2.
Release notes

*Sourced from [org.openrewrite.recipe:rewrite-testing-frameworks's releases](https://github.com/openrewrite/rewrite-testing-frameworks/releases).*

> v3.21.2
> -------
>
> What's Changed
> --------------
>
> * Depend on rewrite-third-party for the type table entries by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#841](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/841)
>
> **Full Changelog**: <openrewrite/rewrite-testing-frameworks@v3.21.1...v3.21.2>
>
> v3.21.1
> -------
>
> What's Changed
> --------------
>
> * Add JUnit 6 type table entries by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#839](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/839)
>
> **Full Changelog**: <openrewrite/rewrite-testing-frameworks@v3.21.0...v3.21.1>
>
> 3.21.0
> ------
>
> What's Changed
> --------------
>
> * OpenRewrite recipe best practices by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#834](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/834)
> * Gradle 9.2.0 by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#836](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/836)
> * Add recipe to simplify AssertJ SequencedCollection assertions by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#837](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/837)
>
> **Full Changelog**: <openrewrite/rewrite-testing-frameworks@v3.20.0...v3.21.0>


Commits

* [`4a3bf4e`](openrewrite/rewrite-testing-frameworks@4a3bf4e) Depend on rewrite-third-party for the type table entries ([#841](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/841))
* [`111daea`](openrewrite/rewrite-testing-frameworks@111daea) Add JUnit 6 type table entries ([#839](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/839))
* [`91418e6`](openrewrite/rewrite-testing-frameworks@91418e6) OpenRewrite recipe best practices
* [`345ac0a`](openrewrite/rewrite-testing-frameworks@345ac0a) Add recipe to simplify AssertJ SequencedCollection assertions ([#837](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/837))
* [`37e86b7`](openrewrite/rewrite-testing-frameworks@37e86b7) Gradle 9.2.0 ([#836](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/836))
* [`766f6be`](openrewrite/rewrite-testing-frameworks@766f6be) OpenRewrite recipe best practices ([#834](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/834))
* [`e85e34d`](openrewrite/rewrite-testing-frameworks@e85e34d) Clean up leftover calls to TestCase.super()
* [`2bed89d`](openrewrite/rewrite-testing-frameworks@2bed89d) Fix XmlUnit test to no longer break on new minor or patch releases
* See full diff in [compare view](openrewrite/rewrite-testing-frameworks@v3.20.0...v3.21.2)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.recipe:rewrite-testing-frameworks&package-manager=maven&previous-version=3.20.0&new-version=3.21.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants