1/* 2 * Copyright 2021 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 */ 24import androidx.build.SoftwareType 25import androidx.build.PlatformIdentifier 26 27plugins { 28 id("AndroidXPlugin") 29 id("AndroidXComposePlugin") 30} 31 32androidXMultiplatform { 33 androidLibrary { 34 namespace = "androidx.compose.ui.tooling.preview" 35 withAndroidTestOnDeviceBuilder { 36 it.compilationName = "instrumentedTest" 37 it.defaultSourceSetName = "androidInstrumentedTest" 38 it.sourceSetTreeName = "test" 39 } 40 withAndroidTestOnJvmBuilder { 41 it.defaultSourceSetName = "androidUnitTest" 42 } 43 } 44 jvmStubs() 45 46 defaultPlatform(PlatformIdentifier.ANDROID) 47 48 sourceSets { 49 commonMain { 50 dependencies { 51 implementation(libs.kotlinStdlibCommon) 52 api(project(":compose:runtime:runtime")) 53 } 54 } 55 56 commonTest { 57 dependencies { 58 } 59 } 60 61 jvmMain { 62 dependsOn(commonMain) 63 dependencies { 64 } 65 } 66 67 androidMain { 68 dependsOn(jvmMain) 69 dependencies { 70 api("androidx.annotation:annotation:1.8.1") 71 } 72 } 73 74 jvmStubsMain { 75 dependsOn(jvmMain) 76 dependencies { 77 } 78 } 79 80 androidInstrumentedTest { 81 dependsOn(commonTest) 82 dependencies { 83 } 84 } 85 86 androidUnitTest { 87 dependsOn(commonTest) 88 dependencies { 89 implementation(libs.junit) 90 } 91 } 92 } 93} 94 95androidx { 96 name = "Compose UI Preview Tooling" 97 type = SoftwareType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS 98 inceptionYear = "2021" 99 description = "Compose tooling library API. This library provides the API required to declare" + 100 " @Preview composables in user apps." 101 legacyDisableKotlinStrictApiMode = true 102} 103 104