blob: 577c4b8e55a50440cc5bc58c17b791e8b3a78433 [file] [log] [blame]
/*./material/material/build.gradle
* Copyright 2019 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.KmpPlatformsKt
import androidx.build.LibraryType
import androidx.build.PlatformIdentifier
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)
api(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"))
api(project(":compose:ui:ui-text"))
implementation(project(":compose:animation:animation"))
implementation(project(":compose:foundation:foundation-layout"))
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"))
implementation(project(":compose:animation:animation"))
implementation(project(":compose:foundation:foundation-layout"))
implementation(project(":compose:ui:ui-util"))
}
}
}
androidMain {
dependsOn(jvmMain)
dependencies {
api("androidx.annotation:annotation:1.1.0")
// TODO: remove next 3 dependencies when b/202810604 is fixed
implementation("androidx.savedstate:savedstate:1.2.1")
implementation("androidx.lifecycle:lifecycle-runtime:2.6.1")
implementation("androidx.lifecycle:lifecycle-viewmodel:2.6.1")
}
}
if (desktopEnabled) {
desktopMain {
dependsOn(skikoMain)
dependsOn(jvmMain)
dependencies {
implementation(libs.kotlinStdlib)
}
}
}
jvmTest {
dependsOn(commonTest)
dependencies {
}
}
androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:material:material:material-samples"))
implementation(project(":compose:test-utils"))
implementation(project(":test:screenshot:screenshot"))
implementation(libs.testRules)
implementation(libs.testRunner)
implementation(libs.junit)
implementation(libs.truth)
implementation(libs.dexmakerMockito)
implementation(libs.mockitoCore)
implementation(libs.mockitoKotlin)
implementation(libs.testUiautomator)
}
}
// 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)
}
}
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:material:material-lint")
lintPublish project(":compose:material:material-lint")
}
androidx {
name = "Compose Material Components"
type = LibraryType.PUBLISHED_LIBRARY
inceptionYear = "2018"
description = "Compose Material Design Components library"
legacyDisableKotlinStrictApiMode = true
}
// Screenshot tests related setup
android {
sourceSets.androidTest.assets.srcDirs +=
project.rootDir.absolutePath + "/../../golden/compose/material/material"
namespace "androidx.compose.material"
}