/*
 * Copyright (C) 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.
 */

/**
 * 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.KotlinTarget
import androidx.build.LibraryType

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

dependencies {
    api(libs.kotlinStdlib)
    compileOnly(project(":annotation:annotation-sampled"))
    implementation(project(":lifecycle:lifecycle-viewmodel"))
    implementation(project(":lifecycle:lifecycle-viewmodel-savedstate"))
}

android {
    namespace = "androidx.lifecycle.viewmodel.savedstate.samples"
}

androidx {
    name = "androidx.lifecycle:lifecycle-viewmodel-savedstate-samples"
    type = LibraryType.SAMPLES
    inceptionYear = "2024"
    description = "Lifecycle ViewModel SavedState Samples"
    kotlinTarget = KotlinTarget.KOTLIN_1_9
}
