Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 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 | import androidx.build.AndroidXComposePlugin |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 18 | import androidx.build.LibraryType |
| 19 | import androidx.build.Publish |
Adam Powell | 289a76f | 2022-06-01 14:53:23 -0700 | [diff] [blame] | 20 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 21 | |
| 22 | plugins { |
| 23 | id("AndroidXPlugin") |
| 24 | id("com.android.library") |
| 25 | id("AndroidXComposePlugin") |
| 26 | } |
| 27 | |
| 28 | AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project) |
| 29 | |
| 30 | dependencies { |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 31 | |
| 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 Anthony | 97bdd18 | 2022-10-04 14:26:07 -0400 | [diff] [blame^] | 38 | 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 Anthony | 7128504 | 2022-08-10 11:02:24 -0400 | [diff] [blame] | 41 | implementation("androidx.window:window:1.0.0") |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 42 | |
| 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-Freilich | 8c061d1 | 2022-03-28 21:34:50 +0100 | [diff] [blame] | 52 | |
Louis Pullen-Freilich | ee47bad | 2022-04-06 19:04:17 +0100 | [diff] [blame] | 53 | samples(project(":compose:material3:material3-window-size-class:material3-window-size-class-samples")) |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 54 | } |
| 55 | } |
| 56 | |
| 57 | if(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 Anthony | 7128504 | 2022-08-10 11:02:24 -0400 | [diff] [blame] | 79 | implementation("androidx.window:window:1.0.0") |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 80 | } |
| 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-Freilich | 8c061d1 | 2022-03-28 21:34:50 +0100 | [diff] [blame] | 100 | dependencies { |
Louis Pullen-Freilich | ee47bad | 2022-04-06 19:04:17 +0100 | [diff] [blame] | 101 | samples(project(":compose:material3:material3-window-size-class:material3-window-size-class-samples")) |
Louis Pullen-Freilich | 8c061d1 | 2022-03-28 21:34:50 +0100 | [diff] [blame] | 102 | } |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | androidx { |
Louis Pullen-Freilich | ee47bad | 2022-04-06 19:04:17 +0100 | [diff] [blame] | 106 | name = "Compose Material 3 Window Size Class" |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 107 | type = LibraryType.PUBLISHED_LIBRARY |
Louis Pullen-Freilich | ee47bad | 2022-04-06 19:04:17 +0100 | [diff] [blame] | 108 | mavenGroup = LibraryGroups.COMPOSE_MATERIAL3 |
Anastasia Soboleva | bdfe767 | 2021-11-16 11:24:08 +0000 | [diff] [blame] | 109 | inceptionYear = "2022" |
Louis Pullen-Freilich | ee47bad | 2022-04-06 19:04:17 +0100 | [diff] [blame] | 110 | description = "Provides window size classes for building responsive UIs" |
Aurimas Liutikas | dcfa035 | 2022-03-14 16:05:33 -0700 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | android { |
Louis Pullen-Freilich | ee47bad | 2022-04-06 19:04:17 +0100 | [diff] [blame] | 114 | namespace "androidx.compose.material3.windowsizeclass" |
Adam Powell | 289a76f | 2022-06-01 14:53:23 -0700 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | tasks.withType(KotlinCompile).configureEach { |
| 118 | kotlinOptions { |
| 119 | freeCompilerArgs += [ |
| 120 | "-Xjvm-default=all", |
| 121 | ] |
| 122 | } |
| 123 | } |