blob: 5f1fc46b367442493f6e2a04c20c9ca425f60cb3 [file] [log] [blame]
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +00001/*
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
17import androidx.build.AndroidXComposePlugin
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +000018import androidx.build.LibraryType
19import androidx.build.Publish
Adam Powell289a76f2022-06-01 14:53:23 -070020import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +000021
22plugins {
23 id("AndroidXPlugin")
24 id("com.android.library")
25 id("AndroidXComposePlugin")
26}
27
28AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project)
29
30dependencies {
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +000031
32 if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) {
33 /*
34 * When updating dependencies, make sure to make the an an analogous update in the
35 * corresponding block below
36 */
37 implementation(libs.kotlinStdlibCommon)
Nick Anthony97bdd182022-10-04 14:26:07 -040038 api("androidx.compose.runtime:runtime:1.2.1")
39 api("androidx.compose.ui:ui:1.2.1")
40 api("androidx.compose.ui:ui-unit:1.2.1")
Nick Anthony71285042022-08-10 11:02:24 -040041 implementation("androidx.window:window:1.0.0")
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +000042
43 testImplementation(libs.kotlinTest)
44 testImplementation(libs.truth)
45
46 androidTestImplementation(project(":compose:test-utils"))
47 androidTestImplementation(project(":compose:foundation:foundation"))
48 androidTestImplementation(libs.testRules)
49 androidTestImplementation(libs.testRunner)
50 androidTestImplementation(libs.junit)
51 androidTestImplementation(libs.truth)
Louis Pullen-Freilich8c061d12022-03-28 21:34:50 +010052
Louis Pullen-Freilichee47bad2022-04-06 19:04:17 +010053 samples(project(":compose:material3:material3-window-size-class:material3-window-size-class-samples"))
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +000054 }
55}
56
57if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
58 kotlin {
59 android()
60 jvm("desktop")
61
62 /*
63 * When updating dependencies, make sure to make the an an analogous update in the
64 * corresponding block above
65 */
66 sourceSets {
67 commonMain.dependencies {
68 implementation(libs.kotlinStdlibCommon)
69 api(project(":compose:runtime:runtime"))
70 api(project(":compose:ui:ui"))
71 api(project(":compose:ui:ui-unit"))
72 }
73
74 jvmMain.dependencies {
75 implementation(libs.kotlinStdlib)
76 }
77
78 androidMain.dependencies {
Nick Anthony71285042022-08-10 11:02:24 -040079 implementation("androidx.window:window:1.0.0")
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +000080 }
81
82 androidMain.dependsOn(jvmMain)
83 desktopMain.dependsOn(jvmMain)
84
85 androidTest.dependencies {
86 implementation(libs.kotlinTest)
87 implementation(libs.truth)
88 }
89
90 androidAndroidTest.dependencies {
91 implementation(project(":compose:test-utils"))
92 implementation(project(":compose:foundation:foundation"))
93 implementation(libs.testRules)
94 implementation(libs.testRunner)
95 implementation(libs.junit)
96 implementation(libs.truth)
97 }
98 }
99 }
Louis Pullen-Freilich8c061d12022-03-28 21:34:50 +0100100 dependencies {
Louis Pullen-Freilichee47bad2022-04-06 19:04:17 +0100101 samples(project(":compose:material3:material3-window-size-class:material3-window-size-class-samples"))
Louis Pullen-Freilich8c061d12022-03-28 21:34:50 +0100102 }
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +0000103}
104
105androidx {
Louis Pullen-Freilichee47bad2022-04-06 19:04:17 +0100106 name = "Compose Material 3 Window Size Class"
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +0000107 type = LibraryType.PUBLISHED_LIBRARY
Louis Pullen-Freilichee47bad2022-04-06 19:04:17 +0100108 mavenGroup = LibraryGroups.COMPOSE_MATERIAL3
Anastasia Sobolevabdfe7672021-11-16 11:24:08 +0000109 inceptionYear = "2022"
Louis Pullen-Freilichee47bad2022-04-06 19:04:17 +0100110 description = "Provides window size classes for building responsive UIs"
Aurimas Liutikasdcfa0352022-03-14 16:05:33 -0700111}
112
113android {
Louis Pullen-Freilichee47bad2022-04-06 19:04:17 +0100114 namespace "androidx.compose.material3.windowsizeclass"
Adam Powell289a76f2022-06-01 14:53:23 -0700115}
116
117tasks.withType(KotlinCompile).configureEach {
118 kotlinOptions {
119 freeCompilerArgs += [
120 "-Xjvm-default=all",
121 ]
122 }
123}