|
| 1 | +/* |
| 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 | + |
| 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 | + */ |
| 24 | + |
| 25 | +import androidx.build.JetbrainsAndroidXPlugin |
| 26 | +import androidx.build.AndroidXComposePlugin |
| 27 | +import androidx.build.LibraryType |
| 28 | +import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
| 29 | + |
| 30 | +plugins { |
| 31 | + id("AndroidXPlugin") |
| 32 | + id("com.android.library") |
| 33 | + id("AndroidXComposePlugin") |
| 34 | + id("JetbrainsAndroidXPlugin") |
| 35 | +} |
| 36 | + |
| 37 | +AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project) |
| 38 | +JetbrainsAndroidXPlugin.applyAndConfigure(project) |
| 39 | + |
| 40 | +androidXComposeMultiplatform { |
| 41 | + android() |
| 42 | + desktop() |
| 43 | + darwin() |
| 44 | + js() |
| 45 | + wasm() |
| 46 | + linux() |
| 47 | +} |
| 48 | + |
| 49 | +kotlin { |
| 50 | + watchosArm64() |
| 51 | + watchosArm32() |
| 52 | + watchosX64() |
| 53 | + watchosSimulatorArm64() |
| 54 | + tvosArm64() |
| 55 | + tvosX64() |
| 56 | + tvosSimulatorArm64() |
| 57 | + mingwX64() |
| 58 | + |
| 59 | + sourceSets { |
| 60 | + commonMain { |
| 61 | + dependencies { |
| 62 | + def version = project.findProperty('artifactRedirection.version.androidx.lifecycle') |
| 63 | + api("androidx.lifecycle:lifecycle-runtime-compose:$version") |
| 64 | + |
| 65 | + // Keep direct reference to Compose multiplatform 1.9.x to correctly resolve |
| 66 | + // New redirections to Google's artifacts |
| 67 | + implementation(project(":compose:runtime:runtime")) |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | +} |
| 72 | + |
| 73 | +androidx { |
| 74 | + name = "Lifecycle Runtime Compose" |
| 75 | + type = LibraryType.PUBLISHED_LIBRARY |
| 76 | + inceptionYear = "2021" |
| 77 | + description = "Compose integration with Lifecycle" |
| 78 | + metalavaK2UastEnabled = true |
| 79 | +} |
| 80 | + |
| 81 | +android { |
| 82 | + namespace "androidx.lifecycle.runtime.compose" |
| 83 | +} |
0 commit comments