1/*
2 * Copyright (C) 2020 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
27
28plugins {
29    id("AndroidXPlugin")
30}
31
32androidXMultiplatform {
33    jvm()
34    mac()
35    linux()
36    ios()
37    watchos()
38    tvos()
39    androidLibrary {
40        namespace = "androidx.datastore.preferences"
41        withAndroidTestOnDeviceBuilder {
42            it.compilationName = "instrumentedTest"
43            it.defaultSourceSetName = "androidInstrumentedTest"
44            it.sourceSetTreeName = "test"
45        }
46        withAndroidTestOnJvmBuilder {
47            it.defaultSourceSetName = "androidUnitTest"
48        }
49    }
50
51    defaultPlatform(PlatformIdentifier.ANDROID)
52
53    sourceSets {
54        commonMain {
55            dependencies {
56                api(libs.kotlinStdlib)
57                api(libs.kotlinCoroutinesCore)
58                api(project(":datastore:datastore"))
59                api(project(":datastore:datastore-preferences-core"))
60            }
61        }
62        commonTest {
63            dependencies {
64                implementation(libs.kotlinTestCommon)
65                implementation(libs.kotlinTestAnnotationsCommon)
66                implementation(libs.kotlinCoroutinesTest)
67            }
68        }
69        commonJvmMain {
70            dependsOn(commonMain)
71        }
72        commonJvmTest {
73            dependsOn(commonTest)
74            dependencies {
75                implementation(libs.junit)
76                implementation(libs.kotlinTest)
77            }
78        }
79        jvmMain {
80            dependsOn(commonJvmMain)
81        }
82        jvmTest {
83            dependsOn(commonJvmTest)
84        }
85        androidMain {
86            dependsOn(commonJvmMain)
87        }
88        androidUnitTest {
89            dependsOn(commonJvmTest)
90        }
91        androidInstrumentedTest {
92            dependsOn(commonJvmTest)
93            dependencies {
94                implementation(libs.testRunner)
95                implementation(libs.testCore)
96            }
97        }
98    }
99}
100
101androidx {
102    name = "Preferences DataStore"
103    type = SoftwareType.PUBLISHED_LIBRARY
104    inceptionYear = "2020"
105    description = "Android Preferences DataStore"
106    legacyDisableKotlinStrictApiMode = true
107}
108