diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 1ba46766..853f7865 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -31,6 +31,9 @@ jobs: - name: Run android lint run: ./gradlew lint + - name : Run api compatibility check + run: ./gradlew apiCheck + - name: Build project run: ./gradlew assemble diff --git a/elmslie-android/api/elmslie-android.api b/elmslie-android/api/elmslie-android.api new file mode 100644 index 00000000..c353122d --- /dev/null +++ b/elmslie-android/api/elmslie-android.api @@ -0,0 +1,79 @@ +public final class money/vivid/elmslie/android/ElmStoreLazyKt { + public static final fun elmStore (Landroidx/activity/ComponentActivity;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;)Lkotlin/Lazy; + public static final fun elmStore (Landroidx/fragment/app/Fragment;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;)Lkotlin/Lazy; + public static synthetic fun elmStore$default (Landroidx/activity/ComponentActivity;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlin/Lazy; + public static synthetic fun elmStore$default (Landroidx/fragment/app/Fragment;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlin/Lazy; +} + +public final class money/vivid/elmslie/android/RetainedElmStore : androidx/lifecycle/ViewModel { + public static final field Companion Lmoney/vivid/elmslie/android/RetainedElmStore$Companion; + public static final field StateBundleKey Ljava/lang/String; + public fun (Landroidx/lifecycle/SavedStateHandle;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)V + public final fun getStore ()Lmoney/vivid/elmslie/core/store/EffectCachingElmStore; +} + +public final class money/vivid/elmslie/android/RetainedElmStore$Companion { +} + +public final class money/vivid/elmslie/android/RetainedElmStoreFactory : androidx/lifecycle/AbstractSavedStateViewModelFactory { + public fun (Landroidx/savedstate/SavedStateRegistryOwner;Landroid/os/Bundle;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)V +} + +public final class money/vivid/elmslie/android/logger/DefaultLoggerConfigurationsKt { + public static final fun defaultDebugLogger (Lmoney/vivid/elmslie/core/config/ElmslieConfig;)V + public static final fun defaultReleaseLogger (Lmoney/vivid/elmslie/core/config/ElmslieConfig;)V +} + +public final class money/vivid/elmslie/android/logger/DefaultLoggerInitializer : androidx/startup/Initializer { + public fun ()V + public synthetic fun create (Landroid/content/Context;)Ljava/lang/Object; + public fun create (Landroid/content/Context;)V + public fun dependencies ()Ljava/util/List; +} + +public final class money/vivid/elmslie/android/logger/strategy/AndroidLog { + public static final field INSTANCE Lmoney/vivid/elmslie/android/logger/strategy/AndroidLog; + public final fun getD ()Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy; + public final fun getE ()Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy; + public final fun getI ()Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy; + public final fun getV ()Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy; + public final fun getW ()Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy; +} + +public final class money/vivid/elmslie/android/logger/strategy/Crash : money/vivid/elmslie/core/logger/strategy/LogStrategy { + public static final field INSTANCE Lmoney/vivid/elmslie/android/logger/strategy/Crash; + public fun log (Lmoney/vivid/elmslie/core/logger/LogSeverity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V +} + +public final class money/vivid/elmslie/android/processdeath/ProcessDeathDetector { + public static final field INSTANCE Lmoney/vivid/elmslie/android/processdeath/ProcessDeathDetector; + public final fun isRestoringAfterProcessDeath ()Z +} + +public final class money/vivid/elmslie/android/processdeath/ProcessDeathDetectorInitializer : androidx/startup/Initializer { + public fun ()V + public synthetic fun create (Landroid/content/Context;)Ljava/lang/Object; + public fun create (Landroid/content/Context;)V + public fun dependencies ()Ljava/util/List; +} + +public abstract interface class money/vivid/elmslie/android/renderer/ElmRendererDelegate { + public abstract fun handleEffect (Ljava/lang/Object;)Lkotlin/Unit; + public abstract fun mapList (Ljava/lang/Object;)Ljava/util/List; + public abstract fun render (Ljava/lang/Object;)V + public abstract fun renderList (Ljava/lang/Object;Ljava/util/List;)V +} + +public final class money/vivid/elmslie/android/renderer/ElmRendererDelegate$DefaultImpls { + public static fun handleEffect (Lmoney/vivid/elmslie/android/renderer/ElmRendererDelegate;Ljava/lang/Object;)Lkotlin/Unit; + public static fun mapList (Lmoney/vivid/elmslie/android/renderer/ElmRendererDelegate;Ljava/lang/Object;)Ljava/util/List; + public static fun renderList (Lmoney/vivid/elmslie/android/renderer/ElmRendererDelegate;Ljava/lang/Object;Ljava/util/List;)V +} + +public final class money/vivid/elmslie/android/renderer/ElmRendererDelegateKt { + public static final fun androidElmStore (Lmoney/vivid/elmslie/android/renderer/ElmRendererDelegate;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;)Lkotlin/Lazy; + public static final fun androidElmStore (Lmoney/vivid/elmslie/android/renderer/ElmRendererDelegate;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;)Lkotlin/Lazy; + public static synthetic fun androidElmStore$default (Lmoney/vivid/elmslie/android/renderer/ElmRendererDelegate;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlin/Lazy; + public static synthetic fun androidElmStore$default (Lmoney/vivid/elmslie/android/renderer/ElmRendererDelegate;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlin/Lazy; +} + diff --git a/elmslie-android/build.gradle.kts b/elmslie-android/build.gradle.kts index 67e17879..10e25f1c 100644 --- a/elmslie-android/build.gradle.kts +++ b/elmslie-android/build.gradle.kts @@ -1,5 +1,6 @@ plugins { id("elmslie.android-lib") + alias(libs.plugins.binaryCompatibilityValidator) } android { diff --git a/elmslie-core/api/elmslie-core.api b/elmslie-core/api/elmslie-core.api new file mode 100644 index 00000000..efd680f5 --- /dev/null +++ b/elmslie-core/api/elmslie-core.api @@ -0,0 +1,184 @@ +public final class money/vivid/elmslie/core/ElmScopeKt { + public static final fun ElmScope (Ljava/lang/String;)Lkotlinx/coroutines/CoroutineScope; +} + +public final class money/vivid/elmslie/core/config/ElmslieConfig { + public static final field INSTANCE Lmoney/vivid/elmslie/core/config/ElmslieConfig; + public final fun getGlobalStoreListeners ()Ljava/util/Set; + public final fun getIoDispatchers ()Lkotlinx/coroutines/CoroutineDispatcher; + public final fun getLogger ()Lmoney/vivid/elmslie/core/logger/ElmslieLogger; + public final fun getShouldStopOnProcessDeath ()Z + public final fun globalStoreListeners (Lkotlin/jvm/functions/Function0;)V + public final fun ioDispatchers (Lkotlin/jvm/functions/Function0;)V + public final fun logger (Lkotlin/jvm/functions/Function1;)V + public final fun shouldStopOnProcessDeath (Lkotlin/jvm/functions/Function0;)V +} + +public final class money/vivid/elmslie/core/logger/ElmslieLogConfiguration { + public fun ()V + public final fun always (Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy;)Lmoney/vivid/elmslie/core/logger/ElmslieLogConfiguration; + public final fun debug (Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy;)Lmoney/vivid/elmslie/core/logger/ElmslieLogConfiguration; + public final fun fatal (Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy;)Lmoney/vivid/elmslie/core/logger/ElmslieLogConfiguration; + public final fun nonfatal (Lmoney/vivid/elmslie/core/logger/strategy/LogStrategy;)Lmoney/vivid/elmslie/core/logger/ElmslieLogConfiguration; +} + +public final class money/vivid/elmslie/core/logger/ElmslieLogger { + public fun (Ljava/util/Map;)V + public final fun debug (Ljava/lang/String;Ljava/lang/String;)V + public static synthetic fun debug$default (Lmoney/vivid/elmslie/core/logger/ElmslieLogger;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)V + public final fun fatal (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V + public static synthetic fun fatal$default (Lmoney/vivid/elmslie/core/logger/ElmslieLogger;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V + public final fun nonfatal (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V + public static synthetic fun nonfatal$default (Lmoney/vivid/elmslie/core/logger/ElmslieLogger;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V +} + +public final class money/vivid/elmslie/core/logger/LogSeverity : java/lang/Enum { + public static final field Debug Lmoney/vivid/elmslie/core/logger/LogSeverity; + public static final field Fatal Lmoney/vivid/elmslie/core/logger/LogSeverity; + public static final field NonFatal Lmoney/vivid/elmslie/core/logger/LogSeverity; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static fun valueOf (Ljava/lang/String;)Lmoney/vivid/elmslie/core/logger/LogSeverity; + public static fun values ()[Lmoney/vivid/elmslie/core/logger/LogSeverity; +} + +public final class money/vivid/elmslie/core/logger/strategy/IgnoreLog : money/vivid/elmslie/core/logger/strategy/LogStrategy { + public static final field INSTANCE Lmoney/vivid/elmslie/core/logger/strategy/IgnoreLog; + public fun log (Lmoney/vivid/elmslie/core/logger/LogSeverity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V +} + +public abstract interface class money/vivid/elmslie/core/logger/strategy/LogStrategy { + public abstract fun log (Lmoney/vivid/elmslie/core/logger/LogSeverity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V +} + +public abstract class money/vivid/elmslie/core/store/Actor { + public fun ()V + protected final fun asSwitchFlow (Lkotlinx/coroutines/flow/Flow;Ljava/lang/Object;J)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun asSwitchFlow$default (Lmoney/vivid/elmslie/core/store/Actor;Lkotlinx/coroutines/flow/Flow;Ljava/lang/Object;JILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + protected final fun cancelSwitchFlow (Lkotlin/reflect/KClass;)Lkotlinx/coroutines/flow/Flow; + public abstract fun execute (Ljava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public final fun mapEvents (Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun mapEvents$default (Lmoney/vivid/elmslie/core/store/Actor;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; +} + +public final class money/vivid/elmslie/core/store/EffectCachingElmStore : money/vivid/elmslie/core/store/Store { + public fun (Lmoney/vivid/elmslie/core/store/Store;)V + public fun accept (Ljava/lang/Object;)V + public fun getEffects ()Lkotlinx/coroutines/flow/Flow; + public fun getScope ()Lkotlinx/coroutines/CoroutineScope; + public fun getStartEvent ()Ljava/lang/Object; + public fun getStates ()Lkotlinx/coroutines/flow/StateFlow; + public fun start ()Lmoney/vivid/elmslie/core/store/Store; + public fun stop ()V +} + +public final class money/vivid/elmslie/core/store/ElmStore : money/vivid/elmslie/core/store/Store { + public fun (Ljava/lang/Object;Lmoney/vivid/elmslie/core/store/StateReducer;Lmoney/vivid/elmslie/core/store/Actor;Ljava/util/Set;Ljava/lang/Object;Ljava/lang/String;)V + public synthetic fun (Ljava/lang/Object;Lmoney/vivid/elmslie/core/store/StateReducer;Lmoney/vivid/elmslie/core/store/Actor;Ljava/util/Set;Ljava/lang/Object;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun accept (Ljava/lang/Object;)V + public fun getEffects ()Lkotlinx/coroutines/flow/Flow; + public fun getScope ()Lkotlinx/coroutines/CoroutineScope; + public fun getStartEvent ()Ljava/lang/Object; + public fun getStates ()Lkotlinx/coroutines/flow/StateFlow; + public fun start ()Lmoney/vivid/elmslie/core/store/Store; + public fun stop ()V +} + +public final class money/vivid/elmslie/core/store/ElmStoreKt { + public static final fun toCachedStore (Lmoney/vivid/elmslie/core/store/Store;)Lmoney/vivid/elmslie/core/store/EffectCachingElmStore; +} + +public final class money/vivid/elmslie/core/store/NoOpActor : money/vivid/elmslie/core/store/Actor { + public fun ()V + public fun execute (Ljava/lang/Object;)Lkotlinx/coroutines/flow/Flow; +} + +public final class money/vivid/elmslie/core/store/NoOpReducer : money/vivid/elmslie/core/store/StateReducer { + public fun ()V +} + +public final class money/vivid/elmslie/core/store/Result { + public fun (Ljava/lang/Object;)V + public fun (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V + public synthetic fun (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/lang/Object;Ljava/util/List;)V + public fun (Ljava/lang/Object;Ljava/util/List;Ljava/util/List;)V + public final fun component1 ()Ljava/lang/Object; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/util/List; + public final fun copy (Ljava/lang/Object;Ljava/util/List;Ljava/util/List;)Lmoney/vivid/elmslie/core/store/Result; + public static synthetic fun copy$default (Lmoney/vivid/elmslie/core/store/Result;Ljava/lang/Object;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lmoney/vivid/elmslie/core/store/Result; + public fun equals (Ljava/lang/Object;)Z + public final fun getCommands ()Ljava/util/List; + public final fun getEffects ()Ljava/util/List; + public final fun getState ()Ljava/lang/Object; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public abstract class money/vivid/elmslie/core/store/ScreenReducer : money/vivid/elmslie/core/store/StateReducer { + public fun (Lkotlin/reflect/KClass;Lkotlin/reflect/KClass;)V + protected abstract fun internal (Lmoney/vivid/elmslie/core/store/StateReducer$Result;Ljava/lang/Object;)Ljava/lang/Object; + protected fun reduce (Lmoney/vivid/elmslie/core/store/StateReducer$Result;Ljava/lang/Object;)V + protected abstract fun ui (Lmoney/vivid/elmslie/core/store/StateReducer$Result;Ljava/lang/Object;)Ljava/lang/Object; +} + +public abstract class money/vivid/elmslie/core/store/StateReducer { + public fun ()V + public final fun reduce (Ljava/lang/Object;Ljava/lang/Object;)Lmoney/vivid/elmslie/core/store/Result; + protected abstract fun reduce (Lmoney/vivid/elmslie/core/store/StateReducer$Result;Ljava/lang/Object;)V +} + +protected final class money/vivid/elmslie/core/store/StateReducer$Result : money/vivid/elmslie/core/store/dsl/ResultBuilder { + public fun (Lmoney/vivid/elmslie/core/store/StateReducer;Ljava/lang/Object;)V +} + +public abstract interface class money/vivid/elmslie/core/store/Store { + public abstract fun accept (Ljava/lang/Object;)V + public abstract fun getEffects ()Lkotlinx/coroutines/flow/Flow; + public abstract fun getScope ()Lkotlinx/coroutines/CoroutineScope; + public abstract fun getStartEvent ()Ljava/lang/Object; + public abstract fun getStates ()Lkotlinx/coroutines/flow/StateFlow; + public abstract fun start ()Lmoney/vivid/elmslie/core/store/Store; + public abstract fun stop ()V +} + +public abstract interface class money/vivid/elmslie/core/store/StoreListener { + public abstract fun onActorError (Ljava/lang/String;Ljava/lang/Throwable;Ljava/lang/Object;)V + public abstract fun onAfterEvent (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V + public abstract fun onBeforeEvent (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V + public abstract fun onCommand (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V + public abstract fun onEffect (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V + public abstract fun onReducerError (Ljava/lang/String;Ljava/lang/Throwable;Ljava/lang/Object;)V +} + +public final class money/vivid/elmslie/core/store/StoreListener$DefaultImpls { + public static fun onActorError (Lmoney/vivid/elmslie/core/store/StoreListener;Ljava/lang/String;Ljava/lang/Throwable;Ljava/lang/Object;)V + public static fun onAfterEvent (Lmoney/vivid/elmslie/core/store/StoreListener;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V + public static fun onBeforeEvent (Lmoney/vivid/elmslie/core/store/StoreListener;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V + public static fun onCommand (Lmoney/vivid/elmslie/core/store/StoreListener;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V + public static fun onEffect (Lmoney/vivid/elmslie/core/store/StoreListener;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V + public static fun onReducerError (Lmoney/vivid/elmslie/core/store/StoreListener;Ljava/lang/String;Ljava/lang/Throwable;Ljava/lang/Object;)V +} + +public final class money/vivid/elmslie/core/store/dsl/OperationsBuilder { + public fun ()V + public final fun unaryPlus (Ljava/lang/Object;)V +} + +public class money/vivid/elmslie/core/store/dsl/ResultBuilder { + public fun (Ljava/lang/Object;)V + public final fun commands (Lkotlin/jvm/functions/Function1;)V + public final fun effects (Lkotlin/jvm/functions/Function1;)V + public final fun getInitialState ()Ljava/lang/Object; + public final fun getState ()Ljava/lang/Object; + public final fun state (Lkotlin/jvm/functions/Function1;)V +} + +public final class money/vivid/elmslie/core/switcher/Switcher { + public fun ()V + public final fun cancel (J)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun cancel$default (Lmoney/vivid/elmslie/core/switcher/Switcher;JILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public final fun switch (JLkotlin/jvm/functions/Function0;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun switch$default (Lmoney/vivid/elmslie/core/switcher/Switcher;JLkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; +} + diff --git a/elmslie-core/build.gradle.kts b/elmslie-core/build.gradle.kts index 36a476e5..e586670a 100644 --- a/elmslie-core/build.gradle.kts +++ b/elmslie-core/build.gradle.kts @@ -1,5 +1,6 @@ plugins { id("elmslie.kotlin-multiplatform-lib") + alias(libs.plugins.binaryCompatibilityValidator) } kotlin { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0c1f9d04..89cf5c0e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,4 +25,5 @@ kotlinx-coroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-te [plugins] kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -androidApplication = { id = "com.android.application", version.ref = "agp" } \ No newline at end of file +androidApplication = { id = "com.android.application", version.ref = "agp" } +binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.14.0" } \ No newline at end of file