Jeremy Woods | 6a95604 | 2021-02-03 10:04:26 -0800 | [diff] [blame] | 1 | /* |
| 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 Woods | 6a95604 | 2021-02-03 10:04:26 -0800 | [diff] [blame] | 17 | import androidx.build.Publish |
| 18 | import androidx.build.RunApiTasks |
Sergey Vasilinets | 15d5a9d | 2021-06-25 14:30:22 +0100 | [diff] [blame] | 19 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
Jeremy Woods | 6a95604 | 2021-02-03 10:04:26 -0800 | [diff] [blame] | 20 | |
| 21 | plugins { |
| 22 | id("AndroidXPlugin") |
| 23 | id("com.android.library") |
Louis Pullen-Freilich | c8a26b8 | 2021-06-03 18:11:39 +0100 | [diff] [blame] | 24 | id("AndroidXComposePlugin") |
Jeremy Woods | 6a95604 | 2021-02-03 10:04:26 -0800 | [diff] [blame] | 25 | id("org.jetbrains.kotlin.android") |
| 26 | } |
| 27 | |
| 28 | dependencies { |
Jim Sproch | 666614b | 2021-08-18 07:43:56 -0700 | [diff] [blame] | 29 | kotlinPlugin(projectOrArtifact(":compose:compiler:compiler")) |
Jeremy Woods | 6a95604 | 2021-02-03 10:04:26 -0800 | [diff] [blame] | 30 | |
Jeremy Woods | 0d614ef | 2022-03-01 17:01:49 -0800 | [diff] [blame] | 31 | api projectOrArtifact(":lifecycle:lifecycle-common-java8") |
Jeremy Woods | 84aea5a | 2021-12-08 10:37:29 -0800 | [diff] [blame] | 32 | api projectOrArtifact(":lifecycle:lifecycle-viewmodel-ktx") |
Jeremy Woods | 0d614ef | 2022-03-01 17:01:49 -0800 | [diff] [blame] | 33 | api projectOrArtifact(":lifecycle:lifecycle-viewmodel-savedstate") |
Nick Anthony | 674644d | 2021-07-27 17:52:46 -0400 | [diff] [blame] | 34 | api("androidx.compose.runtime:runtime:1.0.1") |
| 35 | api "androidx.compose.ui:ui:1.0.1" |
Jeremy Woods | 0d614ef | 2022-03-01 17:01:49 -0800 | [diff] [blame] | 36 | api("androidx.annotation:annotation-experimental:1.1.0") |
Jeremy Woods | 6a95604 | 2021-02-03 10:04:26 -0800 | [diff] [blame] | 37 | |
Aurimas Liutikas | bc1dbeb | 2021-05-04 13:36:59 -0700 | [diff] [blame] | 38 | implementation(libs.kotlinStdlib) |
Andrey Kulikov | af61f66 | 2021-02-03 19:48:53 +0000 | [diff] [blame] | 39 | |
| 40 | androidTestImplementation projectOrArtifact(":compose:ui:ui-test-junit4") |
Jelle Fresen | d6e2ff5 | 2021-04-07 12:31:17 +0100 | [diff] [blame] | 41 | androidTestImplementation projectOrArtifact(":compose:test-utils") |
Aurimas Liutikas | bc1dbeb | 2021-05-04 13:36:59 -0700 | [diff] [blame] | 42 | androidTestImplementation(libs.testRules) |
| 43 | androidTestImplementation(libs.testRunner) |
| 44 | androidTestImplementation(libs.junit) |
| 45 | androidTestImplementation(libs.truth) |
Jeremy Woods | 11a7168 | 2021-02-09 10:09:05 -0800 | [diff] [blame] | 46 | androidTestImplementation "androidx.fragment:fragment:1.3.0" |
Nick Anthony | 499aae2 | 2021-06-22 18:16:21 -0400 | [diff] [blame] | 47 | androidTestImplementation "androidx.appcompat:appcompat:1.3.0" |
Jeremy Woods | 84aea5a | 2021-12-08 10:37:29 -0800 | [diff] [blame] | 48 | // 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 Kulikov | af61f66 | 2021-02-03 19:48:53 +0000 | [diff] [blame] | 55 | androidTestImplementation projectOrArtifact(":activity:activity-compose") |
Jeremy Woods | 0d614ef | 2022-03-01 17:01:49 -0800 | [diff] [blame] | 56 | androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-runtime-testing")) |
Aurimas Liutikas | fc69bb6 | 2021-09-16 15:40:50 -0700 | [diff] [blame] | 57 | |
| 58 | samples(projectOrArtifact(":lifecycle:lifecycle-viewmodel-compose:lifecycle-viewmodel-compose-samples")) |
Jeremy Woods | 6a95604 | 2021-02-03 10:04:26 -0800 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | androidx { |
| 62 | name = "Lifecycle ViewModel Compose" |
| 63 | publish = Publish.SNAPSHOT_AND_RELEASE |
Jeremy Woods | 6a95604 | 2021-02-03 10:04:26 -0800 | [diff] [blame] | 64 | mavenGroup = LibraryGroups.LIFECYCLE |
| 65 | inceptionYear = "2021" |
| 66 | description = "Compose integration with Lifecycle ViewModel" |
| 67 | runApiTasks = new RunApiTasks.Yes() |
| 68 | } |
Sergey Vasilinets | 15d5a9d | 2021-06-25 14:30:22 +0100 | [diff] [blame] | 69 | |
Aurimas Liutikas | dcfa035 | 2022-03-14 16:05:33 -0700 | [diff] [blame] | 70 | android { |
| 71 | namespace "androidx.lifecycle.viewmodel.compose" |
| 72 | } |