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

dependencies {
    androidTestImplementation(projectOrArtifact(":benchmark:benchmark-common"))
    androidTestImplementation(projectOrArtifact(":benchmark:benchmark-junit4"))
    androidTestImplementation(project(":internal-testutils-navigation"))
    androidTestImplementation(project(":navigation:navigation-common"))
    androidTestImplementation(project(":navigation:navigation-runtime"))
    androidTestImplementation(libs.junit)
    androidTestImplementation(libs.testExtJunit)
    androidTestImplementation(libs.testCore)
    androidTestImplementation(libs.testRunner)
    androidTestImplementation(libs.kotlinStdlib)

    // TODO: Workaround for "R8: Type is defined multiple times" due to the ongoing migration of
    //  Navigation libraries to KMP. `-ktx` are empty in ToT but old versions still have classes.
    androidTestImplementation(project(":lifecycle:lifecycle-runtime-ktx"))
    androidTestImplementation(project(":lifecycle:lifecycle-viewmodel-ktx"))
    androidTestImplementation(project(":savedstate:savedstate-ktx"))
}

androidx {
    name = "Navigation Benchmarks"
    type = LibraryType.BENCHMARK
    inceptionYear = "2018"
    description = "Navigation Benchmarks"
}

android {
    namespace = "androidx.navigation.benchmark"
}
