blob: 6f9b832f7ea8d6e7f93bf013cbe4892e09c1a13f [file] [log] [blame]
/*
* Copyright (C) 2020 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.
*/
import androidx.build.LibraryType
import androidx.build.PlatformIdentifier
plugins {
id("AndroidXPlugin")
id("com.android.library")
}
android {
namespace "androidx.datastore.datastore"
}
androidXMultiplatform {
jvm()
mac()
ios()
linux()
android()
defaultPlatform(PlatformIdentifier.ANDROID)
sourceSets {
commonMain {
dependencies {
api(libs.kotlinStdlib)
api(libs.kotlinCoroutinesCore)
api("androidx.annotation:annotation:1.2.0")
api(project(":datastore:datastore-core"))
api(project(":datastore:datastore-core-okio"))
}
}
commonTest {
dependencies {
implementation(libs.kotlinTestCommon)
implementation(libs.kotlinTestAnnotationsCommon)
implementation(libs.kotlinCoroutinesTest)
implementation(libs.okio)
api(project(":datastore:datastore-core"))
api(project(":datastore:datastore-core-okio"))
implementation(project(":kruth:kruth"))
implementation(project(":internal-testutils-datastore"))
}
}
jvmMain {
dependsOn(commonMain)
}
jvmTest {
dependsOn(commonTest)
dependencies {
implementation(libs.kotlinTest)
implementation(project(":kruth:kruth"))
implementation(project(":internal-testutils-datastore"))
}
}
androidMain {
dependsOn(jvmMain)
dependencies {
implementation(libs.okio)
}
}
androidAndroidTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.junit)
implementation(libs.truth)
implementation(project(":internal-testutils-truth"))
implementation(project(":kruth:kruth"))
implementation(project(":internal-testutils-datastore"))
implementation(libs.kotlinCoroutinesTest)
implementation(libs.testRunner)
implementation(libs.testCore)
}
}
targets.all { target ->
if (target.platformType == org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.native) {
target.compilations["main"].defaultSourceSet {
dependsOn(nativeMain)
}
target.compilations["test"].defaultSourceSet {
dependsOn(nativeTest)
}
}
}
}
}
androidx {
name = "DataStore"
type = LibraryType.PUBLISHED_LIBRARY
inceptionYear = "2020"
description = "Android DataStore - contains the underlying store used by each serialization " +
"method along with components that require an Android dependency"
legacyDisableKotlinStrictApiMode = true
}