blob: c71a4c09c781c5d5cee9d2ae42be72098889a11c [file] [log] [blame]
/*
* Copyright (C) 2016 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.KotlinTarget
import androidx.build.LibraryType
import androidx.build.PlatformIdentifier
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
plugins {
id("AndroidXPlugin")
id("com.android.library")
alias(libs.plugins.kotlinSerialization)
}
androidXMultiplatform {
android()
desktop()
mac()
linux()
ios()
defaultPlatform(PlatformIdentifier.ANDROID)
sourceSets {
commonMain {
dependencies {
api(libs.kotlinStdlib)
api(libs.kotlinCoroutinesCore)
api(project(":navigation:navigation-common"))
api("androidx.lifecycle:lifecycle-common:2.6.2")
api("androidx.lifecycle:lifecycle-runtime:2.6.2")
api("androidx.lifecycle:lifecycle-viewmodel:2.6.2")
implementation(libs.kotlinSerializationCore)
implementation("androidx.collection:collection:1.4.2")
}
}
commonTest {
dependencies {
implementation(libs.kotlinTest)
}
}
nonAndroidMain {
dependsOn(commonMain)
}
nonAndroidTest {
dependsOn(commonTest)
}
jvmCommonMain {
dependsOn(commonMain)
}
jvmCommonTest {
dependsOn(commonTest)
}
desktopMain {
dependsOn(jvmCommonMain)
dependsOn(nonAndroidMain)
}
desktopTest {
dependsOn(jvmCommonTest)
dependsOn(nonAndroidTest)
}
androidMain {
dependsOn(jvmCommonMain)
dependencies {
api("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
api("androidx.activity:activity-ktx:1.7.1")
api("androidx.core:core-ktx:1.8.0")
api("androidx.annotation:annotation-experimental:1.4.1")
}
}
androidUnitTest {
dependsOn(commonTest)
}
androidInstrumentedTest {
dependsOn(commonTest)
dependencies {
implementation("androidx.annotation:annotation:1.8.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.2")
implementation("androidx.lifecycle:lifecycle-common:2.6.2")
implementation("androidx.lifecycle:lifecycle-runtime:2.6.2")
implementation("androidx.lifecycle:lifecycle-runtime-testing:2.6.2")
implementation(project(":internal-testutils-navigation"))
implementation(project(":internal-testutils-runtime"))
implementation(libs.hamcrestCore)
implementation(libs.junit)
implementation(libs.kotlinTest)
implementation(libs.testCore)
implementation(libs.testExtJunit)
implementation(libs.testExtTruth)
implementation(libs.testMonitor)
implementation(libs.testRunner)
implementation(libs.testRules)
implementation(libs.espressoIntents)
implementation(libs.truth)
implementation(libs.dexmakerMockito)
implementation(libs.mockitoCore)
}
}
nonJvmCommonMain {
dependsOn(nonAndroidMain)
}
nonJvmCommonTest {
dependsOn(nonAndroidTest)
}
nativeMain {
dependsOn(nonJvmCommonMain)
}
linuxMain.dependsOn(nativeMain)
darwinMain.dependsOn(nativeMain)
nativeTest {
dependsOn(nonJvmCommonTest)
}
linuxTest.dependsOn(nativeTest)
darwinTest.dependsOn(nativeTest)
targets.configureEach { target ->
if (target.platformType == KotlinPlatformType.native) {
if (target.konanTarget.family.appleFamily) {
target.compilations["main"].defaultSourceSet.dependsOn(darwinMain)
target.compilations["test"].defaultSourceSet.dependsOn(darwinTest)
} else if (target.konanTarget.family == org.jetbrains.kotlin.konan.target.Family.LINUX) {
target.compilations["main"].defaultSourceSet.dependsOn(linuxMain)
target.compilations["test"].defaultSourceSet.dependsOn(linuxTest)
}
}
}
}
}
dependencies {
lintPublish(project(":navigation:navigation-runtime-lint"))
}
android {
namespace = "androidx.navigation"
}
androidx {
name = "Navigation Runtime"
type = LibraryType.PUBLISHED_LIBRARY
inceptionYear = "2017"
description = "Android Navigation-Runtime"
kotlinTarget = KotlinTarget.KOTLIN_1_9
}