From da8620b339f3a292aabc1053b76948ea9db7cc76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 01:21:32 +0000 Subject: [PATCH 1/5] Bump com.gradleup.shadow from 8.3.10 to 9.4.1 Bumps [com.gradleup.shadow](https://github.com/GradleUp/shadow) from 8.3.10 to 9.4.1. - [Release notes](https://github.com/GradleUp/shadow/releases) - [Commits](https://github.com/GradleUp/shadow/compare/8.3.10...9.4.1) --- updated-dependencies: - dependency-name: com.gradleup.shadow dependency-version: 9.4.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 4dd00d40fbb9..850e11f7c04a 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ import de.undercouch.gradle.tasks.download.Download plugins { // https://plugins.gradle.org/plugin/com.gradleup.shadow - id 'com.gradleup.shadow' version '8.3.10' + id 'com.gradleup.shadow' version '9.4.1' // https://plugins.gradle.org/plugin/de.undercouch.download id 'de.undercouch.download' version '5.7.0' id 'java' From b510bccf6caca6089e6b3fa750f946aa94b026b2 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sun, 19 Apr 2026 21:24:39 -0400 Subject: [PATCH 2/5] Attempt to update shadow configuration --- checker/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checker/build.gradle b/checker/build.gradle index 0d6ddc8d42f6..7e329bc83d96 100644 --- a/checker/build.gradle +++ b/checker/build.gradle @@ -1090,7 +1090,7 @@ final checkerPom(publication) { publishing { publications { checker(MavenPublication) { - project.shadow.component it + from(components.shadow) checkerPom it artifact checkerJar artifact allSourcesJar From 6c4f79ba1ecc5e4f06b525f77e4bf95364127eaa Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sun, 19 Apr 2026 21:31:22 -0400 Subject: [PATCH 3/5] Remove shadow workaround --- gradle-mvn-push.gradle | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gradle-mvn-push.gradle b/gradle-mvn-push.gradle index c011c59dc233..7d5598bff6fd 100644 --- a/gradle-mvn-push.gradle +++ b/gradle-mvn-push.gradle @@ -2,10 +2,7 @@ apply plugin: 'maven-publish' apply plugin: 'signing' final isSnapshot = version.contains('SNAPSHOT') -// https://github.com/johnrengelman/shadow/issues/586#issuecomment-708375599 -components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { - skip() -} + publishing { repositories { maven { From 1e36b049689f25a0b2cceb039791292ad45b892a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 May 2026 12:44:37 +0000 Subject: [PATCH 4/5] Fix Shadow 9.x shadowJar failure by disabling addShadowVariantIntoJavaComponent --- build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.gradle b/build.gradle index 5bd1c7f6f079..0523d1b979b6 100644 --- a/build.gradle +++ b/build.gradle @@ -992,6 +992,15 @@ subprojects { minimize() } + // Shadow 9.x adds a "shadowRuntimeElements" variant to the java component, which can cause + // variant ambiguity when inter-project runtimeClasspath dependencies are resolved: Gradle may + // select the shadow JAR path of a dependency project that hasn't been built yet, triggering + // "neither file nor directory" in UnusedTracker. Disable this variant publication to restore + // Shadow 8.x behavior where only the regular runtimeElements variant is published. + shadow { + addShadowVariantIntoJavaComponent = false + } + if (!project.name.startsWith('checker-qual-android')) { task tags(type: Exec) { description = 'Create Emacs TAGS table' From 270945116d377892cd7aabfc453e06622a498cab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 May 2026 23:01:21 +0000 Subject: [PATCH 5/5] Fix Shadow 9.x shadowJar failure: mark shadowRuntimeElements as non-consumable Shadow 9.x registers a shadowRuntimeElements consumable variant for every project. During checker:shadowJar minimize(), checker:runtimeClasspath resolves project dependencies (framework, javacutil, etc.) and Gradle may select the shadowRuntimeElements variant, which points to the shadow JAR (e.g. framework-X-all.jar). Since framework:shadowJar has not run, that file does not exist, and UnusedTracker throws 'neither file nor directory'. The previous fix (addShadowVariantIntoJavaComponent = false) only removes the variant from Maven publication; it does not prevent Gradle from selecting it during local inter-project resolution. The correct fix is to mark shadowRuntimeElements as canBeConsumed = false in all subprojects, so Gradle always uses the standard runtimeElements variant (framework.jar) when resolving project dependencies. --- build.gradle | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 0523d1b979b6..dfa4154aae0c 100644 --- a/build.gradle +++ b/build.gradle @@ -992,13 +992,16 @@ subprojects { minimize() } - // Shadow 9.x adds a "shadowRuntimeElements" variant to the java component, which can cause - // variant ambiguity when inter-project runtimeClasspath dependencies are resolved: Gradle may - // select the shadow JAR path of a dependency project that hasn't been built yet, triggering - // "neither file nor directory" in UnusedTracker. Disable this variant publication to restore - // Shadow 8.x behavior where only the regular runtimeElements variant is published. - shadow { - addShadowVariantIntoJavaComponent = false + // Shadow 9.x registers a "shadowRuntimeElements" consumable variant for each project. + // When checker:runtimeClasspath resolves project dependencies (e.g. framework), Gradle may + // select shadowRuntimeElements, which points to the shadow JAR (framework-X-all.jar). + // That file does not exist unless framework:shadowJar has run, causing UnusedTracker to + // throw "neither file nor directory". Mark it non-consumable so Gradle always uses the + // standard runtimeElements variant (framework.jar) for inter-project resolution. + configurations.configureEach { Configuration c -> + if (c.name == 'shadowRuntimeElements') { + c.canBeConsumed = false + } } if (!project.name.startsWith('checker-qual-android')) {