| /** |
| * This file was created using the `create_project.py` script located in the |
| * `<AndroidX root>/development/project-creator` directory. |
| * |
| * Please use that script when creating a new project, rather than copying an existing project and |
| * modifying its settings. |
| */ |
| |
| import androidx.build.LibraryType |
| import androidx.build.PlatformIdentifier |
| import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
| |
| plugins { |
| id("AndroidXPlugin") |
| id("com.android.library") |
| id("androidx.baselineprofile") |
| } |
| androidXMultiplatform { |
| android() |
| desktop() |
| mac() |
| linux() |
| ios() |
| |
| defaultPlatform(PlatformIdentifier.ANDROID) |
| |
| sourceSets { |
| commonMain { |
| dependencies { |
| api(libs.kotlinStdlib) |
| api(project(":lifecycle:lifecycle-common")) |
| api("androidx.annotation:annotation:1.8.1") |
| } |
| } |
| |
| commonTest { |
| dependencies { |
| implementation(project(":internal-testutils-lifecycle")) |
| implementation(libs.kotlinCoroutinesTest) |
| implementation(libs.kotlinTest) |
| implementation(project(":kruth:kruth")) |
| implementation(libs.atomicFu) |
| } |
| } |
| |
| jvmCommonMain { |
| dependsOn(commonMain) |
| dependencies { |
| api("androidx.arch.core:core-common:2.2.0") |
| } |
| } |
| |
| desktopMain { |
| dependsOn(jvmCommonMain) |
| } |
| |
| desktopTest { |
| dependsOn(commonTest) |
| dependencies { |
| implementation(libs.kotlinCoroutinesSwing) |
| } |
| } |
| |
| androidMain { |
| dependsOn(jvmCommonMain) |
| dependencies { |
| api(libs.kotlinCoroutinesAndroid) |
| implementation(project(":core:core-viewtree")) |
| implementation("androidx.arch.core:core-runtime:2.2.0") |
| implementation("androidx.profileinstaller:profileinstaller:1.4.0") |
| } |
| } |
| |
| androidUnitTest { |
| dependsOn(commonTest) |
| dependencies { |
| implementation(libs.junit) |
| implementation(libs.mockitoCore4) |
| } |
| } |
| |
| androidInstrumentedTest { |
| dependsOn(commonTest) |
| dependencies { |
| implementation(project(":core:core-viewtree")) |
| implementation(libs.junit) |
| implementation(libs.truth) |
| implementation(libs.testExtJunit) |
| implementation(libs.testCore) |
| implementation(libs.testRunner) |
| implementation(libs.kotlinCoroutinesTest) |
| } |
| } |
| |
| nonJvmCommonMain { |
| dependsOn(commonMain) |
| } |
| |
| nativeMain { |
| dependsOn(nonJvmCommonMain) |
| |
| // Required for WeakReference usage |
| languageSettings.optIn("kotlin.experimental.ExperimentalNativeApi") |
| } |
| |
| nativeTest { |
| dependsOn(commonTest) |
| } |
| |
| targets.configureEach { target -> |
| if (target.platformType == KotlinPlatformType.native) { |
| target.compilations["main"].defaultSourceSet { |
| dependsOn(nativeMain) |
| |
| // Required for WeakReference usage |
| languageSettings.optIn("kotlin.experimental.ExperimentalNativeApi") |
| } |
| target.compilations["test"].defaultSourceSet { |
| dependsOn(nativeTest) |
| } |
| } |
| } |
| } |
| } |
| |
| dependencies { |
| api(libs.jspecify) |
| lintPublish(project(":lifecycle:lifecycle-runtime-lint")) |
| } |
| |
| android { |
| buildTypes.configureEach { |
| consumerProguardFiles "proguard-rules.pro" |
| } |
| |
| // Include `*.java` files into the build |
| sourceSets["main"].java.srcDir("src/androidMain/java") |
| sourceSets["test"].java.srcDir("src/androidUnitTest/kotlin") |
| namespace = "androidx.lifecycle.runtime" |
| // TODO(b/345531033) |
| experimentalProperties["android.lint.useK2Uast"] = false |
| } |
| |
| androidx { |
| name = "Lifecycle Runtime" |
| type = LibraryType.PUBLISHED_LIBRARY |
| inceptionYear = "2017" |
| description = "Android Lifecycle Runtime" |
| } |