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

dependencies {
    api("androidx.annotation:annotation:1.8.1")
    api(libs.kotlinStdlib)
    api(libs.guavaListenableFuture)
    api("androidx.concurrent:concurrent-futures-ktx:1.1.0")
    api(libs.kotlinCoroutinesCore)

    androidTestImplementation(libs.testExtJunit)
    androidTestImplementation(libs.testCore)
    androidTestImplementation(libs.testRunner)
    androidTestImplementation(libs.testRules)
    androidTestImplementation(libs.junit)

    // Needed for Assert.assertThrows
    testImplementation(libs.junit)
    testImplementation(libs.testCore)
    testImplementation(libs.testRules)
    testImplementation(libs.testRunner)
    testImplementation(libs.robolectric)
    testImplementation(libs.mockitoCore4)
    testImplementation(libs.mockitoKotlin4)

    implementation(libs.playServicesBasement)
    implementation(libs.playServicesWearable, { exclude group: "androidx.core"})

    // Includes the wear-sdk jar
    compileOnly files("../../wear/wear_sdk/wear-sdk.jar")
    testImplementation(files("../../wear/wear_sdk/wear-sdk.jar"))
}

android {
    defaultConfig {
        minSdk = 23
    }

    // Use Robolectric 4.+
    testOptions.unitTests.includeAndroidResources = true
    namespace = "androidx.wear.remote.interactions"
}

androidx {
    name = "Android Wear Remote Interactions"
    type = LibraryType.PUBLISHED_LIBRARY
    mavenVersion = LibraryVersions.WEAR_REMOTE_INTERACTIONS
    inceptionYear = "2020"
    description = "Android Wear Remote Interactions"
    legacyDisableKotlinStrictApiMode = true
    samples(project(":wear:wear-remote-interactions-samples"))
}
