[go: nahoru, domu]

blob: 2066fe9bb7747c0164c1625dd25dc6a95a99e6b4 [file] [log] [blame]
Jeremy Woods6a956042021-02-03 10:04:26 -08001/*
2 * Copyright 2020 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
Jeremy Woods6a956042021-02-03 10:04:26 -080017import androidx.build.Publish
18import androidx.build.RunApiTasks
Sergey Vasilinets15d5a9d2021-06-25 14:30:22 +010019import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Jeremy Woods6a956042021-02-03 10:04:26 -080020
21plugins {
22 id("AndroidXPlugin")
23 id("com.android.library")
Louis Pullen-Freilichc8a26b82021-06-03 18:11:39 +010024 id("AndroidXComposePlugin")
Jeremy Woods6a956042021-02-03 10:04:26 -080025 id("org.jetbrains.kotlin.android")
26}
27
28dependencies {
Jim Sproch666614b2021-08-18 07:43:56 -070029 kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
Jeremy Woods6a956042021-02-03 10:04:26 -080030
Jeremy Woods0d614ef2022-03-01 17:01:49 -080031 api projectOrArtifact(":lifecycle:lifecycle-common-java8")
Jeremy Woods84aea5a2021-12-08 10:37:29 -080032 api projectOrArtifact(":lifecycle:lifecycle-viewmodel-ktx")
Jeremy Woods0d614ef2022-03-01 17:01:49 -080033 api projectOrArtifact(":lifecycle:lifecycle-viewmodel-savedstate")
Nick Anthony674644d2021-07-27 17:52:46 -040034 api("androidx.compose.runtime:runtime:1.0.1")
35 api "androidx.compose.ui:ui:1.0.1"
Jeremy Woods0d614ef2022-03-01 17:01:49 -080036 api("androidx.annotation:annotation-experimental:1.1.0")
Jeremy Woods6a956042021-02-03 10:04:26 -080037
Aurimas Liutikasbc1dbeb2021-05-04 13:36:59 -070038 implementation(libs.kotlinStdlib)
Andrey Kulikovaf61f662021-02-03 19:48:53 +000039
40 androidTestImplementation projectOrArtifact(":compose:ui:ui-test-junit4")
Jelle Fresend6e2ff52021-04-07 12:31:17 +010041 androidTestImplementation projectOrArtifact(":compose:test-utils")
Aurimas Liutikasbc1dbeb2021-05-04 13:36:59 -070042 androidTestImplementation(libs.testRules)
43 androidTestImplementation(libs.testRunner)
44 androidTestImplementation(libs.junit)
45 androidTestImplementation(libs.truth)
Jeremy Woods11a71682021-02-09 10:09:05 -080046 androidTestImplementation "androidx.fragment:fragment:1.3.0"
Nick Anthony499aae22021-06-22 18:16:21 -040047 androidTestImplementation "androidx.appcompat:appcompat:1.3.0"
Jeremy Woods84aea5a2021-12-08 10:37:29 -080048 // old version of common-java8 conflicts with newer version, because both have
49 // DefaultLifecycleEventObserver.
50 // Outside of androidx this is resolved via constraint added to lifecycle-common,
51 // but it doesn't work in androidx.
52 // See aosp/1804059
53 androidTestImplementation projectOrArtifact(":lifecycle:lifecycle-common-java8")
54 androidTestImplementation projectOrArtifact(":lifecycle:lifecycle-viewmodel-savedstate")
Andrey Kulikovaf61f662021-02-03 19:48:53 +000055 androidTestImplementation projectOrArtifact(":activity:activity-compose")
Jeremy Woods0d614ef2022-03-01 17:01:49 -080056 androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-runtime-testing"))
Aurimas Liutikasfc69bb62021-09-16 15:40:50 -070057
58 samples(projectOrArtifact(":lifecycle:lifecycle-viewmodel-compose:lifecycle-viewmodel-compose-samples"))
Jeremy Woods6a956042021-02-03 10:04:26 -080059}
60
61androidx {
62 name = "Lifecycle ViewModel Compose"
63 publish = Publish.SNAPSHOT_AND_RELEASE
Jeremy Woods6a956042021-02-03 10:04:26 -080064 mavenGroup = LibraryGroups.LIFECYCLE
65 inceptionYear = "2021"
66 description = "Compose integration with Lifecycle ViewModel"
67 runApiTasks = new RunApiTasks.Yes()
68}
Sergey Vasilinets15d5a9d2021-06-25 14:30:22 +010069
Aurimas Liutikasdcfa0352022-03-14 16:05:33 -070070android {
71 namespace "androidx.lifecycle.viewmodel.compose"
72}