Add singleVariant
publishing config to all published gradle files
Docs: * https://developer.android.com/build/publish-library/configure-pub-variants#single-pub-var * https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/PublishingOptions This resolves the following warning from Android Gradle Plugin 7.2.2 and helps unblock the upgrade to AGP 8.0.1: > Software Components will not be created automatically for Maven > publishing from Android Gradle Plugin 8.0. To opt-in to the future > behavior, set the Gradle property > `android.disableAutomaticComponentCreation=true` in the > `gradle.properties` file or use the new publishing DSL. > > Affected Modules: `lib-cast`, `lib-common`, `lib-container`, > `lib-database`, `lib-datasource`, `lib-datasource-cronet`, > `lib-datasource-okhttp`, `lib-datasource-rtmp`, `lib-decoder`, > `lib-effect`, `lib-exoplayer`, `lib-exoplayer-all (legacy)`, > `lib-exoplayer-dash`, `lib-exoplayer-hls`, `lib-exoplayer-ima`, > `lib-exoplayer-rtsp`, `lib-exoplayer-smoothstreaming`, > `lib-exoplayer-workmanager`, `lib-extractor`, `lib-media2 (legacy)`, > `lib-mediasession (legacy)`, `lib-muxer`, `lib-session`, > `lib-transformer`, `lib-ui`, `lib-ui-leanback`, `test-utils`, > `test-utils-robolectric` Issue: androidx/media#409 PiperOrigin-RevId: 533464133
This commit is contained in:
parent
50112c685b
commit
d5f9cf4f19
@ -15,6 +15,12 @@ apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
|
||||
|
||||
android {
|
||||
namespace 'androidx.media3.cast'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -35,6 +35,11 @@ android {
|
||||
lint {
|
||||
baseline = file("lint-baseline.xml")
|
||||
}
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -33,6 +33,12 @@ android {
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets/'
|
||||
test.assets.srcDir '../test_data/src/test/assets/'
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
|
@ -21,6 +21,12 @@ android {
|
||||
testCoverageEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -26,6 +26,12 @@ android {
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets'
|
||||
test.assets.srcDir '../test_data/src/test/assets'
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -15,6 +15,12 @@ apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
|
||||
|
||||
android {
|
||||
namespace 'androidx.media3.datasource.cronet'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -17,6 +17,12 @@ android {
|
||||
namespace 'androidx.media3.datasource.okhttp'
|
||||
|
||||
defaultConfig.minSdkVersion 21
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -15,6 +15,12 @@ apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
|
||||
|
||||
android {
|
||||
namespace 'androidx.media3.datasource.rtmp'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -21,6 +21,12 @@ android {
|
||||
testCoverageEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -33,6 +33,12 @@ android {
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets/'
|
||||
test.assets.srcDir '../test_data/src/test/assets/'
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -33,6 +33,12 @@ android {
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets'
|
||||
test.assets.srcDir '../test_data/src/test/assets/'
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -23,6 +23,12 @@ android {
|
||||
}
|
||||
|
||||
sourceSets.test.assets.srcDir '../test_data/src/test/assets/'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -23,6 +23,12 @@ android {
|
||||
}
|
||||
|
||||
sourceSets.test.assets.srcDir '../test_data/src/test/assets/'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -19,6 +19,12 @@ android {
|
||||
sourceSets {
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets'
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -23,6 +23,12 @@ android {
|
||||
}
|
||||
|
||||
sourceSets.test.assets.srcDir '../test_data/src/test/assets/'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -23,6 +23,12 @@ android {
|
||||
}
|
||||
|
||||
sourceSets.test.assets.srcDir '../test_data/src/test/assets/'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -17,6 +17,12 @@ apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
|
||||
|
||||
android {
|
||||
namespace 'androidx.media3.exoplayer.workmanager'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -23,6 +23,12 @@ android {
|
||||
}
|
||||
|
||||
sourceSets.test.assets.srcDir '../test_data/src/test/assets/'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -33,6 +33,12 @@ android {
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets/'
|
||||
test.assets.srcDir '../test_data/src/test/assets/'
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
|
@ -28,6 +28,11 @@ android {
|
||||
lint {
|
||||
baseline = file("lint-baseline.xml")
|
||||
}
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
api project(modulePrefix + 'lib-common')
|
||||
|
@ -15,6 +15,12 @@ apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
|
||||
|
||||
android {
|
||||
namespace 'androidx.media3.test.utils'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -16,6 +16,12 @@ apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
|
||||
|
||||
android {
|
||||
namespace 'androidx.media3.test.utils.robolectric'
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -33,6 +33,12 @@ android {
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets/'
|
||||
test.assets.srcDir '../test_data/src/test/assets/'
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -21,6 +21,12 @@ android {
|
||||
lint {
|
||||
baseline = file("lint-baseline.xml")
|
||||
}
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -17,6 +17,12 @@ android {
|
||||
namespace 'androidx.media3.ui.leanback'
|
||||
|
||||
defaultConfig.minSdkVersion 17
|
||||
|
||||
publishing {
|
||||
singleVariant('release') {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -44,7 +44,6 @@ afterEvaluate {
|
||||
variant.attributes.attribute(
|
||||
DocsType.DOCS_TYPE_ATTRIBUTE,
|
||||
project.objects.named(DocsType, DocsType.SOURCES))
|
||||
variant.outgoing.artifact(androidSourcesJar)
|
||||
components.release.addVariantsFromConfiguration(variant) {}
|
||||
}
|
||||
pom {
|
||||
@ -81,8 +80,3 @@ afterEvaluate {
|
||||
}
|
||||
}
|
||||
tasks.withType(PublishToMavenRepository) { it.dependsOn lint, test }
|
||||
|
||||
task androidSourcesJar(type: Jar) {
|
||||
archiveClassifier.set('sources')
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user