| Dustin Lam | 73f0b5a | 2021-05-21 14:31:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 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 | */ |
| Aurimas Liutikas | b3483fd | 2021-06-04 16:56:37 -0700 | [diff] [blame] | 16 | |
| Daniel Santiago Rivera | 6e1e6e1 | 2024-12-16 22:13:20 -0500 | [diff] [blame] | 17 | |
| 18 | import androidx.build.KotlinTarget |
| elifbilgin | e7a8b7c | 2024-07-01 08:00:23 -0700 | [diff] [blame] | 19 | import androidx.build.PlatformIdentifier |
| Aurimas Liutikas | 37e8321 | 2025-01-23 13:26:10 -0800 | [diff] [blame] | 20 | import androidx.build.SoftwareType |
| elifbilgin | cf0073f | 2024-07-09 06:09:59 -0700 | [diff] [blame] | 21 | import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
| Dustin Lam | 73f0b5a | 2021-05-21 14:31:38 -0700 | [diff] [blame] | 22 | |
| 23 | plugins { |
| 24 | id("AndroidXPlugin") |
| Clara Fok | c96fe7d | 2022-06-09 14:42:40 -0700 | [diff] [blame] | 25 | id("com.google.devtools.ksp") |
| elifbilgin | e7a8b7c | 2024-07-01 08:00:23 -0700 | [diff] [blame] | 26 | id("com.android.library") |
| 27 | } |
| 28 | |
| 29 | androidXMultiplatform { |
| Aurimas Liutikas | 03fa9fb | 2025-02-06 11:17:13 -0800 | [diff] [blame] | 30 | androidTarget() |
| elifbilgin | e7a8b7c | 2024-07-01 08:00:23 -0700 | [diff] [blame] | 31 | jvm() |
| 32 | mac() |
| 33 | linux() |
| 34 | ios() |
| 35 | |
| 36 | defaultPlatform(PlatformIdentifier.ANDROID) |
| 37 | |
| 38 | sourceSets { |
| 39 | commonMain { |
| 40 | dependencies { |
| 41 | api(libs.kotlinStdlib) |
| Prajakta Patil | aa38ca3 | 2024-08-02 18:59:43 +0000 | [diff] [blame] | 42 | api("androidx.paging:paging-common:3.3.2") |
| elifbilgin | e7a8b7c | 2024-07-01 08:00:23 -0700 | [diff] [blame] | 43 | api(project(":room:room-runtime")) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | commonTest { |
| 48 | dependencies { |
| 49 | implementation(libs.kotlinCoroutinesTest) |
| 50 | implementation(project(":kruth:kruth")) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | androidMain { |
| 55 | dependsOn(commonMain) |
| 56 | } |
| 57 | |
| elifbilgin | cf0073f | 2024-07-09 06:09:59 -0700 | [diff] [blame] | 58 | jvmNativeMain { |
| 59 | dependsOn(commonMain) |
| 60 | } |
| 61 | |
| 62 | jvmMain { |
| 63 | dependsOn(jvmNativeMain) |
| 64 | } |
| 65 | |
| 66 | nativeMain { |
| 67 | dependsOn(jvmNativeMain) |
| Daniel Santiago Rivera | 62aa237 | 2025-01-15 10:57:16 -0500 | [diff] [blame] | 68 | dependencies { |
| 69 | implementation(libs.atomicFu) |
| 70 | } |
| elifbilgin | cf0073f | 2024-07-09 06:09:59 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| elifbilgin | e7a8b7c | 2024-07-01 08:00:23 -0700 | [diff] [blame] | 73 | androidInstrumentedTest { |
| 74 | dependsOn(commonTest) |
| 75 | dependencies { |
| 76 | implementation(libs.junit) |
| 77 | implementation(project(":internal-testutils-common")) |
| 78 | implementation(libs.kotlinTestJunit) |
| 79 | implementation(libs.testExtJunit) |
| 80 | implementation(libs.testCore) |
| 81 | implementation(libs.testRunner) |
| 82 | implementation("androidx.arch.core:core-testing:2.2.0") |
| Prajakta Patil | aa38ca3 | 2024-08-02 18:59:43 +0000 | [diff] [blame] | 83 | implementation("androidx.paging:paging-testing:3.3.2") |
| elifbilgin | e7a8b7c | 2024-07-01 08:00:23 -0700 | [diff] [blame] | 84 | } |
| 85 | } |
| elifbilgin | cf0073f | 2024-07-09 06:09:59 -0700 | [diff] [blame] | 86 | targets.configureEach { target -> |
| 87 | if (target.platformType == KotlinPlatformType.native) { |
| 88 | target.compilations["main"].defaultSourceSet { |
| 89 | dependsOn(nativeMain) |
| 90 | } |
| 91 | } |
| 92 | } |
| elifbilgin | e7a8b7c | 2024-07-01 08:00:23 -0700 | [diff] [blame] | 93 | } |
| Clara Fok | 2c9450d | 2021-06-15 16:30:09 -0700 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | android { |
| Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 97 | namespace = "androidx.room.paging" |
| Dustin Lam | 73f0b5a | 2021-05-21 14:31:38 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | dependencies { |
| elifbilgin | e7a8b7c | 2024-07-01 08:00:23 -0700 | [diff] [blame] | 101 | add("kspAndroidAndroidTest", project(":room:room-compiler")) |
| Clara Fok | 2c9450d | 2021-06-15 16:30:09 -0700 | [diff] [blame] | 102 | } |
| 103 | |
| Dustin Lam | 73f0b5a | 2021-05-21 14:31:38 -0700 | [diff] [blame] | 104 | androidx { |
| 105 | name = "Room Paging" |
| Aurimas Liutikas | 37e8321 | 2025-01-23 13:26:10 -0800 | [diff] [blame] | 106 | type = SoftwareType.PUBLISHED_LIBRARY |
| Dustin Lam | 73f0b5a | 2021-05-21 14:31:38 -0700 | [diff] [blame] | 107 | inceptionYear = "2021" |
| 108 | description = "Room Paging integration" |
| Daniel Santiago Rivera | 6e1e6e1 | 2024-12-16 22:13:20 -0500 | [diff] [blame] | 109 | kotlinTarget = KotlinTarget.KOTLIN_2_0 |
| 110 | } |
| 111 | |