From 8d7d129066e39539c4eed3513b25d3d246540d1b Mon Sep 17 00:00:00 2001 From: ibaker Date: Mon, 21 Aug 2023 15:33:44 +0100 Subject: [PATCH] Stop explicitly creating a `sourcesElement` Gradle variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This variant has been superceded by an equivalent `releaseVariantReleaseRuntimePublication` variant which (I think) has been created since https://github.com/androidx/media/commit/d5f9cf4f193d20d2ccc2a466a09cc1b1717a0e81. Before this change the `sourcesElement` variant was being created with no `files` config, which resulted in build failures when generating javadoc in AndroidX: ``` However we cannot choose between the following variants of androidx.media3:media3-cast:1.2.0-alpha01: - releaseVariantReleaseSourcePublication   - sourcesElement ``` We can resolve this confusion by deleting the empty & unneeded `sourcesElement` variant. #minor-release PiperOrigin-RevId: 558783471 (cherry picked from commit 849238a52f8c2244e0f655d8c6aacc1f83ebc458) --- publish.gradle | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/publish.gradle b/publish.gradle index 57662bb85c4..79130e049b7 100644 --- a/publish.gradle +++ b/publish.gradle @@ -29,23 +29,6 @@ afterEvaluate { groupId = 'androidx.media3' artifactId = findProperty('releaseArtifactId') ?: '' version = findProperty('releaseVersion') ?: '' - configurations.create("sourcesElement") { variant -> - variant.visible = false - variant.canBeResolved = false - variant.attributes.attribute( - Usage.USAGE_ATTRIBUTE, - project.objects.named(Usage, Usage.JAVA_RUNTIME)) - variant.attributes.attribute( - Category.CATEGORY_ATTRIBUTE, - project.objects.named(Category, Category.DOCUMENTATION)) - variant.attributes.attribute( - Bundling.BUNDLING_ATTRIBUTE, - project.objects.named(Bundling, Bundling.EXTERNAL)) - variant.attributes.attribute( - DocsType.DOCS_TYPE_ATTRIBUTE, - project.objects.named(DocsType, DocsType.SOURCES)) - components.release.addVariantsFromConfiguration(variant) {} - } pom { name = findProperty('releaseName')