From b49b944a34892b4dc0bf5fb3ea37884e1fd44afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20Sta=CC=88hli?= Date: Thu, 2 May 2024 15:13:48 +0200 Subject: [PATCH] buildHealth --- build.gradle.kts | 7 +++++++ gradle/libs.versions.toml | 6 ++++++ pillarbox-cast/build.gradle.kts | 9 +++++++-- pillarbox-demo-cast/build.gradle.kts | 19 +++++++++++++------ .../pillarbox/demo/cast/MainActivity.kt | 10 ++++++++++ 5 files changed, 43 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index dc2ac0db4..4627307d6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -107,5 +107,12 @@ dependencyAnalysis { exclude(libs.androidx.media3.dash, libs.androidx.media3.hls) } } + + project(":pillarbox-cast") { + onUnusedDependencies { + // These dependencies are not used directly, but needed if we want to use the default Media3 cast receiver. + exclude(libs.androidx.media3.cast, libs.androidx.media3.common) + } + } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ac3a7420d..19b9bc289 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -29,8 +29,11 @@ kotlinx-coroutines = "1.8.0" kotlinx-kover = "0.7.6" kotlinx-serialization = "1.6.3" ktor = "2.3.10" +mediarouter = "1.3.0" mockk = "1.13.10" okhttp = "4.12.0" +play-services-cast-framework = "21.3.0" +play-services-tasks = "18.0.1" robolectric = "4.12.1" srg-data-provider = "0.9.0" tag-commander-core = "5.4.4" @@ -52,6 +55,7 @@ androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtim androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "androidx-lifecycle" } androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } +androidx-mediarouter = { module = "androidx.mediarouter:mediarouter", version.ref = "mediarouter" } androidx-navigation-common = { module = "androidx.navigation:navigation-common", version.ref = "androidx-navigation" } androidx-navigation-runtime = { module = "androidx.navigation:navigation-runtime", version.ref = "androidx-navigation" } androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" } @@ -78,6 +82,8 @@ ktor-http = { module = "io.ktor:ktor-http", version.ref = "ktor" } ktor-serialization = { module = "io.ktor:ktor-serialization", version.ref = "ktor" } ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } ktor-utils = { module = "io.ktor:ktor-utils", version.ref = "ktor" } +play-services-cast-framework = { module = "com.google.android.gms:play-services-cast-framework", version.ref = "play-services-cast-framework" } +play-services-tasks = { module = "com.google.android.gms:play-services-tasks", version.ref = "play-services-tasks" } robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" } robolectric-annotations = { module = "org.robolectric:annotations", version.ref = "robolectric" } robolectric-shadows-framework = { module = "org.robolectric:shadows-framework", version.ref = "robolectric" } diff --git a/pillarbox-cast/build.gradle.kts b/pillarbox-cast/build.gradle.kts index 946f16200..aea5505e7 100644 --- a/pillarbox-cast/build.gradle.kts +++ b/pillarbox-cast/build.gradle.kts @@ -22,9 +22,14 @@ android { } dependencies { - api(libs.androidx.media3.common) + // api(libs.androidx.media3.common) api(libs.androidx.media3.cast) implementation(platform(libs.androidx.compose.bom)) - implementation(libs.androidx.compose.foundation) + api(libs.play.services.cast.framework) + api(libs.androidx.compose.runtime) + api(libs.androidx.compose.ui) + implementation(libs.androidx.mediarouter) + implementation(libs.play.services.tasks) + implementation(libs.guava) } diff --git a/pillarbox-demo-cast/build.gradle.kts b/pillarbox-demo-cast/build.gradle.kts index a7552256c..cefd97bc6 100644 --- a/pillarbox-demo-cast/build.gradle.kts +++ b/pillarbox-demo-cast/build.gradle.kts @@ -4,21 +4,28 @@ plugins { dependencies { - implementation(project(":pillarbox-analytics")) - implementation(project(":pillarbox-core-business")) + // implementation(project(":pillarbox-analytics")) + // implementation(project(":pillarbox-core-business")) implementation(project(":pillarbox-demo-shared")) - implementation(project(":pillarbox-player")) - implementation(project(":pillarbox-ui")) + // implementation(project(":pillarbox-player")) + // implementation(project(":pillarbox-ui")) implementation(project(":pillarbox-cast")) - + implementation(libs.kotlin.stdlib) implementation(libs.androidx.core.ktx) - implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.activity) + implementation(libs.androidx.fragment) + implementation(libs.play.services.cast.framework) implementation(libs.androidx.activity.compose) implementation(platform(libs.androidx.compose.bom)) implementation(libs.androidx.compose.ui) implementation(libs.androidx.compose.ui.graphics) implementation(libs.androidx.compose.ui.tooling.preview) implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.foundation.layout) + implementation(libs.androidx.compose.runtime) + implementation(libs.androidx.compose.ui.text) + implementation(libs.androidx.compose.ui.unit) debugImplementation(libs.androidx.compose.ui.tooling) } diff --git a/pillarbox-demo-cast/src/main/java/ch/srgssr/pillarbox/demo/cast/MainActivity.kt b/pillarbox-demo-cast/src/main/java/ch/srgssr/pillarbox/demo/cast/MainActivity.kt index 84d6a8485..af50189f6 100644 --- a/pillarbox-demo-cast/src/main/java/ch/srgssr/pillarbox/demo/cast/MainActivity.kt +++ b/pillarbox-demo-cast/src/main/java/ch/srgssr/pillarbox/demo/cast/MainActivity.kt @@ -8,7 +8,9 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.material3.Text +import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview import androidx.fragment.app.FragmentActivity import ch.srgssr.pillarbox.cast.getCastContext import ch.srgssr.pillarbox.cast.widget.CastButton @@ -42,3 +44,11 @@ class MainActivity : FragmentActivity() { } } } + +@Preview +@Composable +private fun MainPreview() { + PillarboxTheme { + CastButton() + } +}