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

import androidx.build.LibraryType

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

dependencies {
    api(libs.jspecify)
    api(libs.androidx.annotation)
    implementation(libs.autoValueAnnotations)

    testImplementation(libs.testRunner)
    testImplementation(libs.robolectric)
    testImplementation(libs.kotlinStdlib)
    testImplementation(libs.truth)
    testImplementation(libs.testRules)
    testImplementation(libs.testCore)

    annotationProcessor(libs.autoValue)
}

android {
    lintOptions {
        enable 'CameraXQuirksClassDetector'
    }

    compileSdk = 35
    testOptions.unitTests.includeAndroidResources = true
    namespace = "androidx.camera.featurecombinationquery"
}

androidx {
    name = "Camera Feature Combination Query"
    type = LibraryType.PUBLISHED_LIBRARY
    inceptionYear = "2024"
    description = "Camera feature combination components for the Camera Library, a library " +
            "providing a seamless experience for querying camera features across all of Android."
}
