Disable publishing block when media3 included in another build.

From https://github.com/androidx/media/pull/127/files

PiperOrigin-RevId: 485921271
(cherry picked from commit 48aac9ba90344d960214c2d0364a68c0d74e109e)
This commit is contained in:
yschimke 2022-11-03 18:08:03 +00:00 committed by microkatz
parent 99bb183c35
commit 1c18eae18e
3 changed files with 42 additions and 36 deletions

View File

@ -30,6 +30,8 @@ Release notes
([#10684](https://github.com/google/ExoPlayer/issues/10684)). ([#10684](https://github.com/google/ExoPlayer/issues/10684)).
* Add `Player.getVideoSurfaceSize` that returns the size of the surface on * Add `Player.getVideoSurfaceSize` that returns the size of the surface on
which the video is rendered. which the video is rendered.
* Build:
* Avoid publishing block when included in another gradle build.
* Downloads: * Downloads:
* Fix potential infinite loop in `ProgressiveDownloader` caused by * Fix potential infinite loop in `ProgressiveDownloader` caused by
simultaneous download and playback with the same `PriorityTaskManager` simultaneous download and playback with the same `PriorityTaskManager`

View File

@ -16,6 +16,7 @@ apply plugin: 'maven-publish'
apply from: "$gradle.ext.androidxMediaSettingsDir/missing_aar_type_workaround.gradle" apply from: "$gradle.ext.androidxMediaSettingsDir/missing_aar_type_workaround.gradle"
afterEvaluate { afterEvaluate {
if (rootProject.name == "media3") {
publishing { publishing {
repositories { repositories {
maven { maven {
@ -60,6 +61,7 @@ afterEvaluate {
} }
} }
} }
}
} }
tasks.withType(PublishToMavenRepository) { it.dependsOn lint, test } tasks.withType(PublishToMavenRepository) { it.dependsOn lint, test }

View File

@ -18,6 +18,8 @@ if (gradle.ext.has('androidxMediaModulePrefix')) {
modulePrefix += gradle.ext.androidxMediaModulePrefix modulePrefix += gradle.ext.androidxMediaModulePrefix
} }
rootProject.name = 'media3'
include modulePrefix + 'demo' include modulePrefix + 'demo'
project(modulePrefix + 'demo').projectDir = new File(rootDir, 'demos/main') project(modulePrefix + 'demo').projectDir = new File(rootDir, 'demos/main')
include modulePrefix + 'demo-cast' include modulePrefix + 'demo-cast'