From 9545218eb759b962b6eca726644f5c218135ccfe Mon Sep 17 00:00:00 2001 From: Gabriel Ittner Date: Tue, 17 Oct 2023 10:48:16 +0200 Subject: [PATCH] add deep links test helper --- deeplinks-plugin/api/deeplinks-plugin.api | 169 +------------- deeplinks-plugin/deeplinks-plugin.gradle.kts | 2 +- deeplinks-plugin/rules.pro | 4 - .../deeplinks/plugin/DeepLinksExtension.kt | 7 + .../plugin/DeeplinksManifestConfigurator.kt | 8 +- .../DeeplinksManifestConfiguratorTask.kt | 4 +- .../deeplinks/plugin/DeeplinksPlugin.kt | 24 +- .../api/android/navigation-testing.api | 214 ++++++++++++++++++ .../api/jvm/navigation-testing.api | 170 ++++++++++++++ .../navigation-testing.gradle.kts | 27 ++- .../khonshu/navigation/NavigatorTurbine.kt | 0 .../khonshu/navigation/ResultOwnerTesting.kt | 0 .../navigation/TestNavEventCollector.kt | 0 .../deeplinks}/DeepLinkDefinitions.kt | 4 +- .../navigation/deeplinks/DeepLinkTesting.kt | 36 +++ 15 files changed, 470 insertions(+), 199 deletions(-) create mode 100644 deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeepLinksExtension.kt create mode 100644 navigation-testing/api/android/navigation-testing.api create mode 100644 navigation-testing/api/jvm/navigation-testing.api rename navigation-testing/src/{main => androidMain}/kotlin/com/freeletics/khonshu/navigation/NavigatorTurbine.kt (100%) rename navigation-testing/src/{main => androidMain}/kotlin/com/freeletics/khonshu/navigation/ResultOwnerTesting.kt (100%) rename navigation-testing/src/{main => androidMain}/kotlin/com/freeletics/khonshu/navigation/TestNavEventCollector.kt (100%) rename {deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin => navigation-testing/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks}/DeepLinkDefinitions.kt (90%) create mode 100644 navigation-testing/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkTesting.kt diff --git a/deeplinks-plugin/api/deeplinks-plugin.api b/deeplinks-plugin/api/deeplinks-plugin.api index 88dac0e72..89eaa288d 100644 --- a/deeplinks-plugin/api/deeplinks-plugin.api +++ b/deeplinks-plugin/api/deeplinks-plugin.api @@ -1,77 +1,11 @@ -public final class com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition { - public static final field Companion Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition$Companion; - public synthetic fun (ILjava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;)V - public synthetic fun (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun component1 ()Ljava/util/List; - public final fun component2 ()Ljava/util/List; - public final fun component3 ()Ljava/util/List; - public final fun component4 ()Ljava/util/List; - public final fun copy (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;)Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition; - public static synthetic fun copy$default (Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition; - public fun equals (Ljava/lang/Object;)Z - public final fun getExampleQueries ()Ljava/util/List; - public final fun getPatterns ()Ljava/util/List; - public final fun getPlaceholders ()Ljava/util/List; - public final fun getPrefixes ()Ljava/util/List; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; - public static final synthetic fun write$Self (Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V -} - -public final class com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition;)V - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinition$Companion { - public final fun serializer ()Lkotlinx/serialization/KSerializer; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions { - public static final field Companion Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions$Companion; - public synthetic fun (ILjava/util/List;Ljava/util/List;Ljava/util/Map;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ljava/util/List;Ljava/util/List;Ljava/util/Map;)V - public synthetic fun (Ljava/util/List;Ljava/util/List;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun component1 ()Ljava/util/List; - public final fun component2 ()Ljava/util/List; - public final fun component3 ()Ljava/util/Map; - public final fun copy (Ljava/util/List;Ljava/util/List;Ljava/util/Map;)Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions; - public static synthetic fun copy$default (Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions;Ljava/util/List;Ljava/util/List;Ljava/util/Map;ILjava/lang/Object;)Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions; - public fun equals (Ljava/lang/Object;)Z - public final fun getDeepLinks ()Ljava/util/Map; - public final fun getPlaceholders ()Ljava/util/List; - public final fun getPrefixes ()Ljava/util/List; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; - public static final synthetic fun write$Self (Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V -} - -public final class com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions;)V - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions$Companion { - public final fun decodeFromString (Ljava/lang/String;)Lcom/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions; - public final fun serializer ()Lkotlinx/serialization/KSerializer; +public abstract class com/freeletics/khonshu/deeplinks/plugin/DeepLinksExtension { + public fun ()V + public abstract fun getDeepLinkDefinitionsFile ()Lorg/gradle/api/file/RegularFileProperty; } public abstract class com/freeletics/khonshu/deeplinks/plugin/DeeplinksManifestConfiguratorTask : org/gradle/api/DefaultTask { public fun ()V - public abstract fun getDeeplinksConfigurationFile ()Lorg/gradle/api/file/RegularFileProperty; + public abstract fun getDeepLinkDefinitionsFile ()Lorg/gradle/api/file/RegularFileProperty; public abstract fun getMergedManifest ()Lorg/gradle/api/file/RegularFileProperty; public abstract fun getUpdatedManifest ()Lorg/gradle/api/file/RegularFileProperty; public final fun taskAction ()V @@ -83,98 +17,3 @@ public abstract class com/freeletics/khonshu/deeplinks/plugin/DeeplinksPlugin : public fun apply (Lorg/gradle/api/Project;)V } -public final class com/freeletics/khonshu/deeplinks/plugin/PatternDefinition { - public static final field Companion Lcom/freeletics/khonshu/deeplinks/plugin/PatternDefinition$Companion; - public static final synthetic fun box-impl (Ljava/lang/String;)Lcom/freeletics/khonshu/deeplinks/plugin/PatternDefinition; - public static fun constructor-impl (Ljava/lang/String;)Ljava/lang/String; - public fun equals (Ljava/lang/Object;)Z - public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z - public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z - public final fun getValue ()Ljava/lang/String; - public fun hashCode ()I - public static fun hashCode-impl (Ljava/lang/String;)I - public static final fun replacePlaceholders-impl (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/String; - public fun toString ()Ljava/lang/String; - public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String; - public final synthetic fun unbox-impl ()Ljava/lang/String; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/PatternDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/freeletics/khonshu/deeplinks/plugin/PatternDefinition$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun deserialize-bHjcdSE (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/String; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public fun serialize-GtvXZAs (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/String;)V - public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/PatternDefinition$Companion { - public final fun serializer ()Lkotlinx/serialization/KSerializer; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition { - public static final field Companion Lcom/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition$Companion; - public synthetic fun (ILjava/lang/String;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ljava/lang/String;Ljava/util/List;)V - public final fun component1 ()Ljava/lang/String; - public final fun component2 ()Ljava/util/List; - public final fun copy (Ljava/lang/String;Ljava/util/List;)Lcom/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition; - public static synthetic fun copy$default (Lcom/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Lcom/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition; - public fun equals (Ljava/lang/Object;)Z - public final fun getExampleValues ()Ljava/util/List; - public final fun getKey ()Ljava/lang/String; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; - public static final synthetic fun write$Self (Lcom/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V -} - -public final class com/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition;)V - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/PlaceholderDefinition$Companion { - public final fun serializer ()Lkotlinx/serialization/KSerializer; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/PrefixDefinition { - public static final field Companion Lcom/freeletics/khonshu/deeplinks/plugin/PrefixDefinition$Companion; - public synthetic fun (ILjava/lang/String;Ljava/lang/String;ZLkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ljava/lang/String;Ljava/lang/String;Z)V - public final fun component1 ()Ljava/lang/String; - public final fun component2 ()Ljava/lang/String; - public final fun component3 ()Z - public final fun copy (Ljava/lang/String;Ljava/lang/String;Z)Lcom/freeletics/khonshu/deeplinks/plugin/PrefixDefinition; - public static synthetic fun copy$default (Lcom/freeletics/khonshu/deeplinks/plugin/PrefixDefinition;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Lcom/freeletics/khonshu/deeplinks/plugin/PrefixDefinition; - public fun equals (Ljava/lang/Object;)Z - public final fun getAutoVerified ()Z - public final fun getHost ()Ljava/lang/String; - public final fun getScheme ()Ljava/lang/String; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; - public static final synthetic fun write$Self (Lcom/freeletics/khonshu/deeplinks/plugin/PrefixDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V -} - -public final class com/freeletics/khonshu/deeplinks/plugin/PrefixDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/freeletics/khonshu/deeplinks/plugin/PrefixDefinition$$serializer; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/deeplinks/plugin/PrefixDefinition; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/deeplinks/plugin/PrefixDefinition;)V - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; -} - -public final class com/freeletics/khonshu/deeplinks/plugin/PrefixDefinition$Companion { - public final fun serializer ()Lkotlinx/serialization/KSerializer; -} - diff --git a/deeplinks-plugin/deeplinks-plugin.gradle.kts b/deeplinks-plugin/deeplinks-plugin.gradle.kts index e0c430576..4d4d1789a 100644 --- a/deeplinks-plugin/deeplinks-plugin.gradle.kts +++ b/deeplinks-plugin/deeplinks-plugin.gradle.kts @@ -7,7 +7,7 @@ plugins { dependencies { implementation(libs.toml) implementation(libs.serialization) - implementation(projects.navigation) + implementation(projects.navigationTesting) compileOnly(libs.android.gradle.api) diff --git a/deeplinks-plugin/rules.pro b/deeplinks-plugin/rules.pro index e4ac397c5..cc46af3b5 100644 --- a/deeplinks-plugin/rules.pro +++ b/deeplinks-plugin/rules.pro @@ -15,10 +15,6 @@ # Keep your public API so that it's callable from scripts -keep class com.freeletics.khonshu.deeplinks.plugin.** { public *; } --keepnames class kotlin.jvm.internal.DefaultConstructorMarker --keepclassmembers @com.squareup.moshi.JsonClass @kotlin.Metadata class * { - synthetic (...); -} # No need to obfuscate class names -dontobfuscate diff --git a/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeepLinksExtension.kt b/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeepLinksExtension.kt new file mode 100644 index 000000000..95afa6522 --- /dev/null +++ b/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeepLinksExtension.kt @@ -0,0 +1,7 @@ +package com.freeletics.khonshu.deeplinks.plugin + +import org.gradle.api.file.RegularFileProperty + +public abstract class DeepLinksExtension() { + public abstract val deepLinkDefinitionsFile: RegularFileProperty +} diff --git a/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeeplinksManifestConfigurator.kt b/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeeplinksManifestConfigurator.kt index 4ff64bac0..ba7459230 100644 --- a/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeeplinksManifestConfigurator.kt +++ b/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeeplinksManifestConfigurator.kt @@ -1,6 +1,9 @@ package com.freeletics.khonshu.deeplinks.plugin -import com.freeletics.khonshu.navigation.internal.InternalNavigationApi +import com.freeletics.khonshu.navigation.deeplinks.DeepLinkDefinition +import com.freeletics.khonshu.navigation.deeplinks.DeepLinkDefinitions +import com.freeletics.khonshu.navigation.deeplinks.PatternDefinition +import com.freeletics.khonshu.navigation.deeplinks.PrefixDefinition import java.io.File private const val PLACEHOLDER = "" @@ -16,6 +19,8 @@ internal fun configure( "Did not find $PLACEHOLDER in given manifest ${inputManifestFile.absolutePath}" } + check(configurationFile.exists()) + val definitions = DeepLinkDefinitions.decodeFromString(configurationFile.readText()) val indentation = manifest[placeholderIndex].takeWhile { it == ' ' } manifest[placeholderIndex] = intentFiltersFromConfig(definitions, indentation) @@ -77,7 +82,6 @@ private class IntentFilterBuilder( builder.appendLine("$indentation ") } - @OptIn(InternalNavigationApi::class) fun appendData(scheme: String, host: String, pattern: PatternDefinition) { val pathPattern = pattern.replacePlaceholders { ".*" } builder.appendLine("$indentation { override fun apply(project: Project) { - val configurationFile = File(project.projectDir, "deeplinks.toml") - if (!configurationFile.exists()) { - // configuration file doesn't exist -> skipping - return - } + val extension = project.extensions.create("deepLinks", DeepLinksExtension::class.java) + extension.deepLinkDefinitionsFile.convention(project.layout.projectDirectory.file("deeplinks.toml")) project.plugins.withId("com.android.library") { - setupDeeplinksManifestConfigurator(project, configurationFile) + setupDeeplinksManifestConfigurator(project, extension) } project.plugins.withId("com.android.application") { - setupDeeplinksManifestConfigurator(project, configurationFile) + setupDeeplinksManifestConfigurator(project, extension) } } - private fun setupDeeplinksManifestConfigurator(project: Project, configurationFile: File) { + private fun setupDeeplinksManifestConfigurator(project: Project, extension: DeepLinksExtension) { val androidComponents = project.extensions.getByType(AndroidComponentsExtension::class.java) androidComponents.onVariants { variant -> - val manifestUpdater = project.tasks.register( - variant.name + "DeeplinksManifestConfigurator", - DeeplinksManifestConfiguratorTask::class.java, - ) { - it.deeplinksConfigurationFile.set( - configurationFile, - ) + val name = "${variant.name}DeeplinksManifestConfigurator" + val manifestUpdater = project.tasks.register(name, DeeplinksManifestConfiguratorTask::class.java) { + it.deepLinkDefinitionsFile.set(extension.deepLinkDefinitionsFile) } variant.artifacts.use(manifestUpdater).wiredWithFiles( DeeplinksManifestConfiguratorTask::mergedManifest, diff --git a/navigation-testing/api/android/navigation-testing.api b/navigation-testing/api/android/navigation-testing.api new file mode 100644 index 000000000..3e908ba02 --- /dev/null +++ b/navigation-testing/api/android/navigation-testing.api @@ -0,0 +1,214 @@ +public abstract interface class com/freeletics/khonshu/navigation/NavigatorTurbine { + public abstract fun awaitNavigate (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigateBack (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigateBackTo (Lkotlin/reflect/KClass;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigateForResult (Lcom/freeletics/khonshu/navigation/ActivityResultRequest;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigateForResult (Lcom/freeletics/khonshu/navigation/ActivityResultRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigateTo (Lcom/freeletics/khonshu/navigation/ActivityRoute;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigateTo (Lcom/freeletics/khonshu/navigation/NavRoute;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigateToRoot (Lcom/freeletics/khonshu/navigation/NavRoot;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigateUp (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitNavigationResult (Lcom/freeletics/khonshu/navigation/NavigationResultRequest$Key;Landroid/os/Parcelable;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitRequestPermissions (Lcom/freeletics/khonshu/navigation/PermissionsResultRequest;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitRequestPermissions (Lcom/freeletics/khonshu/navigation/PermissionsResultRequest;[Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun awaitResetToRoot (Lcom/freeletics/khonshu/navigation/NavRoot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun cancel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun cancelAndIgnoreRemainingNavEvents (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun dispatchBackPress ()V +} + +public final class com/freeletics/khonshu/navigation/NavigatorTurbineKt { + public static final fun dispatchBackPress (Lcom/freeletics/khonshu/navigation/NavEventNavigator;)V + public static final fun test-C2H2yOE (Lcom/freeletics/khonshu/navigation/NavEventNavigator;Lkotlin/time/Duration;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun test-C2H2yOE$default (Lcom/freeletics/khonshu/navigation/NavEventNavigator;Lkotlin/time/Duration;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun testIn-5_5nbZA (Lcom/freeletics/khonshu/navigation/NavEventNavigator;Lkotlinx/coroutines/CoroutineScope;Lkotlin/time/Duration;Ljava/lang/String;)Lcom/freeletics/khonshu/navigation/NavigatorTurbine; + public static synthetic fun testIn-5_5nbZA$default (Lcom/freeletics/khonshu/navigation/NavEventNavigator;Lkotlinx/coroutines/CoroutineScope;Lkotlin/time/Duration;Ljava/lang/String;ILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/NavigatorTurbine; +} + +public final class com/freeletics/khonshu/navigation/ResultOwnerTestingKt { + public static final fun sendResult (Lcom/freeletics/khonshu/navigation/ActivityResultRequest;Ljava/lang/Object;)V + public static final fun sendResult (Lcom/freeletics/khonshu/navigation/NavigationResultRequest;Landroid/os/Parcelable;)V + public static final fun sendResult (Lcom/freeletics/khonshu/navigation/PermissionsResultRequest;Ljava/lang/String;Lcom/freeletics/khonshu/navigation/PermissionsResultRequest$PermissionResult;)V + public static final fun sendResult (Lcom/freeletics/khonshu/navigation/PermissionsResultRequest;Ljava/util/Map;)V + public static final fun sendResult (Lcom/freeletics/khonshu/navigation/PermissionsResultRequest;[Lkotlin/Pair;)V +} + +public final class com/freeletics/khonshu/navigation/TestNavEventCollector { + public final fun awaitNavigateBack ()V + public final fun awaitNavigateBackTo-UamjCxQ (Lkotlin/reflect/KClass;Z)V + public final fun awaitNavigateTo (Lcom/freeletics/khonshu/navigation/NavRoute;)V + public final fun awaitNavigateToRoot (Lcom/freeletics/khonshu/navigation/NavRoot;Z)V + public final fun awaitNavigateUp ()V + public final fun awaitResetToRoot (Lcom/freeletics/khonshu/navigation/NavRoot;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition$Companion; + public synthetic fun (ILjava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;)V + public synthetic fun (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/util/List; + public final fun component4 ()Ljava/util/List; + public final fun copy (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition; + public static synthetic fun copy$default (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition; + public fun equals (Ljava/lang/Object;)Z + public final fun getExampleQueries ()Ljava/util/List; + public final fun getPatterns ()Ljava/util/List; + public final fun getPlaceholders ()Ljava/util/List; + public final fun getPrefixes ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions$Companion; + public synthetic fun (ILjava/util/List;Ljava/util/List;Ljava/util/Map;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/util/List;Ljava/util/List;Ljava/util/Map;)V + public synthetic fun (Ljava/util/List;Ljava/util/List;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/util/Map; + public final fun copy (Ljava/util/List;Ljava/util/List;Ljava/util/Map;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions; + public static synthetic fun copy$default (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions;Ljava/util/List;Ljava/util/List;Ljava/util/Map;ILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions; + public fun equals (Ljava/lang/Object;)Z + public final fun getDeepLinks ()Ljava/util/Map; + public final fun getPlaceholders ()Ljava/util/List; + public final fun getPrefixes ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions$Companion { + public final fun decodeFromString (Ljava/lang/String;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkTestingKt { + public static final fun containsAllDeepLinks (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions;Ljava/util/Set;Ljava/util/Set;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PatternDefinition { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/PatternDefinition$Companion; + public static final synthetic fun box-impl (Ljava/lang/String;)Lcom/freeletics/khonshu/navigation/deeplinks/PatternDefinition; + public static fun constructor-impl (Ljava/lang/String;)Ljava/lang/String; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z + public final fun getValue ()Ljava/lang/String; + public fun hashCode ()I + public static fun hashCode-impl (Ljava/lang/String;)I + public static final fun replacePlaceholders-impl (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/String; + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Ljava/lang/String; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PatternDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/PatternDefinition$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun deserialize-UEwoQNk (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/String; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun serialize-8x5bDLE (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/String;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PatternDefinition$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition$Companion; + public synthetic fun (ILjava/lang/String;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/lang/String;Ljava/util/List;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/util/List; + public final fun copy (Ljava/lang/String;Ljava/util/List;)Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition; + public static synthetic fun copy$default (Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition; + public fun equals (Ljava/lang/Object;)Z + public final fun getExampleValues ()Ljava/util/List; + public final fun getKey ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PrefixDefinition { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition$Companion; + public synthetic fun (ILjava/lang/String;Ljava/lang/String;ZLkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/lang/String;Ljava/lang/String;Z)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Z + public final fun copy (Ljava/lang/String;Ljava/lang/String;Z)Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition; + public static synthetic fun copy$default (Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition; + public fun equals (Ljava/lang/Object;)Z + public final fun getAutoVerified ()Z + public final fun getHost ()Ljava/lang/String; + public final fun getScheme ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PrefixDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PrefixDefinition$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + diff --git a/navigation-testing/api/jvm/navigation-testing.api b/navigation-testing/api/jvm/navigation-testing.api new file mode 100644 index 000000000..14872d3c5 --- /dev/null +++ b/navigation-testing/api/jvm/navigation-testing.api @@ -0,0 +1,170 @@ +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition$Companion; + public synthetic fun (ILjava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;)V + public synthetic fun (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/util/List; + public final fun component4 ()Ljava/util/List; + public final fun copy (Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition; + public static synthetic fun copy$default (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition; + public fun equals (Ljava/lang/Object;)Z + public final fun getExampleQueries ()Ljava/util/List; + public final fun getPatterns ()Ljava/util/List; + public final fun getPlaceholders ()Ljava/util/List; + public final fun getPrefixes ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinition$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions$Companion; + public synthetic fun (ILjava/util/List;Ljava/util/List;Ljava/util/Map;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/util/List;Ljava/util/List;Ljava/util/Map;)V + public synthetic fun (Ljava/util/List;Ljava/util/List;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/util/Map; + public final fun copy (Ljava/util/List;Ljava/util/List;Ljava/util/Map;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions; + public static synthetic fun copy$default (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions;Ljava/util/List;Ljava/util/List;Ljava/util/Map;ILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions; + public fun equals (Ljava/lang/Object;)Z + public final fun getDeepLinks ()Ljava/util/Map; + public final fun getPlaceholders ()Ljava/util/List; + public final fun getPrefixes ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions$Companion { + public final fun decodeFromString (Ljava/lang/String;)Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/DeepLinkTestingKt { + public static final fun containsAllDeepLinks (Lcom/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions;Ljava/util/Set;Ljava/util/Set;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PatternDefinition { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/PatternDefinition$Companion; + public static final synthetic fun box-impl (Ljava/lang/String;)Lcom/freeletics/khonshu/navigation/deeplinks/PatternDefinition; + public static fun constructor-impl (Ljava/lang/String;)Ljava/lang/String; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z + public final fun getValue ()Ljava/lang/String; + public fun hashCode ()I + public static fun hashCode-impl (Ljava/lang/String;)I + public static final fun replacePlaceholders-impl (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/String; + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Ljava/lang/String; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PatternDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/PatternDefinition$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun deserialize-UEwoQNk (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/String; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun serialize-8x5bDLE (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/String;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PatternDefinition$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition$Companion; + public synthetic fun (ILjava/lang/String;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/lang/String;Ljava/util/List;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/util/List; + public final fun copy (Ljava/lang/String;Ljava/util/List;)Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition; + public static synthetic fun copy$default (Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition; + public fun equals (Ljava/lang/Object;)Z + public final fun getExampleValues ()Ljava/util/List; + public final fun getKey ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PlaceholderDefinition$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PrefixDefinition { + public static final field Companion Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition$Companion; + public synthetic fun (ILjava/lang/String;Ljava/lang/String;ZLkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/lang/String;Ljava/lang/String;Z)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Z + public final fun copy (Ljava/lang/String;Ljava/lang/String;Z)Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition; + public static synthetic fun copy$default (Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition; + public fun equals (Ljava/lang/Object;)Z + public final fun getAutoVerified ()Z + public final fun getHost ()Ljava/lang/String; + public final fun getScheme ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PrefixDefinition$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/freeletics/khonshu/navigation/deeplinks/PrefixDefinition;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/freeletics/khonshu/navigation/deeplinks/PrefixDefinition$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + diff --git a/navigation-testing/navigation-testing.gradle.kts b/navigation-testing/navigation-testing.gradle.kts index 85d289b0c..0ec8576a1 100644 --- a/navigation-testing/navigation-testing.gradle.kts +++ b/navigation-testing/navigation-testing.gradle.kts @@ -1,16 +1,31 @@ plugins { - alias(libs.plugins.fgp.android) + alias(libs.plugins.fgp.multiplatform) alias(libs.plugins.fgp.publish) + alias(libs.plugins.kotlin.serialization) } freeletics { optIn("com.freeletics.khonshu.navigation.internal.InternalNavigationApi") + + multiplatform { + addJvmTarget() + addAndroidTarget() + } +} + +dependencies { } dependencies { - api(projects.navigation) - api(libs.coroutines.core) - api(libs.turbine) - implementation(libs.androidx.activity) - implementation(libs.truth) + "commonMainApi"(projects.navigation) + "commonMainApi"(libs.kotlin.test) + + "commonMainImplementation"(libs.toml) + "commonMainImplementation"(libs.serialization) + + "androidMainApi"(libs.coroutines.core) + "androidMainApi"(libs.turbine) + + "androidMainImplementation"(libs.androidx.activity) + "androidMainImplementation"(libs.truth) } diff --git a/navigation-testing/src/main/kotlin/com/freeletics/khonshu/navigation/NavigatorTurbine.kt b/navigation-testing/src/androidMain/kotlin/com/freeletics/khonshu/navigation/NavigatorTurbine.kt similarity index 100% rename from navigation-testing/src/main/kotlin/com/freeletics/khonshu/navigation/NavigatorTurbine.kt rename to navigation-testing/src/androidMain/kotlin/com/freeletics/khonshu/navigation/NavigatorTurbine.kt diff --git a/navigation-testing/src/main/kotlin/com/freeletics/khonshu/navigation/ResultOwnerTesting.kt b/navigation-testing/src/androidMain/kotlin/com/freeletics/khonshu/navigation/ResultOwnerTesting.kt similarity index 100% rename from navigation-testing/src/main/kotlin/com/freeletics/khonshu/navigation/ResultOwnerTesting.kt rename to navigation-testing/src/androidMain/kotlin/com/freeletics/khonshu/navigation/ResultOwnerTesting.kt diff --git a/navigation-testing/src/main/kotlin/com/freeletics/khonshu/navigation/TestNavEventCollector.kt b/navigation-testing/src/androidMain/kotlin/com/freeletics/khonshu/navigation/TestNavEventCollector.kt similarity index 100% rename from navigation-testing/src/main/kotlin/com/freeletics/khonshu/navigation/TestNavEventCollector.kt rename to navigation-testing/src/androidMain/kotlin/com/freeletics/khonshu/navigation/TestNavEventCollector.kt diff --git a/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions.kt b/navigation-testing/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions.kt similarity index 90% rename from deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions.kt rename to navigation-testing/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions.kt index 8e9e31e61..b3647ff37 100644 --- a/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/DeepLinkDefinitions.kt +++ b/navigation-testing/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkDefinitions.kt @@ -1,7 +1,5 @@ -package com.freeletics.khonshu.deeplinks.plugin +package com.freeletics.khonshu.navigation.deeplinks -import com.freeletics.khonshu.navigation.deeplinks.DeepLinkHandler -import com.freeletics.khonshu.navigation.deeplinks.replacePlaceholders import com.freeletics.khonshu.navigation.internal.InternalNavigationApi import kotlinx.serialization.Serializable import kotlinx.serialization.decodeFromString diff --git a/navigation-testing/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkTesting.kt b/navigation-testing/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkTesting.kt new file mode 100644 index 000000000..7a689be65 --- /dev/null +++ b/navigation-testing/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkTesting.kt @@ -0,0 +1,36 @@ +package com.freeletics.khonshu.navigation.deeplinks + +import kotlin.test.assertTrue + +public fun DeepLinkDefinitions.containsAllDeepLinks( + deepLinkHandlers: Set, + defaultPrefixes: Set, +) { + val codePrefixPatternCombinations = deepLinkHandlers.flatMapTo(HashSet()) { handler -> + handler.prefixes.ifEmpty { defaultPrefixes }.flatMap { prefix -> + handler.patterns.map { pattern -> + prefix to pattern + } + } + } + + val definedPrefixPatternCombinations = deepLinks.values.flatMapTo(HashSet()) { deepLink -> + deepLink.prefixes.ifEmpty { prefixes }.flatMap { prefix -> + deepLink.patterns.map { pattern -> + DeepLinkHandler.Prefix("${prefix.scheme}://${prefix.host}") to + DeepLinkHandler.Pattern(pattern.value) + } + } + } + + val codeOnly = codePrefixPatternCombinations - definedPrefixPatternCombinations + assertTrue( + codeOnly.isEmpty(), + "The following deep links are not defined in TOML but are present in code: $codeOnly", + ) + val tomlOnly = definedPrefixPatternCombinations - codePrefixPatternCombinations + assertTrue( + tomlOnly.isEmpty(), + "The following deep links are not defined in code but are present in the TOML file: $tomlOnly", + ) +}