MicroUtils
This is a library with collection of tools for working in Kotlin environment. First of all, this library collection is oriented to use next technologies:
Android environment
You always can look at the properties file to get information about current project dependencies, compile and build tools for Android target.
Projects
commoncontains common tools for platform which usually are absent out-of-the-box when you starting projectselectorcontains tools to useSelectorinterface with things likeRecyclerViewin android or other selection needscoroutinesis a module forKotlin Coroutineswith different things like subscribing on flows (onEach+launchInshortcut :) )ktoris a set of modules forclients andserversmime_typesis NOT lightweight set ofMimeTypes with a lot of different objected and serializable (withKotlin Serialization) mime typespaginationis a complex of modules (explanation in Complex modules structure section) for lightweight paginationserializationis a collection of projects with serializers forkotlinx.serializationreposis a complex of modules (explanation in Complex modules structure section) forKeyValue/OneToMany/CRUDrepos created to be able to exclude some heavy dependencies when you need some simple and lightweight typical repositories
Complex modules structure
Most of complex modules are built with next hierarchy:
commonsubmodule forAPIthings which are common for all platformsexposedsubmodule contains realizations for exposed tablesktorsubmodule is usually unavailable directly, because it contains its own submodules for clients and serverscommonpart contains routes which are common for clients and serversclientsubmodule contains clients which are usually usingUnifiedRequesterto make requests using routes fromktor/commonmodule and some internal logic of requestsserversubmodule (in most casesJVM-only) contains some extensions forRouteinstances which usually will give opportunity to proxy internet requests fromktor/clientrealization to some proxy object
Gradle Templates
All templates can be used by applying them in your project's build.gradle files using the apply from directive. For example:
apply from: "$defaultProject"
In the sample has been used defaultProject.gradle as a basic template.
The project includes a collection of Gradle templates to simplify project setup and configuration. These templates are located in the gradle/templates directory and can be used to quickly set up different types of projects:
Project Setup Templates
defaultProject.gradle(usageapply from: "$defaultProject") - Basic project configurationdefaultProjectWithSerialization.gradle(usageapply from: "$defaultProjectWithSerialization") - Project configuration with Kotlin Serialization supportmppJavaProject.gradle(usageapply from: "$mppJavaProject") - Multiplatform project with Java supportmppAndroidProject.gradle(usageapply from: "$mppAndroidProject") - Multiplatform project with Android support
Multiplatform Configuration Templates
enableMPPAndroid.gradle(usageapply from: "$enableMPPAndroid") - Enable Android target in multiplatform projectenableMPPJs.gradle(usageapply from: "$enableMPPJs") - Enable JavaScript target in multiplatform projectenableMPPJvm.gradle(usageapply from: "$enableMPPJvm") - Enable JVM target in multiplatform projectenableMPPNativeArm64.gradle(usageapply from: "$enableMPPNativeArm64") - Enable ARM64 native targetenableMPPNativeX64.gradle(usageapply from: "$enableMPPNativeX64") - Enable x64 native targetenableMPPWasmJs.gradle(usageapply from: "$enableMPPWasmJs") - Enable WebAssembly JavaScript target
Compose Integration Templates
addCompose.gradle(usageapply from: "$addCompose") - Basic Compose configurationaddComposeForAndroid.gradle(usageapply from: "$addComposeForAndroid") - Compose configuration for AndroidaddComposeForDesktop.gradle(usageapply from: "$addComposeForDesktop") - Compose configuration for DesktopaddComposeForJs.gradle(usageapply from: "$addComposeForJs") - Compose configuration for JavaScript
Publishing Templates
publish.gradle(usageapply from: "$publish") - General publishing configurationpublish_jvm.gradle(usageapply from: "$publish_jvm") - JVM-specific publishing configurationpublish.kpsbandpublish_jvm.kpsb(usageapply from: "$publish_kpsb"andapply from: "$publish_jvm_kpsb") - Publishing configuration for Kotlin Multiplatform and JVM
Combined Project Templates
mppJvmJsWasmJsLinuxMingwProject.gradle(usageapply from: "$mppJvmJsWasmJsLinuxMingwProject") - Multiplatform project for JVM, JS, Wasm, Linux, and MinGWmppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle(usageapply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project") - Multiplatform project with additional Android and ARM64 supportmppComposeJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle(usageapply from: "$mppComposeJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project") - Multiplatform project with Compose supportmppProjectWithSerializationAndCompose.gradle(usageapply from: "$mppProjectWithSerializationAndCompose") - Multiplatform project with both Serialization and Compose support