blob: cc63769a76729c4cb959150c569612793c19ea97 [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.dsl.ExplicitApiMode
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 {
configureEach {
languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
}
commonMain {
dependencies {
api("androidx.annotation:annotation:1.8.1")
api("androidx.lifecycle:lifecycle-common:2.9.0-alpha07")
api("androidx.lifecycle:lifecycle-runtime:2.9.0-alpha07")
api("androidx.lifecycle:lifecycle-viewmodel:2.9.0-alpha07")
api("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.9.0-alpha07")
api("androidx.savedstate:savedstate:1.3.0-alpha05")
api(libs.kotlinStdlib)
implementation("androidx.collection:collection:1.4.2")
implementation(libs.kotlinSerializationCore)
}
}
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.9.0-alpha07")
api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.0-alpha07")
api("androidx.savedstate:savedstate-ktx:1.3.0-alpha05")
implementation("androidx.core:core-ktx:1.1.0")
implementation("androidx.profileinstaller:profileinstaller:1.4.0")
}
}
androidUnitTest {
dependsOn(commonTest)
dependencies {
implementation(project(":navigation:navigation-testing"))
implementation("androidx.arch.core:core-testing:2.2.0")
implementation(libs.junit)
implementation(libs.mockitoCore4)
implementation(libs.truth)
implementation(libs.kotlinCoroutinesCore)
implementation(libs.kotlinCoroutinesTest)
}
}
androidInstrumentedTest {
dependsOn(commonTest)
dependencies {
implementation(libs.junit)
implementation(libs.testExtJunit)
implementation(libs.testRunner)
implementation(libs.truth)
implementation(libs.mockitoCore)
implementation(libs.dexmakerMockito)
}
}
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)
}
}
}
}
}
android {
buildTypes.configureEach {
consumerProguardFiles "proguard-rules.pro"
}
namespace = "androidx.navigation.common"
}
dependencies {
androidTestRuntimeOnly(libs.kotlinTestJunit)
androidTestRuntimeOnly(libs.testCore)
lintPublish(project(":navigation:navigation-common-lint"))
}
androidx {
name = "Navigation Common"
type = LibraryType.PUBLISHED_LIBRARY
inceptionYear = "2017"
description = "Android Navigation-Common"
kotlinTarget = KotlinTarget.KOTLIN_1_9
}