/*
 * Copyright (C) 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")
    id("org.jetbrains.kotlin.android")
    id("org.jetbrains.kotlin.kapt")
}

dependencies {
    api(libs.kotlinStdlib)

    kaptAndroidTest(project(":appsearch:appsearch-compiler"))
    androidTestImplementation(project(":appsearch:appsearch"))
    androidTestImplementation(project(":appsearch:appsearch-local-storage"))
    androidTestImplementation(project(":appsearch:appsearch-test-util"))
    androidTestImplementation(libs.testCore)
    androidTestImplementation(libs.testRules)
    androidTestImplementation(libs.truth)
}

androidx {
    name = "AppSearch - Kotlin Extensions"
    type = LibraryType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS
    inceptionYear = '2021'
    description = 'AndroidX AppSearch - Kotlin Extensions'
}

android {
    compileSdk = 35
    namespace = "androidx.appsearch.ktx"
}
