1/* 2 * Copyright (C) 2022 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 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 */ 24 25import androidx.build.SoftwareType 26import androidx.build.PlatformIdentifier 27import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType 28 29plugins { 30 id("AndroidXPlugin") 31} 32 33androidXMultiplatform { 34 jvm() 35 mac() 36 linux() 37 ios() 38 watchos() 39 tvos() 40 41 defaultPlatform(PlatformIdentifier.JVM) 42 43 sourceSets { 44 configureEach { 45 languageSettings.optIn("kotlin.RequiresOptIn") 46 } 47 48 commonMain { 49 dependencies { 50 api(project(":datastore:datastore-core")) 51 api(libs.kotlinStdlib) 52 api(libs.kotlinCoroutinesCore) 53 api(libs.okio) 54 } 55 } 56 jvmMain { 57 dependsOn(commonMain) 58 } 59 commonTest { 60 dependencies { 61 api(project(":kruth:kruth")) 62 api(libs.kotlinTestCommon) 63 api(libs.kotlinTestAnnotationsCommon) 64 api(libs.kotlinCoroutinesTest) 65 implementation(project(":internal-testutils-datastore")) 66 } 67 } 68 jvmTest { 69 dependsOn(commonTest) 70 dependencies { 71 implementation(libs.kotlinCoroutinesTest) 72 implementation(libs.kotlinTest) 73 implementation(libs.kotlinTestAnnotationsCommon) 74 implementation(project(":internal-testutils-datastore")) 75 api(project(":kruth:kruth")) 76 } 77 } 78 79 nativeMain { 80 dependsOn(commonMain) 81 dependencies { 82 implementation(libs.atomicFu) 83 } 84 } 85 86 targets.configureEach { target -> 87 if (target.platformType == KotlinPlatformType.native) { 88 target.compilations["main"].defaultSourceSet { 89 dependsOn(nativeMain) 90 } 91 } 92 } 93 } 94} 95 96androidx { 97 name = "DataStore Core Okio" 98 type = SoftwareType.PUBLISHED_LIBRARY 99 inceptionYear = "2020" 100 description = "Android DataStore Core Okio- contains APIs to use datastore-core in multiplatform via okio" 101} 102