| /** |
| * 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.PlatformIdentifier |
| import androidx.build.Publish |
| import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode |
| import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
| |
| plugins { |
| id("AndroidXPlugin") |
| id("com.android.library") |
| } |
| androidXMultiplatform { |
| android() |
| desktop() |
| mac() |
| linux() |
| ios() |
| |
| kotlin { |
| explicitApi = ExplicitApiMode.Strict |
| } |
| |
| defaultPlatform(PlatformIdentifier.ANDROID) |
| |
| sourceSets { |
| commonMain { |
| dependencies { |
| api(libs.kotlinStdlib) |
| api(project(":lifecycle:lifecycle-common")) |
| api(project(":annotation:annotation")) |
| } |
| } |
| |
| commonTest { |
| dependencies { |
| implementation(libs.kotlinCoroutinesTest) |
| implementation(libs.kotlinTest) |
| implementation(project(":kruth:kruth")) |
| } |
| } |
| |
| jvmMain { |
| dependsOn(commonMain) |
| dependencies { |
| api("androidx.arch.core:core-common:2.2.0") |
| } |
| } |
| |
| desktopMain { |
| dependsOn(jvmMain) |
| } |
| |
| androidMain { |
| dependsOn(jvmMain) |
| dependencies { |
| api(libs.kotlinCoroutinesAndroid) |
| implementation("androidx.arch.core:core-runtime:2.2.0") |
| implementation("androidx.profileinstaller:profileinstaller:1.3.1") |
| } |
| } |
| |
| androidUnitTest { |
| dependsOn(commonTest) |
| dependencies { |
| implementation(libs.junit) |
| implementation(libs.mockitoCore4) |
| } |
| } |
| |
| androidInstrumentedTest { |
| dependsOn(commonTest) |
| dependencies { |
| implementation(libs.junit) |
| implementation(libs.truth) |
| implementation(libs.testExtJunit) |
| implementation(libs.testCore) |
| implementation(libs.testRunner) |
| implementation(libs.kotlinCoroutinesTest) |
| } |
| } |
| |
| nonJvmMain { |
| dependsOn(commonMain) |
| } |
| |
| nativeMain { |
| dependsOn(nonJvmMain) |
| |
| // Required for WeakReference usage |
| languageSettings.optIn("kotlin.experimental.ExperimentalNativeApi") |
| } |
| |
| nativeTest { |
| dependsOn(commonTest) |
| } |
| |
| targets.all { 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 { |
| lintPublish(project(":lifecycle:lifecycle-runtime-lint")) |
| } |
| |
| android { |
| buildTypes.all { |
| 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" |
| } |
| |
| androidx { |
| name = "Lifecycle Runtime" |
| publish = Publish.SNAPSHOT_AND_RELEASE |
| inceptionYear "2017" |
| description "Android Lifecycle Runtime" |
| metalavaK2UastEnabled = true |
| } |