blob: 5b52fa17a363acd8297fd0c24e6bea524b40b372 [file] [log] [blame]
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* 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.SoftwareType
import androidx.build.PlatformIdentifier
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.konan.target.Family
plugins {
id("AndroidXPlugin")
}
androidXMultiplatform {
mac()
linux()
ios()
watchos()
tvos()
js()
wasmJs()
mingwX64()
desktop()
androidLibrary {
namespace = "androidx.paging.common"
}
defaultPlatform(PlatformIdentifier.ANDROID)
sourceSets {
commonMain {
dependencies {
api(libs.kotlinStdlib)
api(libs.kotlinCoroutinesCore)
api("androidx.annotation:annotation:1.9.1")
}
}
commonTest {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
implementation(project(":kruth:kruth"))
implementation(project(":internal-testutils-paging"))
implementation(libs.kotlinTest)
}
}
commonJvmAndroidMain {
dependsOn(commonMain)
dependencies {
api("androidx.arch.core:core-common:2.2.0")
}
}
commonJvmAndroidTest {
dependsOn(commonTest)
dependencies {
implementation(libs.junit)
implementation(libs.mockitoCore)
implementation(libs.mockitoKotlin)
implementation(project(":internal-testutils-common"))
implementation(project(":internal-testutils-ktx"))
}
}
jvmMain {
dependsOn(commonJvmAndroidMain)
}
jvmTest {
dependsOn(commonJvmAndroidTest)
}
androidMain {
dependsOn(commonJvmAndroidMain)
}
androidInstrumentedTest {
dependsOn(commonJvmAndroidTest)
dependencies {
implementation(libs.testRunner)
implementation(libs.mockitoAndroid5)
}
}
nonJvmMain {
dependsOn(commonMain)
dependencies {
implementation(libs.atomicFu)
}
}
nativeMain {
dependsOn(nonJvmMain)
}
unixMain {
dependsOn(nativeMain)
}
darwinMain {
dependsOn(unixMain)
}
linuxMain {
dependsOn(unixMain)
}
mingwMain {
dependsOn(nativeMain)
}
webMain {
dependsOn(nonJvmMain)
}
webTest {
dependsOn(commonTest)
}
desktopMain {
dependsOn(jvmMain)
}
desktopTest {
dependsOn(jvmTest)
}
targets.configureEach { target ->
if (target.platformType == KotlinPlatformType.native) {
target.compilations["main"].defaultSourceSet {
if (target.konanTarget.family.appleFamily) {
dependsOn(darwinMain)
} else if (target.konanTarget.family == Family.LINUX) {
dependsOn(linuxMain)
} else if (target.konanTarget.family == Family.MINGW) {
dependsOn(mingwMain)
} else {
throw new GradleException("unknown native target ${target}")
}
}
} else if (target.platformType in [KotlinPlatformType.js, KotlinPlatformType.wasm]) {
target.compilations["main"].defaultSourceSet.dependsOn(webMain)
target.compilations["test"].defaultSourceSet.dependsOn(webTest)
}
}
}
}
androidx {
name = "Paging-Common"
type = SoftwareType.PUBLISHED_LIBRARY
inceptionYear = "2017"
description = "Android Paging-Common"
legacyDisableKotlinStrictApiMode = true
samples(project(":paging:paging-samples"))
}