blob: c1d2a194b7d2b54387492058d17f3c2b239b0c12 [file] [log] [blame]
/*
* Copyright 2024 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.
*/
/**
* This file was created using the `create_project.py` script located in the
* `<AndroidX root>/development/project-creator` directory.
*
* Please use that script when creating a new project, rather than copying an existing project and
* modifying its settings.
*/
import androidx.build.SoftwareType
import androidx.build.PlatformIdentifier
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
plugins {
id("AndroidXPlugin")
id("AndroidXComposePlugin")
alias(libs.plugins.kotlinSerialization)
}
androidXMultiplatform {
androidLibrary {
compileSdk = 35
namespace = "androidx.navigation3.runtime"
androidResources.enable = true
}
desktop()
mingwX64()
linux()
mac()
ios()
tvos()
watchos()
js()
wasmJs()
defaultPlatform(PlatformIdentifier.ANDROID)
sourceSets {
commonMain {
dependencies {
api(libs.kotlinStdlib)
api(libs.kotlinSerializationCore)
api(project(":compose:runtime:runtime"))
api(project(":compose:runtime:runtime-saveable"))
api("androidx.savedstate:savedstate:1.3.2")
api("androidx.savedstate:savedstate-compose:1.3.2")
implementation("androidx.collection:collection:1.5.0")
implementation("androidx.lifecycle:lifecycle-runtime:2.9.3")
}
}
commonTest {
dependencies {
implementation(libs.kotlinTest)
implementation(project(":kruth:kruth"))
implementation(project(":compose:runtime:runtime-test-utils"))
}
}
androidInstrumentedTest {
dependencies {
implementation(libs.testRules)
implementation(libs.testRunner)
implementation(libs.junit)
implementation(libs.testExtJunitKtx)
implementation(libs.truth)
implementation("androidx.compose.material3:material3:1.3.1")
implementation(project(":compose:test-utils"))
implementation("androidx.compose.ui:ui-test:1.7.5")
implementation("androidx.compose.ui:ui-test-junit4:1.7.5")
implementation(libs.kotlinSerializationCore)
}
}
nonAndroidMain {
dependsOn(commonMain)
}
nonAndroidTest {
dependsOn(commonTest)
}
desktopMain {
dependsOn(nonAndroidMain)
}
desktopTest {
dependsOn(nonAndroidTest)
}
nativeMain {
dependsOn(nonAndroidMain)
}
nativeTest {
dependsOn(nonAndroidTest)
}
webMain {
dependsOn(nonAndroidMain)
}
webTest {
dependsOn(nonAndroidTest)
}
targets.configureEach { target ->
if (target.platformType == KotlinPlatformType.native) {
target.compilations["main"].defaultSourceSet.dependsOn(nativeMain)
target.compilations["test"].defaultSourceSet.dependsOn(nativeTest)
} else if (target.platformType in [KotlinPlatformType.js, KotlinPlatformType.wasm]) {
target.compilations["main"].defaultSourceSet.dependsOn(webMain)
target.compilations["test"].defaultSourceSet.dependsOn(webTest)
}
}
}
}
androidx {
name = "Androidx Navigation 3 Runtime"
type = SoftwareType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS
inceptionYear = "2024"
description = "Provides the building blocks for a Compose first Navigation solution that " +
"easily supports extensions."
samples(project(":navigation3:navigation3-runtime:navigation3-runtime-samples"))
addGoldenImageAssets()
}