1/* 2 * Copyright (C) 2016 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 js() 35 jvm() 36 mac() 37 linux() 38 ios() 39 wasmJs() 40 41 defaultPlatform(PlatformIdentifier.JVM) 42 43 sourceSets { 44 commonMain { 45 dependencies { 46 api(libs.kotlinStdlib) 47 api("androidx.annotation:annotation:1.9.1") 48 } 49 } 50 51 commonTest { 52 dependencies { 53 implementation(project(":kruth:kruth")) 54 // https://youtrack.jetbrains.com/issue/KT-71032 55 implementation(libs.kotlinTestForWasmTests) 56 } 57 } 58 59 jvmMain { 60 dependsOn(commonMain) 61 } 62 63 jvmTest { 64 dependsOn(commonTest) 65 dependencies { 66 implementation(libs.guava) 67 implementation(libs.kotlinTestJunit) 68 } 69 } 70 71 nativeMain { 72 dependsOn(commonMain) 73 } 74 75 jsMain { 76 dependsOn(commonMain) 77 dependencies { 78 implementation(libs.kotlinStdlibJs) 79 } 80 } 81 82 wasmJsMain { 83 dependsOn(commonMain) 84 dependencies { 85 implementation(libs.kotlinStdlibWasm) 86 } 87 } 88 89 targets.configureEach { target -> 90 if (target.platformType == KotlinPlatformType.native) { 91 target.compilations["main"].defaultSourceSet { 92 dependsOn(nativeMain) 93 } 94 } 95 } 96 } 97} 98 99androidx { 100 name = "Room-Common" 101 type = SoftwareType.PUBLISHED_LIBRARY 102 inceptionYear = "2017" 103 description = "Android Room-Common" 104 legacyDisableKotlinStrictApiMode = true 105} 106