/**
 * This file was created using the `create_project.py` script located in the
 * `<AndroidX root>/development/project-creator` directory.
 *
 * Please use that script when creating a new project, rather than copying an existing project and
 * modifying its settings.
 */
import androidx.build.LibraryType

plugins {
    id("AndroidXPlugin")
    id("com.android.library")
    id("kotlin-android")
}

dependencies {
    api("androidx.annotation:annotation:1.8.1")
    api("androidx.leanback:leanback:1.1.0-beta01")
    api("androidx.paging:paging-runtime:3.1.0")

    // To avoid manifest merger warnings due to duplicate package names
    // It can be removed if leanback library is updated to a newer version
    implementation("androidx.vectordrawable:vectordrawable-animated:1.1.0")

    androidTestImplementation(libs.testExtJunit)
    androidTestImplementation(libs.testCore)
    androidTestImplementation(libs.testRunner)
    androidTestImplementation(libs.testRules)
    androidTestImplementation(libs.espressoCore)
    androidTestImplementation(libs.mockitoCore)
    androidTestImplementation(libs.dexmakerMockito)
    androidTestImplementation(project(":internal-testutils-espresso"))
    androidTestImplementation(project(":internal-testutils-runtime"))
    androidTestImplementation(project(":internal-testutils-common"))
    androidTestImplementation(project(":internal-testutils-ktx"))
    // internal-testutils-paging uses latest version of paging-common which is getting pulled in
    // by gradle when leanback runs. But leanback uses paging-runtime:3.0.0. The version discrepancy
    // between paging-common and paging-runtime will cause errors. `Exclude` prevents pulling in
    // paging-common from internal-testutils-paging and uses the 3.0.0 version provided by leanback.
    androidTestImplementation(project(":internal-testutils-paging")){
        exclude group: "androidx.paging"
    }
    androidTestImplementation(libs.kotlinTest)
    androidTestImplementation(libs.kotlinCoroutinesTest)
    androidTestImplementation("androidx.arch.core:core-testing:2.2.0")
    androidTestImplementation("androidx.lifecycle:lifecycle-runtime-testing:2.3.1")
}

android {
    compileSdk = 35
    lintOptions {
        // Bug in Android Lint 7.0.0-alpha15 b/187419330
        disable("MissingLeanbackLauncher", "ImpliedTouchscreenHardware", "MissingLeanbackSupport")
    }
    namespace = "androidx.leanback.paging"
}

androidx {
    name = "Leanback Paging"
    type = LibraryType.PUBLISHED_LIBRARY
    mavenVersion = LibraryVersions.LEANBACK_PAGING
    inceptionYear = "2020"
    description = "AndroidX Leanback Paging"
    failOnDeprecationWarnings = false
    legacyDisableKotlinStrictApiMode = true
}
