Publish gradle attributes for AndroidX compatibility

These attributes are required when importing our artifacts into
androidx-main in order to generate reference documentation (JavaDoc and
KDoc).

#minor-release

PiperOrigin-RevId: 504502555
This commit is contained in:
ibaker 2023-01-25 10:16:08 +00:00 committed by christosts
parent b359502a13
commit 47349b8c4b

View File

@ -26,10 +26,26 @@ afterEvaluate {
publications {
release(MavenPublication) {
from components.release
artifact androidSourcesJar
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))
variant.outgoing.artifact(androidSourcesJar)
components.release.addVariantsFromConfiguration(variant) {}
pom {
name =
findProperty('releaseName')