1/*
2 * Copyright 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
27
28plugins {
29    id("AndroidXPlugin")
30    id("AndroidXComposePlugin")
31}
32
33androidXMultiplatform {
34    androidLibrary {
35        namespace = "androidx.compose.material3.windowsizeclass"
36        withAndroidTestOnDeviceBuilder {
37            it.compilationName = "instrumentedTest"
38            it.defaultSourceSetName = "androidInstrumentedTest"
39            it.sourceSetTreeName = "test"
40        }
41        withAndroidTestOnJvmBuilder {
42            it.defaultSourceSetName = "androidUnitTest"
43        }
44
45        compileSdk = 35
46        aarMetadata.minCompileSdk = 35
47    }
48    jvmStubs()
49    linuxX64Stubs()
50
51    defaultPlatform(PlatformIdentifier.ANDROID)
52
53    sourceSets {
54        commonMain {
55            dependencies {
56                implementation(libs.kotlinStdlib)
57                implementation("androidx.compose.ui:ui-util:1.7.1")
58                api("androidx.compose.runtime:runtime:1.7.1")
59                api("androidx.compose.ui:ui:1.7.1")
60                api("androidx.compose.ui:ui-unit:1.7.1")
61            }
62        }
63
64        commonTest {
65            dependencies {
66            }
67        }
68
69        jvmMain {
70            dependsOn(commonMain)
71            dependencies {
72            }
73        }
74
75        androidMain {
76            dependsOn(jvmMain)
77            dependencies {
78                api("androidx.annotation:annotation-experimental:1.4.1")
79                implementation("androidx.window:window:1.0.0")
80            }
81        }
82
83        commonStubsMain {
84            dependsOn(commonMain)
85        }
86
87        jvmStubsMain {
88            dependsOn(commonStubsMain)
89        }
90
91        linuxx64StubsMain {
92            dependsOn(commonStubsMain)
93        }
94
95        androidInstrumentedTest {
96            dependsOn(commonTest)
97            dependencies {
98                implementation(project(":compose:test-utils"))
99                implementation("androidx.compose.foundation:foundation:1.6.0")
100                implementation(project(":compose:runtime:runtime"))
101                implementation(libs.testRules)
102                implementation(libs.testRunner)
103                implementation(libs.junit)
104                implementation(libs.truth)
105            }
106        }
107
108        androidUnitTest {
109            dependsOn(commonTest)
110            dependencies {
111                implementation(libs.kotlinTest)
112                implementation(libs.truth)
113            }
114        }
115    }
116}
117
118androidx {
119    name = "Compose Material 3 Window Size Class"
120    type = SoftwareType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS
121    inceptionYear = "2022"
122    description = "Provides window size classes for building responsive UIs"
123    legacyDisableKotlinStrictApiMode = true
124    samples(project(":compose:material3:material3-window-size-class:material3-window-size-class-samples"))
125}
126
127