1/*
2 * Copyright 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**
18 * This file was created using the `create_project.py` script located in the
19 * `<AndroidX root>/development/project-creator` directory.
20 *
21 * Please use that script when creating a new project, rather than copying an existing project and
22 * modifying its settings.
23 */
24import androidx.build.SoftwareType
25import androidx.build.AndroidXComposePlugin
26
27plugins {
28    id("AndroidXPlugin")
29    id("com.android.library")
30    id("org.jetbrains.kotlin.android")
31    id("AndroidXComposePlugin")
32}
33
34dependencies {
35    api(project(":glance:glance"))
36    api(project(":glance:glance-appwidget"))
37    api("androidx.annotation:annotation:1.8.1")
38    api("androidx.compose.runtime:runtime:1.1.1")
39    api("androidx.compose.ui:ui-graphics:1.1.1")
40    api("androidx.compose.ui:ui-unit:1.1.1")
41    api("androidx.datastore:datastore-core:1.0.0")
42    api("androidx.datastore:datastore-preferences-core:1.0.0")
43    api("androidx.datastore:datastore-preferences:1.0.0")
44
45    implementation("androidx.work:work-runtime:2.7.1")
46    implementation("androidx.work:work-runtime-ktx:2.7.1")
47    implementation(libs.kotlinStdlib)
48
49    // Force upgrade since 1.2.0 is not compatible with latest lint.
50    implementation("androidx.annotation:annotation-experimental:1.4.1")
51
52    testImplementation(libs.robolectric)
53    testImplementation(libs.testCore)
54    testImplementation(libs.testRules)
55    testImplementation(libs.testRunner)
56    testImplementation(libs.truth)
57    testImplementation(libs.junit)
58    testImplementation(libs.kotlinCoroutinesTest)
59    testImplementation(libs.kotlinTest)
60    testImplementation(libs.kotlinReflect)
61    testImplementation(libs.mockitoCore4)
62    testImplementation(libs.mockitoKotlin4)
63    testImplementation("androidx.datastore:datastore-core:1.0.0")
64    testImplementation("androidx.datastore:datastore-preferences-core:1.0.0")
65    testImplementation("androidx.datastore:datastore-preferences:1.0.0")
66    testImplementation("androidx.room:room-runtime:2.4.3")
67    testImplementation("androidx.work:work-testing:2.7.1")
68    testImplementation("com.google.android.material:material:1.6.0")
69}
70
71android {
72    // Use Robolectric 4.+
73    testOptions.unitTests.includeAndroidResources = true
74    resourcePrefix "glance_template_"
75    namespace = "androidx.glance.template"
76    compileSdk = 35
77}
78
79androidx {
80    name = "Glance Templates"
81    type = SoftwareType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS
82    mavenVersion = LibraryVersions.GLANCE_TEMPLATE
83    inceptionYear = "2021"
84    description = "Glance allows developers to build layouts for remote surfaces using a Jetpack " +
85            "Compose-style API."
86    legacyDisableKotlinStrictApiMode = true
87    metalavaK2UastEnabled = false
88}
89