/*
 * Copyright 2023 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
import androidx.build.AndroidXComposePlugin

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

dependencies {
    api(project(":glance:glance"))
    api(project(":glance:glance-appwidget"))
    api("androidx.annotation:annotation:1.8.1")
    api("androidx.compose.runtime:runtime:1.1.1")
    api("androidx.compose.ui:ui-graphics:1.1.1")
    api("androidx.compose.ui:ui-unit:1.1.1")
    api("androidx.datastore:datastore-core:1.0.0")
    api("androidx.datastore:datastore-preferences-core:1.0.0")
    api("androidx.datastore:datastore-preferences:1.0.0")

    implementation("androidx.work:work-runtime:2.7.1")
    implementation("androidx.work:work-runtime-ktx:2.7.1")
    implementation(libs.kotlinStdlib)

    // Force upgrade since 1.2.0 is not compatible with latest lint.
    implementation("androidx.annotation:annotation-experimental:1.4.1")

    testImplementation(libs.robolectric)
    testImplementation(libs.testCore)
    testImplementation(libs.testRules)
    testImplementation(libs.testRunner)
    testImplementation(libs.truth)
    testImplementation(libs.junit)
    testImplementation(libs.kotlinCoroutinesTest)
    testImplementation(libs.kotlinTest)
    testImplementation(libs.kotlinReflect)
    testImplementation(libs.mockitoCore4)
    testImplementation(libs.mockitoKotlin4)
    testImplementation("androidx.datastore:datastore-core:1.0.0")
    testImplementation("androidx.datastore:datastore-preferences-core:1.0.0")
    testImplementation("androidx.datastore:datastore-preferences:1.0.0")
    testImplementation("androidx.room:room-runtime:2.4.3")
    testImplementation("androidx.work:work-testing:2.7.1")
    testImplementation("com.google.android.material:material:1.6.0")
}

android {
    // Use Robolectric 4.+
    testOptions.unitTests.includeAndroidResources = true
    resourcePrefix "glance_template_"
    namespace = "androidx.glance.template"
    compileSdk = 35
}

androidx {
    name = "Glance Templates"
    type = LibraryType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS
    mavenVersion = LibraryVersions.GLANCE_TEMPLATE
    inceptionYear = "2021"
    description = "Glance allows developers to build layouts for remote surfaces using a Jetpack " +
            "Compose-style API."
    legacyDisableKotlinStrictApiMode = true
    metalavaK2UastEnabled = false
}
