This is an automated email from the ASF dual-hosted git repository.
snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris-tools.git
The following commit(s) were added to refs/heads/main by this push:
new 06c68be Apprunner: Publish/pom: don't include test-fixtures
dependencies as runtime scope (#66)
06c68be is described below
commit 06c68be9544246a8519752ded9bc7c0653067a1b
Author: Robert Stupp <[email protected]>
AuthorDate: Fri Nov 21 11:09:34 2025 +0100
Apprunner: Publish/pom: don't include test-fixtures dependencies as runtime
scope (#66)
Same change as https://github.com/apache/polaris/pull/3085
---
.../src/main/kotlin/publishing/PublishingHelperPlugin.kt | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git
a/apprunner/apprunner-build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
b/apprunner/apprunner-build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
index e6e7b21..323a1d5 100644
---
a/apprunner/apprunner-build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
+++
b/apprunner/apprunner-build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
@@ -23,6 +23,7 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import javax.inject.Inject
import org.gradle.api.Plugin
import org.gradle.api.Project
+import org.gradle.api.component.AdhocComponentWithVariants
import org.gradle.api.component.SoftwareComponentFactory
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
@@ -138,7 +139,17 @@ constructor(private val softwareComponentFactory:
SoftwareComponentFactory) : Pl
if (project.plugins.hasPlugin(ShadowPlugin::class.java)) {
configureShadowPublishing(project, mavenPublication,
softwareComponentFactory)
} else {
- from(components.firstOrNull { c -> c.name == "javaPlatform"
|| c.name == "java" })
+ val component =
+ components.firstOrNull { c -> c.name == "javaPlatform" ||
c.name == "java" }
+ if (component is AdhocComponentWithVariants) {
+ listOf("testFixturesApiElements",
"testFixturesRuntimeElements").forEach { cfg
+ ->
+ configurations.findByName(cfg)?.apply {
+ component.addVariantsFromConfiguration(this) { skip() }
+ }
+ }
+ }
+ from(component)
}
suppressPomMetadataWarningsFor("testFixturesApiElements")