Repository navigation
Conversation
…ilds What: - Configure the jacoco test report with the required property instead of the removed enabled method-call syntax - Move the shadow plugin to the plugins DSL of the cli module and bump it to 7.1.2, the last version that works on both Gradle 7.6.x and 8.x - Replace the end-of-life jcenter() with mavenCentral() in the buildscript repositories Why: When a consumer build resolves the gradle plugin from this repository as a source control dependency (issue OpenAPITools#735), Gradle evaluates the build files of this repository with the Gradle version of the consumer. With modern consumer builds such as the Gradle 8.6 of the issue report this fails with 'Could not find method enabled() for arguments [true] on Report xml' and shadow 6.1.0 references org.gradle.api.plugins.MavenPlugin which was removed in Gradle 8. How: xml.required works since Gradle 7.1 and shadow 7.1.2 applied through the plugins DSL resolves from the plugin portal on both Gradle 7.6.2 (the wrapper of this repository) and Gradle 8.x, so the source build evaluates and the plugin resolves in consumer builds. Signed-off-by: Inf1mum <vadimlazuk5@gmail.com>
What: - Add a functional test that applies the plugin from this repository's build logic with a modern consumer build (the Gradle 8.6 of the issue report) through an included build and asserts the validation task succeeds Why: Issue OpenAPITools#735 reports that resolving the gradle plugin as a source control dependency fails on modern consumer builds, because Gradle evaluates this repository's build files with the Gradle version of the consumer. The preceding fix commit shipped without a test that exercises this scenario, so nothing would catch a regression when the build files move again. How: The test copies this repository without .git and build outputs into the functional test workspace, wires the copy as an included build in the pluginManagement block of a small consumer project, and runs the consumer build through TestKit with withGradleVersion("8.6"). Without the build file fixes this fails with 'Could not find method enabled() for arguments [true] on Report xml', the error behind the ResolveException of the issue report. Signed-off-by: Inf1mum <vadimlazuk5@gmail.com>
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="cli/build.gradle">
<violation number="1" location="cli/build.gradle:3">
P1: Shadow 7.1.2 fails when applied with Gradle 8.x because it maps the removed `Jar.classifier` property. A Gradle 8.6 build that configures `:cli` fails during configuration; upgrade to a Gradle-8-compatible Shadow release such as 8.1.1.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| @@ -1,5 +1,6 @@ | |||
| plugins { | |||
| id "com.diffplug.spotless" version "6.25.0" | |||
| id 'com.github.johnrengelman.shadow' version '7.1.2' | |||
There was a problem hiding this comment.
P1: Shadow 7.1.2 fails when applied with Gradle 8.x because it maps the removed Jar.classifier property. A Gradle 8.6 build that configures :cli fails during configuration; upgrade to a Gradle-8-compatible Shadow release such as 8.1.1.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At cli/build.gradle, line 3:
<comment>Shadow 7.1.2 fails when applied with Gradle 8.x because it maps the removed `Jar.classifier` property. A Gradle 8.6 build that configures `:cli` fails during configuration; upgrade to a Gradle-8-compatible Shadow release such as 8.1.1.</comment>
<file context>
@@ -1,5 +1,6 @@
plugins {
id "com.diffplug.spotless" version "6.25.0"
+ id 'com.github.johnrengelman.shadow' version '7.1.2'
}
</file context>
Suggested change
| id 'com.github.johnrengelman.shadow' version '7.1.2' | |
| id 'com.github.johnrengelman.shadow' version '8.1.1' |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This makes the build files of this repository compatible with the Gradle version of consumer builds, so the gradle plugin can be resolved from this repository as a source control dependency again, and pins that scenario with a functional test. Fixes #735.
Why
When a consumer build declares this repository as a source control dependency as in #735, Gradle evaluates the build files of this repository with the Gradle version of the consumer build, not with the wrapper version of this repository. With a modern consumer build such as the Gradle 8.6 of the issue report, evaluation fails with:
and that failure is what surfaces in the consumer as the
ResolveException: Could not resolve all dependencies for configuration ':...:detachedConfiguration80'of the issue report.Three spots in the build files only worked on older Gradle versions:
jacocoTestReportused the removedxml.enabled truemethod-call syntax;xml.required = truedoes the same thing and works since Gradle 7.1, so this repository's own builds on the 7.6.2 wrapper behave as beforeapply plugin:; 6.1.0 referencesorg.gradle.api.plugins.MavenPlugin, which modern Gradle removed. It now comes through the plugins DSL at 7.1.2, the last version that resolves and works on both Gradle 7.6.x and 8.xHow
The PR consists of two commits:
The new functional test reproduces the report of #735: it copies this repository (without .git and build outputs) into the functional test workspace, wires the copy as an included build in the
pluginManagementblock of a small consumer project that applies the plugin, and runs the consumer build through TestKit withwithGradleVersion("8.6"), the Gradle version of the issue report. Gradle evaluates the copied build files with that consumer version exactly like a source control dependency.Tests
enabled()error above (verified locally by temporarily checking out the master versions ofbuild.gradleandcli/build.gradle):openAPIStyleValidatorreportsSUCCESS./gradlew buildis green with JDK 17.Summary by cubic
Fixes #735 by making the build files compatible with the Gradle version of consumer builds, so the plugin can be resolved as a source control dependency again.
xml.enabled truesyntax withxml.required = truefor JaCoCo reports.climodule and bumps it to 7.1.2, which works on both Gradle 7.6.x and 8.x.jcenter()withmavenCentral()in the buildscript repositories.Tests
enabled()error reported in Error when adding Gradle plugin to project #735../gradlew buildpasses with JDK 17.Written for commit 1853ed0. Summary will update on new commits.