blob: 75c82c7999dabf09fc40917e68aa1a046ccdbaeb [file] [log] [blame]
/*
* Copyright (C) 2022 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.KmpPlatformsKt
import androidx.build.LibraryType
import androidx.build.PlatformIdentifier
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
id("AndroidXPlugin")
}
def enableNative = KmpPlatformsKt.enableNative(project)
androidXMultiplatform {
jvm()
mac()
linux()
ios()
defaultPlatform(PlatformIdentifier.JVM)
sourceSets {
all {
languageSettings.optIn("kotlin.RequiresOptIn")
}
commonMain {
dependencies {
api(project(":datastore:datastore-core"))
api(libs.kotlinStdlib)
api(libs.kotlinCoroutinesCore)
api(libs.okio)
}
}
jvmMain {
dependencies {
api(libs.kotlinStdlib)
api(libs.kotlinCoroutinesCore)
}
}
commonTest {
dependencies {
api(project(":kruth:kruth"))
api(libs.kotlinTestCommon)
api(libs.kotlinTestAnnotationsCommon)
api(libs.kotlinCoroutinesTest)
api(project(":internal-testutils-datastore"))
api(project(":kruth:kruth"))
}
}
jvmTest {
dependencies {
implementation(libs.kotlinCoroutinesTest)
implementation(libs.kotlinTest)
implementation(libs.kotlinTestAnnotationsCommon)
api(project(":internal-testutils-datastore"))
api(project(":kruth:kruth"))
}
}
if (enableNative) {
nativeMain {
dependencies {
implementation(libs.atomicFu)
}
}
}
targets.all { target ->
if (target.platformType == KotlinPlatformType.native) {
target.compilations["main"].defaultSourceSet {
dependsOn(nativeMain)
}
}
}
}
}
androidx {
name = "DataStore Core Okio"
type = LibraryType.PUBLISHED_LIBRARY
inceptionYear = "2020"
description = "Android DataStore Core Okio- contains APIs to use datastore-core in multiplatform via okio"
}