blob: a327bfa3484e3d64688855dc3cfe2bfee6b74861 [file] [log] [blame]
Manuel Vivo7ec019c2022-05-20 12:07:33 +00001/*
2 * Copyright 2022 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
Tiem Songee0da742024-01-03 14:08:46 -080017/**
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 */
omarismail6700b612024-02-19 14:28:20 +000024import androidx.build.LibraryType
Marcello Galhardo91927fb2024-03-29 17:03:00 +000025import androidx.build.PlatformIdentifier
Manuel Vivo7ec019c2022-05-20 12:07:33 +000026
27plugins {
28 id("AndroidXPlugin")
29 id("com.android.library")
30 id("AndroidXComposePlugin")
Manuel Vivo7ec019c2022-05-20 12:07:33 +000031}
32
Marcello Galhardo91927fb2024-03-29 17:03:00 +000033androidXMultiplatform {
34 android()
35 desktop()
Manuel Vivo7ec019c2022-05-20 12:07:33 +000036
Marcello Galhardo91927fb2024-03-29 17:03:00 +000037 defaultPlatform(PlatformIdentifier.ANDROID)
Manuel Vivo6ec2c4f2022-05-21 08:53:13 +000038
Marcello Galhardo91927fb2024-03-29 17:03:00 +000039 sourceSets {
40 commonMain {
41 dependencies {
42 api(projectOrArtifact(":lifecycle:lifecycle-runtime"))
Prajakta Patil7875e362024-04-29 22:20:47 +000043 api("androidx.annotation:annotation:1.8.0")
Marcello Galhardo1cd99e72024-04-04 16:38:17 +010044 api("androidx.compose.runtime:runtime:1.6.5")
Marcello Galhardo91927fb2024-03-29 17:03:00 +000045 }
46 }
47
48 androidMain {
49 dependsOn(commonMain)
Marcello Galhardoe48e6e22024-03-29 17:03:31 +000050 dependencies {
51 // Although this artifact is empty, it ensures that upgrading
52 // `lifecycle-runtime-compose` also updates `lifecycle-runtime-ktx`
53 // in cases where our constraints fail (e.g., internally in AndroidX
54 // when using project dependencies).
55 api(projectOrArtifact(":lifecycle:lifecycle-runtime-ktx"))
56 }
Marcello Galhardo91927fb2024-03-29 17:03:00 +000057 }
58
59 androidInstrumentedTest {
60 dependencies {
61 implementation(projectOrArtifact(":lifecycle:lifecycle-runtime-testing"))
62 implementation(projectOrArtifact(":compose:ui:ui-test-junit4"))
63 implementation(project(":compose:test-utils"))
64 implementation(libs.testRules)
65 implementation(libs.testRunner)
66 implementation(libs.junit)
67 implementation(libs.truth)
68 }
69 }
70 }
Manuel Vivo7ec019c2022-05-20 12:07:33 +000071}
72
73androidx {
74 name = "Lifecycle Runtime Compose"
omarismail6700b612024-02-19 14:28:20 +000075 type = LibraryType.PUBLISHED_KOTLIN_ONLY_LIBRARY
Manuel Vivo7ec019c2022-05-20 12:07:33 +000076 inceptionYear = "2021"
77 description = "Compose integration with Lifecycle"
Marcello Galhardo91927fb2024-03-29 17:03:00 +000078 samples(project(":lifecycle:lifecycle-runtime-compose:lifecycle-runtime-compose-samples"))
Manuel Vivo7ec019c2022-05-20 12:07:33 +000079}
80
81android {
82 namespace "androidx.lifecycle.runtime.compose"
83}