Chris Craik | 9fd8e617 | 2017-06-23 14:07:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | |
Tiem Song | ee0da74 | 2024-01-03 14:08:46 -0800 | [diff] [blame] | 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 | */ |
Fred Sladkey | d5f3dd3 | 2024-01-23 13:50:51 -0500 | [diff] [blame] | 24 | |
Omar Ismail | 86e6606 | 2024-05-03 16:10:50 +0100 | [diff] [blame] | 25 | import androidx.build.LibraryType |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 26 | import androidx.build.PlatformIdentifier |
| 27 | import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
Yigit Boyar | 358dfe6 | 2023-07-06 09:04:03 -0700 | [diff] [blame] | 28 | import org.jetbrains.kotlin.konan.target.Family |
| 29 | |
Chris Craik | 9fd8e617 | 2017-06-23 14:07:04 -0700 | [diff] [blame] | 30 | |
Aurimas Liutikas | f8b708a | 2017-11-02 16:07:13 -0700 | [diff] [blame] | 31 | plugins { |
Aurimas Liutikas | 2cc275f | 2019-04-04 19:33:53 +0100 | [diff] [blame] | 32 | id("AndroidXPlugin") |
Clara Fok | 8ca12ff | 2023-07-05 17:24:35 -0700 | [diff] [blame] | 33 | id("com.android.library") |
Aurimas Liutikas | f8b708a | 2017-11-02 16:07:13 -0700 | [diff] [blame] | 34 | } |
Aurimas Liutikas | bb85fac | 2017-08-24 13:32:28 -0700 | [diff] [blame] | 35 | |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 36 | androidXMultiplatform { |
| 37 | jvm() |
| 38 | mac() |
| 39 | linux() |
| 40 | ios() |
Clara Fok | 8ca12ff | 2023-07-05 17:24:35 -0700 | [diff] [blame] | 41 | android() |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 42 | |
| 43 | defaultPlatform(PlatformIdentifier.JVM) |
| 44 | |
| 45 | sourceSets { |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 46 | commonMain { |
| 47 | dependencies { |
| 48 | api(libs.kotlinStdlib) |
| 49 | api(libs.kotlinCoroutinesCore) |
Prajakta Patil | c42933f | 2024-05-01 23:05:50 +0000 | [diff] [blame] | 50 | api("androidx.annotation:annotation:1.8.0") |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 51 | } |
| 52 | } |
| 53 | |
Clara Fok | 5f18ef3 | 2023-07-07 19:10:23 -0700 | [diff] [blame] | 54 | commonJvmAndroidMain { |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 55 | dependsOn(commonMain) |
Clara Fok | 5f18ef3 | 2023-07-07 19:10:23 -0700 | [diff] [blame] | 56 | |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 57 | dependencies { |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 58 | api("androidx.arch.core:core-common:2.2.0") |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 59 | } |
| 60 | } |
| 61 | |
Clara Fok | 5f18ef3 | 2023-07-07 19:10:23 -0700 | [diff] [blame] | 62 | jvmMain { |
| 63 | dependsOn(commonJvmAndroidMain) |
| 64 | } |
| 65 | |
Clara Fok | 8ca12ff | 2023-07-05 17:24:35 -0700 | [diff] [blame] | 66 | androidMain { |
Clara Fok | 5f18ef3 | 2023-07-07 19:10:23 -0700 | [diff] [blame] | 67 | dependsOn(commonJvmAndroidMain) |
Clara Fok | 8ca12ff | 2023-07-05 17:24:35 -0700 | [diff] [blame] | 68 | } |
| 69 | |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 70 | commonTest { |
| 71 | dependencies { |
| 72 | implementation(libs.kotlinCoroutinesTest) |
Veyndan Stuart | 8720761 | 2023-06-28 22:56:10 +0000 | [diff] [blame] | 73 | implementation(libs.kotlinTest) |
Dustin Lam | 14495fa | 2023-07-05 17:32:26 -0700 | [diff] [blame] | 74 | implementation(project(":kruth:kruth")) |
Veyndan Stuart | 89b052d | 2023-07-04 21:22:48 +0000 | [diff] [blame] | 75 | implementation(project(":internal-testutils-paging")) |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 76 | } |
| 77 | } |
| 78 | |
Clara Fok | 5f18ef3 | 2023-07-07 19:10:23 -0700 | [diff] [blame] | 79 | commonJvmAndroidTest { |
Clara Fok | 12c3293 | 2023-07-10 17:26:25 -0700 | [diff] [blame] | 80 | dependsOn(commonTest) |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 81 | dependencies { |
| 82 | implementation(libs.junit) |
Fred Sladkey | a788bdd | 2023-09-13 20:06:47 +0000 | [diff] [blame] | 83 | implementation(libs.mockitoCore) |
| 84 | implementation(libs.mockitoKotlin) |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 85 | implementation(project(":internal-testutils-common")) |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 86 | implementation(project(":internal-testutils-ktx")) |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 87 | } |
| 88 | } |
| 89 | |
Clara Fok | 5f18ef3 | 2023-07-07 19:10:23 -0700 | [diff] [blame] | 90 | jvmTest { |
| 91 | dependsOn(commonJvmAndroidTest) |
| 92 | } |
| 93 | |
Fred Sladkey | d2ea9cf | 2023-08-17 21:19:01 -0400 | [diff] [blame] | 94 | androidInstrumentedTest { |
Clara Fok | 5f18ef3 | 2023-07-07 19:10:23 -0700 | [diff] [blame] | 95 | dependsOn(commonJvmAndroidTest) |
Clara Fok | 12c3293 | 2023-07-10 17:26:25 -0700 | [diff] [blame] | 96 | dependencies { |
| 97 | implementation(libs.testRunner) |
Clara Fok | e86ad8ca | 2023-12-06 14:16:05 -0800 | [diff] [blame] | 98 | implementation(libs.mockitoAndroid5) |
Dustin Lam | 84bdfb4 | 2023-09-12 09:15:29 -0700 | [diff] [blame] | 99 | implementation(libs.multidex) |
Clara Fok | 12c3293 | 2023-07-10 17:26:25 -0700 | [diff] [blame] | 100 | } |
Clara Fok | 8ca12ff | 2023-07-05 17:24:35 -0700 | [diff] [blame] | 101 | } |
| 102 | |
Fred Sladkey | d5f3dd3 | 2024-01-23 13:50:51 -0500 | [diff] [blame] | 103 | nativeMain { |
| 104 | dependsOn(commonMain) |
| 105 | dependencies { |
| 106 | implementation(libs.atomicFu) |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 107 | } |
| 108 | } |
Fred Sladkey | d5f3dd3 | 2024-01-23 13:50:51 -0500 | [diff] [blame] | 109 | nativeTest { |
| 110 | dependsOn(commonTest) |
Yigit Boyar | 358dfe6 | 2023-07-06 09:04:03 -0700 | [diff] [blame] | 111 | } |
| 112 | |
Fred Sladkey | d5f3dd3 | 2024-01-23 13:50:51 -0500 | [diff] [blame] | 113 | darwinMain { |
| 114 | dependsOn(nativeMain) |
| 115 | } |
| 116 | |
| 117 | linuxMain { |
| 118 | dependsOn(nativeMain) |
Yigit Boyar | 358dfe6 | 2023-07-06 09:04:03 -0700 | [diff] [blame] | 119 | } |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 120 | |
Omar Ismail | ce79d6f | 2024-05-14 16:05:13 +0100 | [diff] [blame] | 121 | targets.configureEach { target -> |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 122 | if (target.platformType == KotlinPlatformType.native) { |
| 123 | target.compilations["main"].defaultSourceSet { |
Yigit Boyar | 358dfe6 | 2023-07-06 09:04:03 -0700 | [diff] [blame] | 124 | def konanTargetFamily = target.konanTarget.family |
| 125 | if (konanTargetFamily == Family.OSX || konanTargetFamily == Family.IOS) { |
| 126 | dependsOn(darwinMain) |
| 127 | } else if (konanTargetFamily == Family.LINUX) { |
| 128 | dependsOn(linuxMain) |
| 129 | } else { |
| 130 | throw new GradleException("unknown native target ${target}") |
| 131 | } |
Clara Fok | fe2df43 | 2023-06-23 15:00:32 -0700 | [diff] [blame] | 132 | } |
| 133 | target.compilations["test"].defaultSourceSet { |
| 134 | dependsOn(nativeTest) |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
Aurimas Liutikas | 2ad3161 | 2019-04-01 04:23:03 -0700 | [diff] [blame] | 141 | androidx { |
Alan Viverette | c9e1fd7 | 2023-05-08 17:36:59 -0400 | [diff] [blame] | 142 | name = "Paging-Common" |
Omar Ismail | 86e6606 | 2024-05-03 16:10:50 +0100 | [diff] [blame] | 143 | type = LibraryType.PUBLISHED_LIBRARY |
Aurimas Liutikas | ea5ee82 | 2017-11-06 12:52:28 -0800 | [diff] [blame] | 144 | inceptionYear = "2017" |
| 145 | description = "Android Paging-Common" |
Aurimas Liutikas | 5c5419a | 2024-05-29 15:26:58 -0700 | [diff] [blame^] | 146 | legacyDisableKotlinStrictApiMode = true |
Owen Gray | 96be208 | 2023-12-04 10:46:10 -0500 | [diff] [blame] | 147 | samples(project(":paging:paging-samples")) |
Chris Craik | 368e82c | 2018-02-12 16:40:12 -0800 | [diff] [blame] | 148 | } |
Clara Fok | 8ca12ff | 2023-07-05 17:24:35 -0700 | [diff] [blame] | 149 | |
| 150 | android { |
| 151 | namespace "androidx.paging.common" |
Arkadii Ivanov | ca693ef | 2023-08-18 15:14:52 +0100 | [diff] [blame] | 152 | |
| 153 | defaultConfig { |
| 154 | multiDexEnabled = true |
| 155 | } |
Clara Fok | 8ca12ff | 2023-07-05 17:24:35 -0700 | [diff] [blame] | 156 | } |