| /* |
| * 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.KmpPlatformsKt |
| import androidx.build.LibraryType |
| import androidx.build.PlatformIdentifier |
| import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
| |
| plugins { |
| id("AndroidXPlugin") |
| id("com.android.library") |
| id("AndroidXComposePlugin") |
| id("AndroidXPaparazziPlugin") |
| } |
| |
| def desktopEnabled = KmpPlatformsKt.enableDesktop(project) |
| |
| androidXMultiplatform { |
| android() |
| if (desktopEnabled) desktop() |
| |
| defaultPlatform(PlatformIdentifier.ANDROID) |
| |
| sourceSets { |
| commonMain { |
| dependencies { |
| implementation(libs.kotlinStdlibCommon) |
| implementation(project(":compose:animation:animation-core")) |
| |
| api(project(":compose:foundation:foundation")) |
| api(project(":compose:foundation:foundation-layout")) |
| 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")) |
| } |
| } |
| |
| commonTest { |
| dependencies { |
| } |
| } |
| |
| jvmMain { |
| dependsOn(commonMain) |
| dependencies { |
| } |
| } |
| |
| if (desktopEnabled) { |
| skikoMain { |
| dependsOn(commonMain) |
| dependencies { |
| api(project(":compose:animation:animation-core")) |
| api(project(":compose:runtime:runtime")) |
| api(project(":compose:ui:ui")) |
| api(project(":compose:ui:ui-text")) |
| api(project(":compose:foundation:foundation-layout")) |
| |
| implementation(project(":compose:animation:animation")) |
| implementation(project(":compose:ui:ui-util")) |
| } |
| } |
| } |
| |
| androidMain { |
| dependsOn(jvmMain) |
| dependencies { |
| api("androidx.annotation:annotation:1.1.0") |
| implementation("androidx.activity:activity-compose:1.5.0") |
| |
| // TODO: remove next 3 dependencies when b/202810604 is fixed |
| implementation("androidx.savedstate:savedstate-ktx:1.2.1") |
| implementation("androidx.lifecycle:lifecycle-runtime:2.6.1") |
| implementation("androidx.lifecycle:lifecycle-viewmodel:2.6.1") |
| |
| implementation("androidx.lifecycle:lifecycle-common-java8:2.6.1") |
| } |
| } |
| |
| if (desktopEnabled) { |
| desktopMain { |
| dependsOn(skikoMain) |
| dependsOn(jvmMain) |
| dependencies { |
| implementation(libs.kotlinStdlib) |
| } |
| } |
| } |
| |
| jvmTest { |
| dependsOn(commonTest) |
| dependencies { |
| } |
| } |
| |
| // 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) }` |
| androidUnitTest { |
| dependsOn(jvmTest) |
| dependencies { |
| implementation(libs.testRules) |
| implementation(libs.testRunner) |
| implementation(libs.junit) |
| implementation(libs.truth) |
| } |
| } |
| |
| androidInstrumentedTest { |
| dependsOn(jvmTest) |
| 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.dexmakerMockitoInlineExtended) |
| implementation(libs.mockitoKotlin) |
| implementation(libs.testUiautomator) |
| } |
| } |
| |
| if (desktopEnabled) { |
| desktopTest { |
| dependsOn(jvmTest) |
| dependencies { |
| implementation(project(":compose:ui:ui-test-junit4")) |
| implementation(libs.truth) |
| implementation(libs.junit) |
| implementation(libs.skikoCurrentOs) |
| } |
| } |
| } |
| } |
| } |
| |
| dependencies { |
| lintChecks project(":compose:material3:material3-lint") |
| lintPublish project(":compose:material3:material3-lint") |
| } |
| |
| 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" |
| } |