blob: 82c46433a708fd947a94b2762c08bf9e84074cbf [file] [log] [blame]
/*
* 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.AndroidXComposePlugin
import androidx.build.LibraryType
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 above
*/
api("androidx.annotation:annotation:1.2.1")
api("androidx.compose.animation:animation:1.2.1")
api("androidx.compose.runtime:runtime:1.3.0-rc01")
api(project(":compose:ui:ui"))
implementation(libs.kotlinStdlibCommon)
implementation(project(":compose:foundation:foundation-layout"))
implementation("androidx.compose.ui:ui-graphics:1.2.1")
implementation("androidx.compose.ui:ui-text:1.2.1")
implementation("androidx.compose.ui:ui-util:1.2.1")
testImplementation(project(":compose:test-utils"))
testImplementation(libs.testRules)
testImplementation(libs.testRunner)
testImplementation(libs.junit)
testImplementation(libs.truth)
testImplementation(libs.kotlinCoroutinesTest)
testImplementation(libs.kotlinTest)
testImplementation(libs.mockitoCore)
testImplementation(libs.kotlinReflect)
testImplementation(libs.mockitoKotlin)
androidTestImplementation(project(":compose:test-utils"))
androidTestImplementation(project(":internal-testutils-fonts"))
androidTestImplementation(project(":test:screenshot:screenshot"))
androidTestImplementation(project(":internal-testutils-runtime"))
androidTestImplementation(libs.testUiautomator)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.testRunner)
androidTestImplementation "androidx.activity:activity-compose:1.3.1"
androidTestImplementation(libs.espressoCore)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.kotlinTest)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.dexmakerMockito)
androidTestImplementation(libs.mockitoCore)
androidTestImplementation(libs.mockitoKotlin)
lintChecks(project(":compose:foundation:foundation-lint"))
lintPublish(project(":compose:foundation:foundation-lint"))
samples(project(":compose:foundation:foundation:foundation-samples"))
}
}
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)
api(project(':compose:animation:animation'))
api(project(':compose:runtime:runtime'))
api(project(':compose:ui:ui'))
implementation(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")
}
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.mockitoCore)
implementation(libs.truth)
implementation(libs.kotlinReflect)
implementation(libs.mockitoKotlin)
}
commonTest.dependencies {
implementation(libs.kotlinTest)
implementation(libs.kotlinCoroutinesTest)
}
androidAndroidTest.dependencies {
implementation(project(":compose:test-utils"))
implementation(project(":internal-testutils-fonts"))
implementation(project(":test:screenshot:screenshot"))
implementation(project(":internal-testutils-runtime"))
implementation("androidx.activity:activity-compose:1.3.1")
implementation(libs.testUiautomator)
implementation(libs.testRules)
implementation(libs.testRunner)
implementation(libs.espressoCore)
implementation(libs.junit)
implementation(libs.truth)
implementation(libs.dexmakerMockito)
implementation(libs.mockitoCore)
implementation(libs.mockitoKotlin)
}
desktopTest.dependencies {
implementation(project(":compose:ui:ui-test-junit4"))
implementation(libs.truth)
implementation(libs.junit)
implementation(libs.skikoCurrentOs)
implementation(libs.mockitoCore)
implementation(libs.mockitoKotlin)
}
}
}
dependencies {
samples(project(":compose:foundation:foundation:foundation-samples"))
}
}
// Screenshot tests related setup
android {
sourceSets.androidTest.assets.srcDirs +=
project.rootDir.absolutePath + "/../../golden/compose/foundation/foundation"
namespace "androidx.compose.foundation"
}
androidx {
name = "Compose Foundation"
type = LibraryType.PUBLISHED_LIBRARY
mavenGroup = LibraryGroups.COMPOSE_FOUNDATION
inceptionYear = "2018"
description = "Higher level abstractions of the Compose UI primitives. This library is design system agnostic, providing the high-level building blocks for both application and design-system developers"
legacyDisableKotlinStrictApiMode = true
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += [
"-Xjvm-default=all",
]
}
}