/*
 * Copyright 2019 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.SoftwareType

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

dependencies {
    api(libs.jspecify)
    api("androidx.lifecycle:lifecycle-common:2.0.0")
    api("androidx.annotation:annotation:1.8.1")
    api(project(":camera:camera-core"))
    api(project(":camera:camera-video"))
    api("androidx.lifecycle:lifecycle-livedata-core:2.3.1")

    implementation(project(":camera:camera-lifecycle"))
    implementation("androidx.annotation:annotation-experimental:1.4.1")
    implementation(libs.guavaListenableFuture)
    implementation("androidx.core:core:1.3.2")
    implementation("androidx.concurrent:concurrent-futures:1.0.0")
    implementation(libs.autoValueAnnotations)
    implementation("androidx.appcompat:appcompat:1.1.0")
    implementation("androidx.arch.core:core-common:2.2.0")
    implementation("androidx.fragment:fragment:1.1.0")
    implementation("androidx.lifecycle:lifecycle-livedata:2.3.1")

    testImplementation(libs.testRunner)
    testImplementation(libs.kotlinStdlib)
    testImplementation(libs.truth)
    testImplementation(libs.testRules)
    testImplementation(libs.testCore)
    testImplementation(project(":camera:camera-camera2"))
    testImplementation(project(":camera:camera-testing"))
    testImplementation(libs.guavaAndroid)
    testImplementation(libs.junit)
    testImplementation(libs.kotlinCoroutinesCore)
    testImplementation(libs.testMonitor)
    testImplementation(libs.mockitoCore)

    androidTestImplementation(libs.mockitoCore)
    androidTestImplementation(libs.dexmakerMockito)
    androidTestImplementation(libs.testExtJunit)
    androidTestImplementation(libs.testCore)
    androidTestImplementation(libs.testRunner)
    androidTestImplementation(libs.testRules)
    androidTestImplementation(libs.testUiautomator)
    androidTestImplementation(libs.kotlinStdlib)
    androidTestImplementation(libs.truth)
    androidTestImplementation(project(":camera:camera-camera2"))
    androidTestImplementation(project(":camera:camera-testing")) {
        // Ensure camera-testing does not pull in androidx.test dependencies
        exclude(group:"androidx.test")
    }
    androidTestImplementation(project(":camera:camera-camera2-pipe-integration"))
    androidTestImplementation(project(":internal-testutils-truth"))
    androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
    androidTestImplementation(libs.guavaAndroid)
    androidTestImplementation(libs.junit)
    androidTestImplementation(libs.testMonitor)
}
android {
    compileSdk = 35

    lint {
        enable.add("CameraXQuirksClassDetector")
    }
    namespace = "androidx.camera.view"
}
androidx {
    name = "Camera View"
    type = SoftwareType.PUBLISHED_LIBRARY
    inceptionYear = "2019"
    description = "UI tools for the Jetpack Camera Library, a library providing a consistent and " +
            "reliable camera foundation that enables great camera driven experiences across all " +
            "of Android."
    enableRobolectric()
}
