From 0888dfbd05e1f22436137d93a67e56d06b8928cc Mon Sep 17 00:00:00 2001 From: ibaker Date: Fri, 12 May 2023 10:31:39 +0000 Subject: [PATCH] Update the root project name check in `publish.gradle` The name was changed in https://github.com/androidx/media/commit/25581384e93bcb647a31678809421025385d72a0 and this check wasn't updated, meaning publishing no longer worked (it didn't publish anything, just printed lots of warnings like `Skipping task ':test-utils-robolectric:publish' as it has no actions.`). This change means the check is now using the same source-of-truth as the root project name, so it shouldn't go out of sync again. PiperOrigin-RevId: 531457952 (cherry picked from commit 4c1eb8aec7258324134913db521cd0a005ece31b) --- core_settings.gradle | 2 ++ publish.gradle | 2 +- settings.gradle | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core_settings.gradle b/core_settings.gradle index b331d11b4d..0ef4e443c4 100644 --- a/core_settings.gradle +++ b/core_settings.gradle @@ -21,6 +21,8 @@ if (gradle.ext.has('androidxMediaModulePrefix')) { modulePrefix += gradle.ext.androidxMediaModulePrefix } +rootProject.name = gradle.ext.androidxMediaProjectName + include modulePrefix + 'lib-common' project(modulePrefix + 'lib-common').projectDir = new File(rootDir, 'libraries/common') diff --git a/publish.gradle b/publish.gradle index 4b93f3806b..366a380acd 100644 --- a/publish.gradle +++ b/publish.gradle @@ -16,7 +16,7 @@ apply plugin: 'maven-publish' apply from: "$gradle.ext.androidxMediaSettingsDir/missing_aar_type_workaround.gradle" afterEvaluate { - if (rootProject.name == "media3") { + if (rootProject.name == gradle.ext.androidxMediaProjectName) { publishing { repositories { maven { diff --git a/settings.gradle b/settings.gradle index 716f405a9a..f2cd7a6480 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,7 +18,7 @@ if (gradle.ext.has('androidxMediaModulePrefix')) { modulePrefix += gradle.ext.androidxMediaModulePrefix } -rootProject.name = 'media3' +gradle.ext.androidxMediaProjectName = 'media3' include modulePrefix + 'demo' project(modulePrefix + 'demo').projectDir = new File(rootDir, 'demos/main')