blob: 8495bf86d46a917378f5fc4f0b8ccf6685e95628 [file] [log] [blame] [edit]
/*
* Copyright 2020 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.SoftwareType
import androidx.build.PlatformIdentifier
plugins {
id("AndroidXPlugin")
id("com.android.library")
id("AndroidXComposePlugin")
alias(libs.plugins.kotlinSerialization)
}
androidXMultiplatform {
androidTarget()
jvmStubs()
linuxX64Stubs()
defaultPlatform(PlatformIdentifier.ANDROID)
sourceSets {
commonMain {
dependencies {
api(libs.kotlinStdlib)
api(project(":navigation:navigation-runtime"))
api(project(":navigation:navigation-common"))
implementation("androidx.annotation:annotation:1.8.0")
api("androidx.compose.runtime:runtime:1.7.2")
api("androidx.compose.ui:ui:1.7.2")
api("androidx.compose.animation:animation:1.7.2")
api("androidx.compose.runtime:runtime-saveable:1.7.2")
implementation("androidx.compose.animation:animation-core:1.7.2")
implementation("androidx.compose.foundation:foundation-layout:1.7.2")
implementation("androidx.collection:collection:1.4.5")
implementation(project(":lifecycle:lifecycle-common"))
implementation(project(":lifecycle:lifecycle-runtime-compose"))
implementation(project(":lifecycle:lifecycle-viewmodel-savedstate"))
implementation(project(":lifecycle:lifecycle-viewmodel"))
implementation(project(":lifecycle:lifecycle-viewmodel-compose"))
implementation(project(":savedstate:savedstate"))
implementation(project(":savedstate:savedstate-compose"))
implementation(libs.kotlinCoroutinesCore)
implementation(libs.kotlinSerializationCore)
}
}
commonTest {
dependencies {
implementation(libs.kotlinTest)
}
}
nonAndroidMain {
dependsOn(commonMain)
}
nonAndroidTest {
dependsOn(commonTest)
}
jvmCommonMain {
dependsOn(commonMain)
}
jvmCommonTest {
dependsOn(commonTest)
}
jvmStubsMain {
dependsOn(jvmCommonMain)
dependsOn(nonAndroidMain)
}
jvmStubsTest {
dependsOn(jvmCommonTest)
dependsOn(nonAndroidTest)
}
androidMain {
dependsOn(jvmCommonMain)
dependencies {
api("androidx.activity:activity-compose:1.8.0")
api("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.2")
implementation("androidx.activity:activity:1.8.0")
}
}
androidUnitTest {
dependsOn(jvmCommonTest)
}
androidInstrumentedTest {
dependsOn(jvmCommonTest)
dependencies {
implementation("androidx.activity:activity:1.9.2")
implementation("androidx.core:core-ktx:1.13.0")
implementation("androidx.lifecycle:lifecycle-runtime-testing:2.8.2")
implementation("androidx.lifecycle:lifecycle-runtime:2.8.2")
implementation("androidx.lifecycle:lifecycle-common:2.8.2")
implementation("androidx.lifecycle:lifecycle-viewmodel:2.8.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.2")
implementation("androidx.savedstate:savedstate:1.2.1")
implementation(project(":navigation:navigation-testing"))
implementation(libs.testExtJunit)
implementation(libs.testRunner)
implementation(libs.junit)
implementation(libs.truth)
// Compose test dependencies
implementation(project(":compose:animation:animation"))
implementation(project(":compose:animation:animation-core"))
implementation(project(":compose:foundation:foundation"))
implementation(project(":compose:runtime:runtime"))
implementation(project(":compose:runtime:runtime-saveable"))
implementation(project(":compose:ui:ui"))
implementation(project(":compose:ui:ui-graphics"))
implementation(project(":compose:ui:ui-test"))
implementation(project(":compose:ui:ui-text"))
implementation(project(":compose:ui:ui-tooling-preview"))
implementation(project(":compose:ui:ui-unit"))
implementation(project(":compose:material:material"))
implementation(project(":compose:test-utils"))
implementation(project(":compose:ui:ui-test-junit4"))
implementation(project(":compose:ui:ui-tooling"))
}
}
nonJvmCommonMain {
dependsOn(nonAndroidMain)
}
nonJvmCommonTest {
dependsOn(nonAndroidTest)
}
nativeMain {
dependsOn(nonJvmCommonMain)
}
nativeTest {
dependsOn(nonJvmCommonTest)
}
linuxx64StubsMain.dependsOn(nativeMain)
linuxx64StubsTest.dependsOn(nativeTest)
}
}
dependencies {
lintChecks(project(":navigation:navigation-compose-lint"))
lintPublish(project(":navigation:navigation-compose-lint"))
androidTestImplementation(project(":internal-testutils-navigation"), {
exclude group: "androidx.navigation", module: "navigation-common"
})
}
androidx {
name = "Compose Navigation"
type = SoftwareType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS
inceptionYear = "2020"
description = "Compose integration with Navigation"
samples(project(":navigation:navigation-compose:navigation-compose-samples"))
metalavaK2UastEnabled = false
addGoldenImageAssets()
}
android {
compileSdk = 35
namespace = "androidx.navigation.compose"
}