Skip to content

Commit

Permalink
Stop explicitly creating a sourcesElement Gradle variant
Browse files Browse the repository at this point in the history
This variant has been superceded by an equivalent
`releaseVariantReleaseRuntimePublication` variant which (I think) has
been created since d5f9cf4.

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 849238a)
  • Loading branch information
icbaker authored and oceanjules committed Aug 22, 2023
1 parent d4554ae commit 8d7d129
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 8d7d129

Please sign in to comment.