/*
 * Copyright 2018 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")
}

dependencies {
    api(project(":lifecycle:lifecycle-livedata"))
    api(project(":lifecycle:lifecycle-livedata-core-ktx"))
    api(libs.kotlinStdlib)
    api(libs.kotlinCoroutinesCore)
    testImplementation(project(":lifecycle:lifecycle-runtime-testing"))
    testImplementation("androidx.arch.core:core-testing:2.2.0")
    testImplementation(libs.junit)
    testImplementation(libs.truth)
    testImplementation(libs.kotlinCoroutinesTest)
    androidTestImplementation(libs.truth)
    androidTestImplementation(libs.testExtJunit)
    androidTestImplementation(libs.testCore)
    androidTestImplementation(libs.testRules)
    androidTestImplementation(libs.testRunner)
    androidTestImplementation(libs.kotlinCoroutinesTest)
    androidTestImplementation(libs.kotlinCoroutinesAndroid)
}

androidx {
    name = "LiveData Kotlin Extensions"
    type = LibraryType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS
    inceptionYear = "2018"
    description = "Kotlin extensions for 'livedata' artifact"
}

android {
    namespace = "androidx.lifecycle.livedata.ktx"
}
