From dd262a0957cf56e9bdb1083e94d458455dac6e7d Mon Sep 17 00:00:00 2001 From: Dushyant Kumar Date: Fri, 20 Mar 2026 11:43:50 +0530 Subject: [PATCH] Enable Gradle module metadata for test-fixtures modules GenerateModuleMetadata is disabled globally to prevent shadow jar modules from exposing unshaded dependencies. However, this also prevents .module files from being published for modules with test fixtures (e.g., common). Without the .module file, downstream consumers cannot resolve testFixtures() dependencies. Selectively re-enable module metadata for modules applying the java-test-fixtures plugin. Shadow jar modules are unaffected since they never apply java-test-fixtures. Co-Authored-By: Claude Opus 4.6 --- .../src/main/groovy/openhouse.maven-publish.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/buildSrc/src/main/groovy/openhouse.maven-publish.gradle b/buildSrc/src/main/groovy/openhouse.maven-publish.gradle index d6c3f40d2..6d2749e5c 100644 --- a/buildSrc/src/main/groovy/openhouse.maven-publish.gradle +++ b/buildSrc/src/main/groovy/openhouse.maven-publish.gradle @@ -16,6 +16,17 @@ tasks.withType(GenerateModuleMetadata) { enabled = false } +// Re-enable module metadata for modules with test fixtures so that consumers +// can resolve testFixtures() dependencies. Shadow jar modules remain unaffected +// since they never apply the java-test-fixtures plugin. +afterEvaluate { + if (plugins.hasPlugin('java-test-fixtures')) { + tasks.withType(GenerateModuleMetadata) { + enabled = true + } + } +} + [jar, sourcesJar, javadocJar].each { task -> task.from(rootDir) { include 'LICENSE'