/*
 * Copyright 2020 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

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

dependencies {
    // Classes and types that are needed at compile & runtime
    api("androidx.annotation:annotation:1.8.1")

    // Classes and types that are only needed at runtime
    implementation(libs.atomicFu)
    implementation(libs.kotlinStdlib)
    implementation(libs.kotlinCoroutinesTest)
    implementation(project(":camera:camera-camera2-pipe"))
    implementation(project(":camera:featurecombinationquery:featurecombinationquery"))

    testImplementation(libs.testCore)
    testImplementation(libs.testRunner)
    testImplementation(libs.junit)
    testImplementation(libs.truth)
    testImplementation(libs.kotlinCoroutinesTest)
    testImplementation(libs.kotlinCoroutinesCore)
}

android {
    compileSdk = 35

    lint {
        enable.add("CameraXQuirksClassDetector")
    }
    namespace = "androidx.camera.camera2.pipe.testing"
}

// Allow usage of Kotlin's @OptIn.
tasks.withType(KotlinCompile).configureEach {
    kotlinOptions {
        freeCompilerArgs += ["-opt-in=kotlin.RequiresOptIn"]
    }
}

androidx {
    name = "Camera2 Pipe Testing"
    type = SoftwareType.PUBLISHED_LIBRARY
    mavenVersion = LibraryVersions.CAMERA_PIPE
    inceptionYear = "2020"
    description = "Testing components for the Camera2 Pipe Library, a library providing a " +
            "consistent and reliable camera foundation that enables great camera driven " +
            "experiences across all of Android."
    doNotDocumentReason = "Not shipped externally"
    enableRobolectric()
}
