| /* |
| * Copyright (C) 2021 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| import androidx.build.AndroidXComposePlugin |
| import androidx.build.LibraryType |
| import androidx.build.Publish |
| import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
| |
| plugins { |
| id("AndroidXPlugin") |
| id("com.android.library") |
| id("AndroidXComposePlugin") |
| } |
| |
| AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project) |
| |
| dependencies { |
| |
| |
| if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) { |
| /* |
| * When updating dependencies, make sure to make the an an analogous update in the |
| * corresponding block below |
| */ |
| implementation(libs.kotlinStdlibCommon) |
| implementation("androidx.compose.animation:animation-core:1.3.1") |
| implementation("androidx.compose.foundation:foundation-layout:1.3.1") |
| implementation("androidx.compose.ui:ui-util:1.3.1") |
| api(project(":compose:foundation:foundation")) |
| api("androidx.compose.material:material-icons-core:1.3.1") |
| api("androidx.compose.material:material-ripple:1.3.1") |
| api("androidx.compose.runtime:runtime:1.3.1") |
| api("androidx.compose.ui:ui-graphics:1.3.1") |
| api("androidx.compose.ui:ui:1.3.1") |
| api("androidx.compose.ui:ui-text:1.3.1") |
| |
| // TODO: remove next 3 dependencies when b/202810604 is fixed |
| implementation("androidx.savedstate:savedstate-ktx:1.2.0") |
| implementation("androidx.lifecycle:lifecycle-runtime:2.5.1") |
| implementation("androidx.lifecycle:lifecycle-viewmodel:2.5.1") |
| |
| testImplementation(libs.testRules) |
| testImplementation(libs.testRunner) |
| testImplementation(libs.junit) |
| testImplementation(libs.truth) |
| |
| androidTestImplementation(project(":compose:material3:material3:material3-samples")) |
| androidTestImplementation(project(":compose:foundation:foundation-layout")) |
| androidTestImplementation(project(":compose:test-utils")) |
| androidTestImplementation(project(":test:screenshot:screenshot")) |
| androidTestImplementation(project(":core:core")) |
| androidTestImplementation(libs.testRules) |
| androidTestImplementation(libs.testRunner) |
| androidTestImplementation(libs.junit) |
| androidTestImplementation(libs.truth) |
| androidTestImplementation(libs.dexmakerMockito) |
| androidTestImplementation(libs.mockitoCore) |
| androidTestImplementation(libs.mockitoKotlin) |
| androidTestImplementation(libs.testUiautomator) |
| |
| lintPublish project(":compose:material3:material3-lint") |
| } |
| } |
| |
| if(AndroidXComposePlugin.isMultiplatformEnabled(project)) { |
| androidXComposeMultiplatform { |
| android() |
| desktop() |
| } |
| |
| kotlin { |
| /* |
| * When updating dependencies, make sure to make the an an analogous update in the |
| * corresponding block above |
| */ |
| sourceSets { |
| commonMain.dependencies { |
| implementation(libs.kotlinStdlibCommon) |
| implementation(project(":compose:animation:animation-core")) |
| |
| api(project(":compose:foundation:foundation")) |
| api(project(":compose:material:material-icons-core")) |
| api(project(":compose:material:material-ripple")) |
| api(project(":compose:runtime:runtime")) |
| api(project(":compose:ui:ui-graphics")) |
| api(project(":compose:ui:ui-text")) |
| |
| implementation(project(":compose:ui:ui-util")) |
| implementation(project(":compose:foundation:foundation-layout")) |
| } |
| |
| androidMain.dependencies { |
| api("androidx.annotation:annotation:1.1.0") |
| |
| // TODO: remove next 3 dependencies when b/202810604 is fixed |
| implementation("androidx.savedstate:savedstate:1.1.0") |
| implementation("androidx.lifecycle:lifecycle-runtime:2.5.1") |
| implementation("androidx.lifecycle:lifecycle-viewmodel:2.5.1") |
| } |
| |
| desktopMain.dependencies { |
| implementation(libs.kotlinStdlib) |
| } |
| |
| // TODO(b/214407011): These dependencies leak into instrumented tests as well. If you |
| // need to add Robolectric (which must be kept out of androidAndroidTest), use a top |
| // level dependencies block instead: |
| // `dependencies { testImplementation(libs.robolectric) }` |
| androidTest.dependencies { |
| implementation(libs.testRules) |
| implementation(libs.testRunner) |
| implementation(libs.junit) |
| implementation(libs.truth) |
| } |
| |
| androidAndroidTest.dependencies { |
| implementation(project(":compose:material3:material3:material3-samples")) |
| implementation(project(":compose:test-utils")) |
| implementation(project(':compose:foundation:foundation-layout')) |
| implementation(project(":test:screenshot:screenshot")) |
| implementation(project(":core:core")) |
| |
| implementation(libs.testRules) |
| implementation(libs.testRunner) |
| implementation(libs.junit) |
| implementation(libs.truth) |
| implementation(libs.dexmakerMockito) |
| implementation(libs.mockitoCore) |
| implementation(libs.mockitoKotlin) |
| implementation(libs.testUiautomator) |
| } |
| } |
| } |
| } |
| |
| androidx { |
| name = "Compose Material3 Components" |
| type = LibraryType.PUBLISHED_LIBRARY |
| inceptionYear = "2021" |
| description = "Compose Material You Design Components library" |
| } |
| |
| // Screenshot tests related setup |
| android { |
| sourceSets.androidTest.assets.srcDirs += |
| project.rootDir.absolutePath + "/../../golden/compose/material3/material3" |
| namespace "androidx.compose.material3" |
| } |