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

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

dependencies {
    api(libs.kotlinStdlib)
    implementation(project(":navigationevent:navigationevent"))
    implementation(project(":navigationevent:navigationevent-compose"))
    implementation(project(":navigationevent:navigationevent-testing"))
    compileOnly(project(":annotation:annotation-sampled"))
}

android {
    compileSdk = 36
    namespace = "androidx.navigationevent.samples"
}

androidx {
    name = "androidx.navigationevent:navigationevent-samples"
    type = SoftwareType.SAMPLES
    inceptionYear = "2025"
    description = "Sample code for NavigationEvent"
}
