/*
 * Copyright 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * 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")
    api("androidx.core:core:1.1.0")
    api("androidx.recyclerview:recyclerview:1.3.2")
    implementation("androidx.collection:collection:1.4.2")

    constraints {
        // TODO: Mention min version for leanback.
        implementation(project(":leanback:leanback"))
    }

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

android {
    compileSdk = 35
    namespace = "androidx.leanback.widget"
}

androidx {
    name = "Leanback Grid"
    type = LibraryType.PUBLISHED_LIBRARY
    mavenVersion = LibraryVersions.LEANBACK_GRID
    inceptionYear = "2021"
    description = "This library adds grid view components to be used in TV"
    // TODO: b/326456246
    optOutJSpecify = true
}
