diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad9bba183..530797370 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,6 +72,26 @@ jobs: sarif_file: build/reports/detekt/ category: detekt + dependency-analysis: + name: Dependency Analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/gradle-build-action@v2 + - name: Run Dependency Analysis + run: ./gradlew buildHealth + - name: Archive analysis report + uses: actions/upload-artifact@v3 + with: + name: dependency-analysis-report + path: build/reports/dependency-analysis/build-health-report.txt + unit-test: name: Unit Tests runs-on: ubuntu-latest diff --git a/build.gradle.kts b/build.gradle.kts index 3ec454374..5c95d36f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,9 +9,9 @@ import io.gitlab.arturbosch.detekt.report.ReportMergeTask plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false - alias(libs.plugins.kotlin.kapt) apply false alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.detekt) + alias(libs.plugins.dependency.analysis.gradle.plugin) } apply(plugin = "android-reporting") @@ -75,3 +75,48 @@ tasks.register("installGitHook") { } tasks.getByPath(":pillarbox-demo:preBuild").dependsOn(":installGitHook") + +dependencyAnalysis { + issues { + all { + onAny { + severity("fail") + } + } + + project(":pillarbox-core-business") { + onUnusedDependencies { + // This dependency is not used directly, but required to be able to compile `CommandersActStreaming` + exclude(libs.tagcommander.core) + } + } + + project(":pillarbox-demo") { + onUnusedDependencies { + // These dependencies are actually used, but only through inline code: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/issues/795 + exclude(libs.androidx.compose.animation.asProvider()) + exclude(libs.androidx.compose.animation.core) + exclude(libs.androidx.compose.foundation.asProvider()) + exclude(libs.androidx.compose.foundation.layout) + exclude(libs.androidx.compose.material.icons.core) + exclude(libs.androidx.compose.material.icons.extended) + exclude(libs.androidx.compose.runtime.asProvider()) + exclude(libs.androidx.compose.ui.asProvider()) + exclude(libs.androidx.compose.ui.geometry) + exclude(libs.androidx.compose.ui.graphics) + exclude(libs.androidx.compose.ui.text) + exclude(libs.androidx.compose.ui.tooling.preview) + exclude(libs.androidx.compose.ui.unit) + } + } + + project(":pillarbox-player") { + onUnusedDependencies { + // These dependencies are not used directly, but automatically used by libs.androidx.media3.exoplayer + exclude(libs.androidx.media3.dash, libs.androidx.media3.hls) + // This dependency is used automatically by libs.mockk + exclude(libs.mockk.android) + } + } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6a8cd4e71..2be54ebc6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,101 +1,124 @@ [versions] -accompanist = "0.33.0-alpha" -activityCompose = "1.8.2" -androidGradlePlugin = "8.2.0" +accompanist = "0.32.0" +android-gradle-plugin = "8.2.0" +androidx-activity = "1.8.2" +androidx-annotation = "1.7.1" +androidx-compose = "2023.10.01" +androidx-core = "1.12.0" +androidx-fragment = "1.6.2" +androidx-leanback = "1.0.0" +androidx-lifecycle = "2.6.2" +androidx-media = "1.7.0" +androidx-media3 = "1.2.0" +androidx-navigation = "2.7.6" +androidx-paging = "3.2.1" +androidx-test-ext-junit = "1.1.5" +androidx-test-monitor = "1.6.1" +androidx-test-runner = "1.5.2" +androidx-tv = "1.0.0-alpha10" coil = "2.5.0" -dataProvider = "0.8.0" -kotlinPlugin = "1.9.21" -detekt = "1.23.3" # https://github.com/detekt/detekt -kotlinxSerializationJson = "1.6.2" -ktorVersion = "2.3.7" -ktx = "1.12.0" -coroutines = "1.7.3" -# Downgrade mockk to 1.12.5 because of duplicate files with androidTest -# https://stackoverflow.com/questions/75150167/instrumented-tests-will-not-run-6-files-found-with-path-meta-inf-license-md -lifecycleViewmodelCompose = "2.6.2" -mockk = "1.12.5" +comscore = "6.10.0" +dependency-analysis-gradle-plugin = "1.28.0" +detekt = "1.23.4" +guava = "31.1-android" junit = "4.13.2" -androidJunit = "1.1.5" -espresso = "3.5.1" -media3 = "1.2.0" -media = "1.7.0" -navigation = "2.7.6" -paging = "3.2.1" +kotlin = "1.9.21" +kotlinx-coroutines = "1.7.3" +kotlinx-serialization = "1.6.2" +ktor = "2.3.7" +mockk = "1.13.8" okhttp = "4.12.0" -retrofit2KotlinxSerializationConverter = "1.0.0" -tagCommanderCore = "5.4.1" -tagCommanderServerSide = "5.5.1" -comscore = "6.10.0" -androidxComposeBom = "2023.10.01" -leanback = "1.0.0" -tvCompose = "1.0.0-alpha10" -androidx-test-ext-junit = "1.1.5" -appcompat = "1.6.1" -material = "1.11.0" +srg-data-provider = "0.8.0" +tag-commander-core = "5.4.1" +tag-commander-server-side = "5.5.1" [libraries] accompanist-navigation-material = { module = "com.google.accompanist:accompanist-navigation-material", version.ref = "accompanist" } -androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" } -androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" } -androidx-navigation-common = { module = "androidx.navigation:navigation-common", version.ref = "navigation" } -androidx-navigation-runtime = { module = "androidx.navigation:navigation-runtime", version.ref = "navigation" } -androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigation" } -androidx-paging-common = { module = "androidx.paging:paging-common", version.ref = "paging" } -androidx-paging-compose = { module = "androidx.paging:paging-compose", version.ref = "paging" } -androidx-tv-foundation = { module = "androidx.tv:tv-foundation", version.ref = "tvCompose" } -androidx-tv-material = { module = "androidx.tv:tv-material", version.ref = "tvCompose" } +androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx-activity" } +androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" } +androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" } +androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } +androidx-core = { module = "androidx.core:core", version.ref = "androidx-core" } +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core" } +androidx-fragment = { module = "androidx.fragment:fragment", version.ref = "androidx-fragment" } +androidx-lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "androidx-lifecycle" } +androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" } +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-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" } +androidx-paging-common = { module = "androidx.paging:paging-common", version.ref = "androidx-paging" } +androidx-paging-compose = { module = "androidx.paging:paging-compose", version.ref = "androidx-paging" } +androidx-test-monitor = { module = "androidx.test:monitor", version.ref = "androidx-test-monitor" } +androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" } +androidx-tv-foundation = { module = "androidx.tv:tv-foundation", version.ref = "androidx-tv" } +androidx-tv-material = { module = "androidx.tv:tv-material", version.ref = "androidx-tv" } coil = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" } -kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } -ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktorVersion" } -ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktorVersion" } -ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktorVersion" } -ktor-client-serialization = { module = "io.ktor:ktor-client-serialization", version.ref = "ktorVersion" } -ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktorVersion" } -ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktorVersion" } -srg-data = { module = "ch.srg.data.provider:data", version.ref = "dataProvider" } -srg-dataprovider-paging = { module = "ch.srg.data.provider:dataprovider-paging", version.ref = "dataProvider" } -srg-dataprovider-retrofit = { module = "ch.srg.data.provider:dataprovider-retrofit", version.ref = "dataProvider" } +kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } +ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } +ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" } +ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } +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" } +srg-data = { module = "ch.srg.data.provider:data", version.ref = "srg-data-provider" } +srg-dataprovider-paging = { module = "ch.srg.data.provider:dataprovider-paging", version.ref = "srg-data-provider" } +srg-dataprovider-retrofit = { module = "ch.srg.data.provider:dataprovider-retrofit", version.ref = "srg-data-provider" } detekt-cli = { group = "io.gitlab.arturbosch.detekt", name = "detekt-cli", version.ref = "detekt" } detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" } -androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" } junit = { group = "junit", name = "junit", version.ref = "junit" } -androidx-test-junit = { group = "androidx.test.ext", name = "junit-ktx", version.ref = "androidJunit" } -androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" } mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" } mockk-android = { group = "io.mockk", name = "mockk-android", version.ref = "mockk" } -kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "coroutines" } -kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" } -kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" } -androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "media3" } -androidx-media3-ui = { group = "androidx.media3", name = "media3-ui", version.ref = "media3" } -androidx-media3-ui-leanback = { group = "androidx.media3", name = "media3-ui-leanback", version.ref = "media3" } -androidx-media3-dash = { group = "androidx.media3", name = "media3-exoplayer-dash", version.ref = "media3" } -androidx-media3-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "media3" } -androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "media3" } -androidx-media = { group = "androidx.media", name = "media", version.ref = "media" } +mockk-dsl = { group = "io.mockk", name = "mockk-dsl-jvm", version.ref = "mockk" } +kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } +kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } +kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" } +androidx-media3-common = { group = "androidx.media3", name = "media3-common", version.ref = "androidx-media3" } +androidx-media3-datasource = { group = "androidx.media3", name = "media3-datasource", version.ref = "androidx-media3" } +androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "androidx-media3" } +androidx-media3-ui = { group = "androidx.media3", name = "media3-ui", version.ref = "androidx-media3" } +androidx-media3-ui-leanback = { group = "androidx.media3", name = "media3-ui-leanback", version.ref = "androidx-media3" } +androidx-media3-dash = { group = "androidx.media3", name = "media3-exoplayer-dash", version.ref = "androidx-media3" } +androidx-media3-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "androidx-media3" } +androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "androidx-media3" } +androidx-media = { group = "androidx.media", name = "media", version.ref = "androidx-media" } +okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" } okhttp-logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" } -tagcommander-core = { group = "com.tagcommander.lib", name = "core", version.ref = "tagCommanderCore" } -tagcommander-serverside = { group = "com.tagcommander.lib", name = "ServerSide", version.ref = "tagCommanderServerSide" } +tagcommander-core = { group = "com.tagcommander.lib", name = "core", version.ref = "tag-commander-core" } +tagcommander-serverside = { group = "com.tagcommander.lib", name = "ServerSide", version.ref = "tag-commander-server-side" } comscore = { group = "com.comscore", name = "android-analytics", version.ref = "comscore" } # Compose -androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" } +androidx-compose-animation = { module = "androidx.compose.animation:animation" } +androidx-compose-animation-core = { module = "androidx.compose.animation:animation-core" } +androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidx-compose" } androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" } +androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" } androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" } -androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } +androidx-compose-ui-geometry = { module = "androidx.compose.ui:ui-geometry" } +androidx-compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" } +androidx-compose-ui-text = { module = "androidx.compose.ui:ui-text" } androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } -androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } +androidx-compose-ui-unit = { module = "androidx.compose.ui:ui-unit" } +androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util" } androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" } -androidx-compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" } -leanback = { group = "androidx.leanback", name = "leanback", version.ref = "leanback" } +androidx-compose-material-icons-core = { module = "androidx.compose.material:material-icons-core" } +androidx-compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" } +androidx-compose-runtime = { module = "androidx.compose.runtime:runtime" } +androidx-compose-runtime-saveable = { module = "androidx.compose.runtime:runtime-saveable" } +leanback = { group = "androidx.leanback", name = "leanback", version.ref = "androidx-leanback" } androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" } -appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } -material = { group = "com.google.android.material", name = "material", version.ref = "material" } +guava = { module = "com.google.guava:guava", version.ref = "guava" } [plugins] -android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } -android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } -kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlinPlugin" } -kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinPlugin" } +android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } +android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" } +dependency-analysis-gradle-plugin = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependency-analysis-gradle-plugin" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } -kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinPlugin" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } diff --git a/pillarbox-analytics/build.gradle.kts b/pillarbox-analytics/build.gradle.kts index 27eae5000..39e3a3cb8 100644 --- a/pillarbox-analytics/build.gradle.kts +++ b/pillarbox-analytics/build.gradle.kts @@ -49,16 +49,18 @@ android { } dependencies { - implementation(libs.androidx.ktx) - - api(libs.tagcommander.core) + implementation(libs.comscore) + implementation(libs.tagcommander.core) api(libs.tagcommander.serverside) - api(libs.comscore) testImplementation(libs.junit) + testImplementation(libs.kotlinx.coroutines.core) testImplementation(libs.kotlinx.coroutines.test) - androidTestImplementation(libs.androidx.test.junit) - androidTestImplementation(libs.androidx.espresso.core) + + androidTestImplementation(libs.androidx.test.monitor) + androidTestRuntimeOnly(libs.androidx.test.runner) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.kotlinx.coroutines.core) androidTestImplementation(libs.kotlinx.coroutines.test) } diff --git a/pillarbox-core-business/build.gradle.kts b/pillarbox-core-business/build.gradle.kts index 6bb051dd8..cb5df4a59 100644 --- a/pillarbox-core-business/build.gradle.kts +++ b/pillarbox-core-business/build.gradle.kts @@ -47,28 +47,40 @@ android { } dependencies { - api(project(":pillarbox-player")) api(project(":pillarbox-analytics")) + api(project(":pillarbox-player")) - implementation(libs.kotlinx.coroutines.android) - implementation(libs.androidx.ktx) + implementation(libs.androidx.annotation) + implementation(libs.comscore) + implementation(libs.androidx.core.ktx) + api(libs.androidx.media3.common) + api(libs.androidx.media3.datasource) + api(libs.androidx.media3.exoplayer) + implementation(libs.guava) + runtimeOnly(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.coroutines.core) + api(libs.kotlinx.serialization.core) + implementation(libs.kotlinx.serialization.json) + implementation(libs.ktor.client.content.negotiation) api(libs.ktor.client.core) implementation(libs.ktor.client.okhttp) - implementation(libs.ktor.client.serialization) + implementation(libs.ktor.http) + implementation(libs.ktor.serialization) implementation(libs.ktor.serialization.kotlinx.json) - implementation(libs.ktor.client.content.negotiation) - implementation(libs.ktor.client.logging) - implementation(libs.kotlinx.serialization.json) + implementation(libs.ktor.utils) + implementation(libs.okhttp) implementation(libs.okhttp.logging.interceptor) + api(libs.tagcommander.core) testImplementation(libs.junit) - testImplementation(libs.mockk) - testImplementation(project(":pillarbox-player-testutils")) - androidTestImplementation(libs.androidx.test.junit) - androidTestImplementation(libs.androidx.espresso.core) - androidTestImplementation(libs.mockk.android) - androidTestImplementation(libs.kotlinx.coroutines.test) + androidTestImplementation(project(":pillarbox-player-testutils")) + + androidTestImplementation(libs.androidx.test.monitor) + androidTestImplementation(libs.androidx.test.runner) + androidTestImplementation(libs.junit) + androidTestRuntimeOnly(libs.kotlinx.coroutines.android) + androidTestImplementation(libs.kotlinx.coroutines.test) } publishing { diff --git a/pillarbox-demo-shared/build.gradle.kts b/pillarbox-demo-shared/build.gradle.kts index 73d5f31f8..44231e4eb 100644 --- a/pillarbox-demo-shared/build.gradle.kts +++ b/pillarbox-demo-shared/build.gradle.kts @@ -35,14 +35,28 @@ android { dependencies { compileOnly(project(":pillarbox-core-business")) - implementation(libs.androidx.ktx) + api(project(":pillarbox-player")) + + implementation(libs.androidx.annotation) implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.material.icons.core) implementation(libs.androidx.compose.material.icons.extended) - implementation(libs.androidx.navigation.common) - implementation(libs.androidx.navigation.runtime) + api(libs.androidx.compose.ui) + api(libs.androidx.compose.ui.graphics) + api(libs.androidx.lifecycle.viewmodel) + implementation(libs.androidx.lifecycle.viewmodel.ktx) + api(libs.androidx.media3.common) + implementation(libs.androidx.media3.datasource) + implementation(libs.androidx.media3.exoplayer) + api(libs.androidx.navigation.common) + api(libs.androidx.navigation.runtime) implementation(libs.androidx.paging.common) - implementation(libs.srg.dataprovider.paging) - implementation(libs.srg.dataprovider.retrofit) + api(libs.kotlinx.coroutines.core) + implementation(libs.ktor.client.core) + implementation(libs.okhttp) + api(libs.srg.data) + api(libs.srg.dataprovider.paging) + api(libs.srg.dataprovider.retrofit) testImplementation(libs.junit) } diff --git a/pillarbox-demo-tv/build.gradle.kts b/pillarbox-demo-tv/build.gradle.kts index 4c328d2d3..d5ddcd0ba 100644 --- a/pillarbox-demo-tv/build.gradle.kts +++ b/pillarbox-demo-tv/build.gradle.kts @@ -64,25 +64,49 @@ android { dependencies { implementation(project(":pillarbox-core-business")) - implementation(project(":pillarbox-analytics")) - implementation(project(":pillarbox-ui")) implementation(project(":pillarbox-demo-shared")) - implementation(libs.androidx.ktx) - implementation(libs.coil) - implementation(libs.leanback) - implementation(libs.srg.dataprovider.retrofit) + implementation(project(":pillarbox-player")) + implementation(project(":pillarbox-ui")) - val composeBom = libs.androidx.compose.bom - implementation(platform(composeBom)) + implementation(libs.androidx.activity) implementation(libs.androidx.activity.compose) + implementation(libs.androidx.compose.animation) + implementation(libs.androidx.compose.animation.core) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.foundation.layout) + implementation(libs.androidx.compose.material.icons.core) implementation(libs.androidx.compose.material.icons.extended) + implementation(libs.androidx.compose.runtime) + implementation(libs.androidx.compose.runtime.saveable) implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.ui.graphics) + implementation(libs.androidx.compose.ui.text) implementation(libs.androidx.compose.ui.tooling.preview) + implementation(libs.androidx.compose.ui.unit) + implementation(libs.androidx.compose.ui.util) + implementation(libs.androidx.fragment) + implementation(libs.androidx.lifecycle.common) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.lifecycle.viewmodel) + implementation(libs.androidx.lifecycle.viewmodel.compose) + implementation(libs.androidx.media3.common) + implementation(libs.androidx.media3.exoplayer) + implementation(libs.androidx.media3.session) + implementation(libs.androidx.media3.ui.leanback) + implementation(libs.androidx.navigation.common) implementation(libs.androidx.navigation.compose) + implementation(libs.androidx.navigation.runtime) + implementation(libs.androidx.paging.common) implementation(libs.androidx.paging.compose) - - // Compose for TV dependencies implementation(libs.androidx.tv.foundation) implementation(libs.androidx.tv.material) - implementation(libs.androidx.media3.ui.leanback) + implementation(libs.coil) + implementation(libs.kotlin.stdlib) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.leanback) + implementation(libs.srg.data) + implementation(libs.srg.dataprovider.retrofit) + + debugImplementation(libs.androidx.compose.ui.tooling) } diff --git a/pillarbox-demo/build.gradle.kts b/pillarbox-demo/build.gradle.kts index 2d1ae1d20..ddd4ac85a 100644 --- a/pillarbox-demo/build.gradle.kts +++ b/pillarbox-demo/build.gradle.kts @@ -97,36 +97,54 @@ android { } dependencies { - implementation(project(":pillarbox-core-business")) implementation(project(":pillarbox-analytics")) - implementation(project(":pillarbox-ui")) + implementation(project(":pillarbox-core-business")) implementation(project(":pillarbox-demo-shared")) - implementation(libs.androidx.ktx) + implementation(project(":pillarbox-player")) + implementation(project(":pillarbox-ui")) - val composeBom = libs.androidx.compose.bom - implementation(platform(composeBom)) - implementation(libs.androidx.compose.material3) + implementation(libs.accompanist.navigation.material) + implementation(libs.androidx.activity) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.activity.ktx) + implementation(libs.androidx.annotation) + implementation(libs.androidx.compose.animation) + implementation(libs.androidx.compose.animation.core) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.foundation.layout) + implementation(libs.androidx.compose.material.icons.core) implementation(libs.androidx.compose.material.icons.extended) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.runtime) implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.ui.geometry) + implementation(libs.androidx.compose.ui.graphics) + implementation(libs.androidx.compose.ui.text) implementation(libs.androidx.compose.ui.tooling.preview) - + implementation(libs.androidx.compose.ui.unit) + implementation(libs.androidx.core) + implementation(libs.androidx.lifecycle.common) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.lifecycle.viewmodel) implementation(libs.androidx.lifecycle.viewmodel.compose) - implementation(libs.androidx.activity.compose) + implementation(libs.androidx.lifecycle.viewmodel.ktx) + implementation(libs.androidx.media3.common) + implementation(libs.androidx.media3.datasource) + implementation(libs.androidx.media3.exoplayer) + implementation(libs.androidx.media3.session) + implementation(libs.androidx.media3.ui) + implementation(libs.androidx.navigation.common) implementation(libs.androidx.navigation.compose) - implementation(libs.accompanist.navigation.material) - - // Integration layer + implementation(libs.androidx.navigation.runtime) + implementation(libs.androidx.paging.common) + implementation(libs.androidx.paging.compose) + implementation(libs.guava) + implementation(libs.kotlin.stdlib) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.okhttp) implementation(libs.srg.data) implementation(libs.srg.dataprovider.retrofit) - implementation(libs.srg.dataprovider.paging) - implementation(libs.androidx.paging.compose) - - androidTestImplementation(platform(composeBom)) - androidTestImplementation(libs.androidx.compose.ui.test.junit4) - testImplementation(libs.junit) - androidTestImplementation(libs.androidx.test.junit) - androidTestImplementation(libs.androidx.espresso.core) debugImplementation(libs.androidx.compose.ui.tooling) - debugImplementation(libs.androidx.compose.ui.test.manifest) } diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/MainNavigation.kt b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/MainNavigation.kt index 760f3a39c..de2337c3a 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/MainNavigation.kt +++ b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/MainNavigation.kt @@ -102,7 +102,7 @@ fun MainNavigation() { IconButton(onClick = { navController.navigateUp() }) { Icon( imageVector = Icons.Default.ArrowBack, - contentDescription = stringResource(androidx.appcompat.R.string.abc_action_bar_up_description) + contentDescription = stringResource(R.string.navigate_up) ) } } diff --git a/pillarbox-demo/src/main/res/values/strings.xml b/pillarbox-demo/src/main/res/values/strings.xml index 3e8af611e..f6d1cb386 100644 --- a/pillarbox-demo/src/main/res/values/strings.xml +++ b/pillarbox-demo/src/main/res/values/strings.xml @@ -24,4 +24,5 @@ Stage Test Updatable media metadata + Navigate up diff --git a/pillarbox-player-testutils/build.gradle.kts b/pillarbox-player-testutils/build.gradle.kts index f875e8be3..35fd9def6 100644 --- a/pillarbox-player-testutils/build.gradle.kts +++ b/pillarbox-player-testutils/build.gradle.kts @@ -42,7 +42,8 @@ android { } dependencies { + api(libs.androidx.media3.common) compileOnly(libs.androidx.media3.exoplayer) - compileOnly(libs.androidx.ktx) - compileOnly(libs.kotlinx.coroutines.android) + runtimeOnly(libs.kotlinx.coroutines.android) + compileOnly(libs.kotlinx.coroutines.core) } diff --git a/pillarbox-player/build.gradle.kts b/pillarbox-player/build.gradle.kts index b26f511d6..222f2395a 100644 --- a/pillarbox-player/build.gradle.kts +++ b/pillarbox-player/build.gradle.kts @@ -43,32 +43,53 @@ android { withJavadocJar() } } + + // Mockk includes some licenses information, which may conflict with other license files. This block merges all licenses together. + // Mockk excludes all licenses instead: + // https://github.com/mockk/mockk/blob/f879502a044c83c2a5fd52992f20903209eb34f3/modules/mockk-android/build.gradle.kts#L14-L19 + packaging { + resources { + merges += "META-INF/LICENSE.md" + merges += "META-INF/LICENSE-notice.md" + } + } testOptions { unitTests.isReturnDefaultValues = true } } dependencies { - implementation(libs.androidx.ktx) - api(libs.kotlinx.coroutines.android) - api(libs.kotlinx.coroutines.core) - - api(libs.androidx.media) - api(libs.androidx.media3.exoplayer) + implementation(libs.androidx.annotation) + implementation(libs.androidx.core) + implementation(libs.androidx.media) + api(libs.androidx.media3.common) implementation(libs.androidx.media3.dash) + api(libs.androidx.media3.datasource) + api(libs.androidx.media3.exoplayer) implementation(libs.androidx.media3.hls) api(libs.androidx.media3.session) api(libs.androidx.media3.ui) + api(libs.guava) + runtimeOnly(libs.kotlinx.coroutines.android) + api(libs.kotlinx.coroutines.core) + + testImplementation(project(":pillarbox-player-testutils")) testImplementation(libs.junit) - testImplementation(libs.mockk) testImplementation(libs.kotlinx.coroutines.test) - testImplementation(project(":pillarbox-player-testutils")) + testImplementation(libs.mockk) + testImplementation(libs.mockk.dsl) - androidTestImplementation(libs.androidx.test.junit) - androidTestImplementation(libs.androidx.espresso.core) - androidTestImplementation(libs.mockk.android) androidTestImplementation(project(":pillarbox-player-testutils")) + + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.androidx.test.monitor) + androidTestRuntimeOnly(libs.androidx.test.runner) + androidTestImplementation(libs.junit) + androidTestRuntimeOnly(libs.kotlinx.coroutines.android) + androidTestImplementation(libs.mockk) + androidTestImplementation(libs.mockk.android) + androidTestImplementation(libs.mockk.dsl) } publishing { diff --git a/pillarbox-ui/build.gradle.kts b/pillarbox-ui/build.gradle.kts index 4462f85f2..bbcbe3d84 100644 --- a/pillarbox-ui/build.gradle.kts +++ b/pillarbox-ui/build.gradle.kts @@ -5,7 +5,6 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) `maven-publish` } @@ -50,20 +49,28 @@ android { } dependencies { - api(project(":pillarbox-player")) + implementation(project(":pillarbox-player")) - implementation(libs.androidx.ktx) - val composeBom = libs.androidx.compose.bom - implementation(platform(composeBom)) - - implementation(libs.androidx.compose.ui) + implementation(libs.androidx.annotation) + api(libs.androidx.compose.animation) + implementation(libs.androidx.compose.animation.core) + implementation(platform(libs.androidx.compose.bom)) implementation(libs.androidx.compose.foundation) + api(libs.androidx.compose.foundation.layout) + api(libs.androidx.compose.runtime) + implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.ui.geometry) + implementation(libs.androidx.compose.ui.graphics) + implementation(libs.androidx.compose.ui.text) implementation(libs.androidx.compose.ui.tooling.preview) + implementation(libs.androidx.compose.ui.unit) + implementation(libs.androidx.lifecycle.common) + implementation(libs.guava) + api(libs.androidx.media3.common) + api(libs.androidx.media3.ui) + implementation(libs.kotlinx.coroutines.core) - androidTestImplementation(platform(composeBom)) - androidTestImplementation(libs.androidx.compose.ui.test.junit4) debugImplementation(libs.androidx.compose.ui.tooling) - debugImplementation(libs.androidx.compose.ui.test.manifest) } publishing {