diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8fdeb0e48da47..1e3ee60eb87b2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-rc-1-bin.zip -distributionSha256Sum=66d79b10eb939c954bf1ac3be9d9cde985301b56058d49542286c35782ae1e74 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip +distributionSha256Sum=553c78f50dafcd54d65b9a444649057857469edf836431389695608536d6b746 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/mpp/docs/Stubbed Projects.md b/mpp/docs/Stubbed Projects.md index 4100ccfbed62b..a4834847fc77f 100644 --- a/mpp/docs/Stubbed Projects.md +++ b/mpp/docs/Stubbed Projects.md @@ -12,6 +12,8 @@ - `:lifecycle:lifecycle-viewmodel-compose` is stubbed by `lifecycle/lifecycle-viewmodel-compose-compatibility-stub`, it depends on `androidx.lifecycle:lifecycle-viewmodel-compose` - `:lifecycle:lifecycle-viewmodel-navigation3` is stubbed by `lifecycle/lifecycle-viewmodel-navigation3-compatibility-stub`, it depends on `androidx.lifecycle:lifecycle-viewmodel-navigation3` - `:lifecycle:lifecycle-viewmodel-savedstate` is stubbed by `lifecycle/lifecycle-viewmodel-savedstate-compatibility-stub`, it depends on `androidx.lifecycle:lifecycle-viewmodel-savedstate` +- `:navigation:navigation-common` is stubbed by `navigation/navigation-common-compatibility-stub`, it depends on `androidx.navigation:navigation-common` +- `:navigation:navigation-runtime` is stubbed by `navigation/navigation-runtime-compatibility-stub`, it depends on `androidx.navigation:navigation-runtime` - `:navigationevent:navigationevent-compose` is stubbed by `navigationevent/navigationevent-compose-compatibility-stub`, it depends on `androidx.navigationevent:navigationevent-compose` - `:savedstate:savedstate` is stubbed by `savedstate/savedstate-compatibility-stub`, it depends on `androidx.savedstate:savedstate` - `:savedstate:savedstate-compose` is stubbed by `savedstate/savedstate-compose-compatibility-stub`, it depends on `androidx.savedstate:savedstate-compose` diff --git a/navigation/navigation-common-compatibility-stub/api/navigation-common.klib.api b/navigation/navigation-common-compatibility-stub/api/navigation-common.klib.api new file mode 100644 index 0000000000000..acf411be7f397 --- /dev/null +++ b/navigation/navigation-common-compatibility-stub/api/navigation-common.klib.api @@ -0,0 +1,8 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, js, linuxArm64, linuxX64, macosArm64, tvosArm64, tvosSimulatorArm64, wasmJs, watchosArm32, watchosArm64, watchosSimulatorArm64] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: diff --git a/navigation/navigation-common-compatibility-stub/build.gradle b/navigation/navigation-common-compatibility-stub/build.gradle new file mode 100644 index 0000000000000..cd7fe903aceb5 --- /dev/null +++ b/navigation/navigation-common-compatibility-stub/build.gradle @@ -0,0 +1,63 @@ +/* + * Copyright 2026 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.PlatformIdentifier +import androidx.build.SoftwareType + +plugins { + id("AndroidXPlugin") + id("JetBrainsAndroidXPlugin") +} + +androidXMultiplatform { + androidLibrary { + namespace = "androidx.navigation.common" + } + desktop() + linux() + mac() + watchos() + tvos() + ios() + js() + wasmJs() + + defaultPlatform(PlatformIdentifier.ANDROID) + + sourceSets { + commonMain { + dependencies { + def version = project.findProperty("artifactRedirection.version.androidx.navigation") + api("androidx.navigation:navigation-common:$version") + + // Keep direct references to fork versions to correctly resolve + // new redirections to Google's artifacts. + api("org.jetbrains.androidx.lifecycle:lifecycle-common:2.11.0-beta01") + api("org.jetbrains.androidx.lifecycle:lifecycle-runtime:2.11.0-beta01") + api("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.11.0-beta01") + api("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate:2.11.0-beta01") + api("org.jetbrains.androidx.savedstate:savedstate:1.4.0") + } + } + } +} + +androidx { + name = "Navigation Common" + type = SoftwareType.PUBLISHED_LIBRARY + inceptionYear = "2017" + description = "Android Navigation-Common" +} diff --git a/navigation/navigation-runtime/gradle.properties b/navigation/navigation-common-compatibility-stub/gradle.properties similarity index 86% rename from navigation/navigation-runtime/gradle.properties rename to navigation/navigation-common-compatibility-stub/gradle.properties index 6456575650af7..09c39b88d6360 100644 --- a/navigation/navigation-runtime/gradle.properties +++ b/navigation/navigation-common-compatibility-stub/gradle.properties @@ -1,5 +1,5 @@ # -# Copyright 2024 The Android Open Source Project +# Copyright 2026 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. @@ -15,4 +15,4 @@ # # TODO Determine redirection group based on package and remove explicit config -artifactRedirection.groupId=androidx.navigation \ No newline at end of file +artifactRedirection.groupId=androidx.navigation diff --git a/navigation/navigation-common-compatibility-stub/src/commonMain/kotlin/EmptyFile.kt b/navigation/navigation-common-compatibility-stub/src/commonMain/kotlin/EmptyFile.kt new file mode 100644 index 0000000000000..7342c934b30d0 --- /dev/null +++ b/navigation/navigation-common-compatibility-stub/src/commonMain/kotlin/EmptyFile.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2026 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. + */ + +// We prefer to have no source code here, but a module can't be empty. +// We use this module to publish a dumb klib to be provided to the compilation of user projects. +// It's needed because Kotlin tries to resolve the dependencies listed in klib manifest. +// There is an intention to drop this behavior: https://youtrack.jetbrains.com/issue/KT-61096 +// The actual klib is published at androidx maven coordinates in Google maven. +// This module depends on the actual klib, so the module API will be available transitively. \ No newline at end of file diff --git a/navigation/navigation-compose/build.gradle b/navigation/navigation-compose/build.gradle index 71e7b168a1309..b8c0503d06808 100644 --- a/navigation/navigation-compose/build.gradle +++ b/navigation/navigation-compose/build.gradle @@ -52,11 +52,11 @@ androidXMultiplatform { implementation("org.jetbrains.compose.animation:animation-core:1.10.0") implementation("org.jetbrains.compose.foundation:foundation-layout:1.10.0") implementation("androidx.collection:collection:1.5.0") - 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("org.jetbrains.androidx.lifecycle:lifecycle-common:2.11.0-beta01") + implementation("org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose:2.11.0-beta01") + implementation("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate:2.11.0-beta01") + implementation("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.11.0-beta01") + implementation("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose:2.11.0-beta01") implementation("androidx.savedstate:savedstate:1.4.0") implementation("androidx.savedstate:savedstate-compose:1.4.0") implementation(libs.kotlinCoroutinesCore) diff --git a/navigation/navigation-runtime-compatibility-stub/api/navigation-runtime.klib.api b/navigation/navigation-runtime-compatibility-stub/api/navigation-runtime.klib.api new file mode 100644 index 0000000000000..78f64f0220702 --- /dev/null +++ b/navigation/navigation-runtime-compatibility-stub/api/navigation-runtime.klib.api @@ -0,0 +1,8 @@ +// Klib ABI Dump +// Targets: [iosArm64, iosSimulatorArm64, js, linuxArm64, linuxX64, macosArm64, tvosArm64, tvosSimulatorArm64, wasmJs, watchosArm32, watchosArm64, watchosSimulatorArm64] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: diff --git a/navigation/navigation-runtime-compatibility-stub/build.gradle b/navigation/navigation-runtime-compatibility-stub/build.gradle new file mode 100644 index 0000000000000..b454db04f0a7f --- /dev/null +++ b/navigation/navigation-runtime-compatibility-stub/build.gradle @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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.PlatformIdentifier +import androidx.build.SoftwareType + +plugins { + id("AndroidXPlugin") + id("JetBrainsAndroidXPlugin") +} + +androidXMultiplatform { + androidLibrary { + namespace = "androidx.navigation" + } + desktop() + linux() + mac() + watchos() + tvos() + ios() + js() + wasmJs() + + defaultPlatform(PlatformIdentifier.ANDROID) + + sourceSets { + commonMain { + dependencies { + def version = project.findProperty("artifactRedirection.version.androidx.navigation") + api("androidx.navigation:navigation-runtime:$version") + + // Keep direct references to fork versions to correctly resolve + // new redirections to Google's artifacts. + api(project(":navigation:navigation-common")) + api("org.jetbrains.androidx.lifecycle:lifecycle-common:2.11.0-beta01") + api("org.jetbrains.androidx.lifecycle:lifecycle-runtime:2.11.0-beta01") + api("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.11.0-beta01") + } + } + } +} + +androidx { + name = "Navigation Runtime" + type = SoftwareType.PUBLISHED_LIBRARY + inceptionYear = "2017" + description = "Android Navigation-Runtime" +} diff --git a/navigation/navigation-common/gradle.properties b/navigation/navigation-runtime-compatibility-stub/gradle.properties similarity index 93% rename from navigation/navigation-common/gradle.properties rename to navigation/navigation-runtime-compatibility-stub/gradle.properties index 6456575650af7..3a81f6aefafbf 100644 --- a/navigation/navigation-common/gradle.properties +++ b/navigation/navigation-runtime-compatibility-stub/gradle.properties @@ -1,5 +1,5 @@ # -# Copyright 2024 The Android Open Source Project +# Copyright 2026 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. diff --git a/navigation/navigation-runtime-compatibility-stub/src/commonMain/kotlin/EmptyFile.kt b/navigation/navigation-runtime-compatibility-stub/src/commonMain/kotlin/EmptyFile.kt new file mode 100644 index 0000000000000..7342c934b30d0 --- /dev/null +++ b/navigation/navigation-runtime-compatibility-stub/src/commonMain/kotlin/EmptyFile.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2026 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. + */ + +// We prefer to have no source code here, but a module can't be empty. +// We use this module to publish a dumb klib to be provided to the compilation of user projects. +// It's needed because Kotlin tries to resolve the dependencies listed in klib manifest. +// There is an intention to drop this behavior: https://youtrack.jetbrains.com/issue/KT-61096 +// The actual klib is published at androidx maven coordinates in Google maven. +// This module depends on the actual klib, so the module API will be available transitively. \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 690271216560b..22cf9a681236e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -416,6 +416,8 @@ includeProject(":lifecycle:lifecycle-viewmodel", "lifecycle/lifecycle-viewmodel- includeProject(":lifecycle:lifecycle-viewmodel-compose", "lifecycle/lifecycle-viewmodel-compose-compatibility-stub") includeProject(":lifecycle:lifecycle-viewmodel-navigation3", "lifecycle/lifecycle-viewmodel-navigation3-compatibility-stub") includeProject(":lifecycle:lifecycle-viewmodel-savedstate", "lifecycle/lifecycle-viewmodel-savedstate-compatibility-stub") +includeProject(":navigation:navigation-common", "navigation/navigation-common-compatibility-stub") +includeProject(":navigation:navigation-runtime", "navigation/navigation-runtime-compatibility-stub") includeProject(":navigationevent:navigationevent-compose", "navigationevent/navigationevent-compose-compatibility-stub") includeProject(":savedstate:savedstate", "savedstate/savedstate-compatibility-stub") includeProject(":savedstate:savedstate-compose", "savedstate/savedstate-compose-compatibility-stub") @@ -534,9 +536,7 @@ includeProject(":lifecycle:lifecycle-runtime-lint") includeProject(":lifecycle:lifecycle-runtime-testing") includeProject(":lifecycle:lifecycle-runtime-testing-lint") includeProject(":lifecycle:lifecycle-viewmodel-testing") -includeProject(":navigation:navigation-common") includeProject(":navigation:navigation-compose") -includeProject(":navigation:navigation-runtime") includeProject(":navigation:navigation-testing") includeProject(":navigation3:navigation3-ui")