blob: 15f15a02ce2f04290bdde4c540ae6441842fafa3 [file] [log] [blame] [edit]
/*
* Copyright 2018 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.PlatformIdentifier
import androidx.build.SoftwareType
plugins {
id("AndroidXPlugin")
alias(libs.plugins.kotlinSerialization)
}
androidXMultiplatform {
androidLibrary {
namespace = "androidx.navigation.testing"
experimentalProperties["android.experimental.kmp.enableAndroidResources"] = true
withAndroidTestOnDeviceBuilder {
it.compilationName = "instrumentedTest"
it.defaultSourceSetName = "androidInstrumentedTest"
it.sourceSetTreeName = "test"
}
withAndroidTestOnJvmBuilder {
it.compilationName = "unitTest"
it.defaultSourceSetName = "androidUnitTest"
}
}
desktop()
linux()
mac()
ios()
defaultPlatform(PlatformIdentifier.ANDROID)
sourceSets {
configureEach {
languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
}
commonMain {
dependencies {
api(project(":navigation:navigation-runtime"))
api("androidx.lifecycle:lifecycle-runtime-testing:2.9.0-alpha07")
implementation(libs.kotlinCoroutinesCore)
implementation(libs.kotlinSerializationCore)
implementation(project(":navigation:navigation-common"))
implementation("androidx.lifecycle:lifecycle-common:2.9.0-alpha07")
implementation("androidx.lifecycle:lifecycle-viewmodel:2.9.0-alpha07")
implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.9.0-alpha07")
}
}
commonTest {
dependencies {
implementation(project(":kruth:kruth"))
}
}
nonAndroidMain {
dependsOn(commonMain)
}
nonAndroidTest {
dependsOn(commonTest)
}
jvmCommonMain {
dependsOn(commonMain)
}
jvmCommonTest {
dependsOn(commonTest)
dependencies {
runtimeOnly(libs.kotlinTestJunit)
implementation(libs.junit)
}
}
desktopMain {
dependsOn(jvmCommonMain)
dependsOn(nonAndroidMain)
}
desktopTest {
dependsOn(jvmCommonTest)
dependsOn(nonAndroidTest)
}
androidMain {
dependsOn(commonMain)
dependencies {
api("androidx.lifecycle:lifecycle-runtime-ktx:2.9.0-alpha07")
api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.0-alpha07")
api(project(":savedstate:savedstate-ktx"))
implementation("androidx.core:core-ktx:1.1.0")
implementation("androidx.profileinstaller:profileinstaller:1.4.0")
}
}
androidUnitTest {
dependsOn(commonTest)
dependencies {
implementation(libs.robolectric)
runtimeOnly(libs.testCore)
runtimeOnly(libs.kotlinTestJunit)
implementation(libs.junit)
implementation(libs.testRunner)
}
}
androidInstrumentedTest {
dependsOn(commonTest)
dependencies {
implementation(project(":internal-testutils-navigation"))
implementation("androidx.lifecycle:lifecycle-runtime:2.6.2")
implementation(libs.testExtJunit)
implementation(libs.testExtTruth)
implementation(libs.testRules)
runtimeOnly(libs.testCore)
runtimeOnly(libs.kotlinTestJunit)
implementation(libs.junit)
implementation(libs.testRunner)
}
}
nativeMain {
dependsOn(commonMain)
}
linuxMain.dependsOn(nativeMain)
darwinMain.dependsOn(nativeMain)
nativeTest {
dependsOn(commonTest)
}
linuxTest.dependsOn(nativeTest)
darwinTest.dependsOn(nativeTest)
targets.configureEach { target ->
if (target.platformType == org.jetbrains.kotlin.gradle.plugin.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)
}
}
}
}
}
androidx {
name = "Navigation Testing"
type = SoftwareType.PUBLISHED_LIBRARY
inceptionYear = "2017"
description = "Android Navigation-Testing"
}