/**
 * 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")
}

dependencies {
    api(libs.jspecify)
    api("androidx.annotation:annotation:1.8.1")
    implementation("androidx.collection:collection:1.4.2")
    api("androidx.appcompat:appcompat:1.0.0")
    api("androidx.recyclerview:recyclerview:1.3.2")
    api("androidx.preference:preference:1.1.0")
    api(project(":leanback:leanback"))
}

android {
    compileSdk = 35
    sourceSets {
        main.java.srcDirs += [
                "api21"
        ]
    }
    namespace = "androidx.leanback.preference"
}

androidx {
    name = "Leanback Preference"
    type = LibraryType.PUBLISHED_LIBRARY
    mavenVersion = LibraryVersions.LEANBACK_PREFERENCE
    inceptionYear = "2015"
    description = "AndroidX Leanback Preference"
    failOnDeprecationWarnings = false
    // TODO: b/326456246
    optOutJSpecify = true
}
