mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-23 17:17:14 +00:00
commit
6d8a8ab018
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.17.7
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Android CoreKtx`: `1.9.0` -> `1.10.0`
|
||||||
|
* `Startup`:
|
||||||
|
* Add support of `linuxX64` and `mingwX64` platforms
|
||||||
|
|
||||||
## 0.17.6
|
## 0.17.6
|
||||||
|
|
||||||
* `Versions`:
|
* `Versions`:
|
||||||
|
@ -23,7 +23,7 @@ allprojects {
|
|||||||
mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerialization.gradle"
|
mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerialization.gradle"
|
||||||
mppProjectWithSerializationAndComposePresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerializationAndCompose.gradle"
|
mppProjectWithSerializationAndComposePresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerializationAndCompose.gradle"
|
||||||
mppJavaProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJavaProject.gradle"
|
mppJavaProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJavaProject.gradle"
|
||||||
mppJsAndJavaProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJsAndJavaProject.gradle"
|
mppJvmJsLinuxMingwProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJvmJsLinuxMingwProject.gradle"
|
||||||
mppAndroidProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppAndroidProject.gradle"
|
mppAndroidProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppAndroidProject.gradle"
|
||||||
|
|
||||||
defaultAndroidSettingsPresetPath = "${rootProject.projectDir.absolutePath}/defaultAndroidSettings.gradle"
|
defaultAndroidSettingsPresetPath = "${rootProject.projectDir.absolutePath}/defaultAndroidSettings.gradle"
|
||||||
|
@ -14,5 +14,5 @@ crypto_js_version=4.1.1
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.17.6
|
version=0.17.7
|
||||||
android_code_version=188
|
android_code_version=189
|
||||||
|
@ -21,13 +21,13 @@ koin = "3.4.0"
|
|||||||
|
|
||||||
okio = "3.3.0"
|
okio = "3.3.0"
|
||||||
|
|
||||||
ksp = "1.8.20-1.0.10"
|
ksp = "1.8.20-1.0.11"
|
||||||
kotlin-poet = "1.13.0"
|
kotlin-poet = "1.13.0"
|
||||||
|
|
||||||
android-gradle = "7.3.1"
|
android-gradle = "7.3.1"
|
||||||
dexcount = "4.0.0"
|
dexcount = "4.0.0"
|
||||||
|
|
||||||
android-coreKtx = "1.9.0"
|
android-coreKtx = "1.10.0"
|
||||||
android-recyclerView = "1.3.0"
|
android-recyclerView = "1.3.0"
|
||||||
android-appCompat = "1.6.1"
|
android-appCompat = "1.6.1"
|
||||||
android-fragment = "1.5.6"
|
android-fragment = "1.5.6"
|
||||||
|
@ -15,6 +15,8 @@ kotlin {
|
|||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
|
linuxX64()
|
||||||
|
mingwX64()
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
commonMain {
|
commonMain {
|
@ -4,7 +4,7 @@ plugins {
|
|||||||
id "application"
|
id "application"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$mppJsAndJavaProjectPresetPath"
|
apply from: "$mppJvmJsLinuxMingwProjectPresetPath"
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
@ -3,7 +3,7 @@ plugins {
|
|||||||
id "org.jetbrains.kotlin.plugin.serialization"
|
id "org.jetbrains.kotlin.plugin.serialization"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$mppJsAndJavaProjectPresetPath"
|
apply from: "$mppJvmJsLinuxMingwProjectPresetPath"
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@ -21,5 +21,15 @@ kotlin {
|
|||||||
api libs.uuid
|
api libs.uuid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
linuxX64Main {
|
||||||
|
dependencies {
|
||||||
|
api libs.uuid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mingwX64Main {
|
||||||
|
dependencies {
|
||||||
|
api libs.uuid
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package dev.inmo.micro_utils.startup.plugin
|
||||||
|
|
||||||
|
import com.benasher44.uuid.uuid4
|
||||||
|
import kotlinx.serialization.KSerializer
|
||||||
|
import kotlinx.serialization.builtins.serializer
|
||||||
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
|
import kotlinx.serialization.encoding.Decoder
|
||||||
|
import kotlinx.serialization.encoding.Encoder
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
actual object StartPluginSerializer : KSerializer<StartPlugin> {
|
||||||
|
private val registeredPlugins = mutableMapOf<String, StartPlugin>()
|
||||||
|
private val registeredPluginsByPlugin = mutableMapOf<StartPlugin, String>()
|
||||||
|
override val descriptor: SerialDescriptor = String.serializer().descriptor
|
||||||
|
|
||||||
|
override fun deserialize(decoder: Decoder): StartPlugin {
|
||||||
|
val name = decoder.decodeString()
|
||||||
|
return registeredPlugins[name] ?: error("Unable to find startup plugin for $name")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun serialize(encoder: Encoder, value: StartPlugin) {
|
||||||
|
val name = registeredPluginsByPlugin[value] ?: uuid4().toString().also {
|
||||||
|
registeredPlugins[it] = value
|
||||||
|
registeredPluginsByPlugin[value] = it
|
||||||
|
}
|
||||||
|
encoder.encodeString(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register plugin inside of this [KSerializer]. Since plugin has been registered, you may use its [name] in any
|
||||||
|
* serialized [dev.inmo.micro_utils.startup.launcher.Config] to retrieve [plugin] you passed here
|
||||||
|
*/
|
||||||
|
fun registerPlugin(name: String, plugin: StartPlugin) {
|
||||||
|
registeredPlugins[name] = plugin
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package dev.inmo.micro_utils.startup.plugin
|
||||||
|
|
||||||
|
import com.benasher44.uuid.uuid4
|
||||||
|
import kotlinx.serialization.KSerializer
|
||||||
|
import kotlinx.serialization.builtins.serializer
|
||||||
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
|
import kotlinx.serialization.encoding.Decoder
|
||||||
|
import kotlinx.serialization.encoding.Encoder
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
actual object StartPluginSerializer : KSerializer<StartPlugin> {
|
||||||
|
private val registeredPlugins = mutableMapOf<String, StartPlugin>()
|
||||||
|
private val registeredPluginsByPlugin = mutableMapOf<StartPlugin, String>()
|
||||||
|
override val descriptor: SerialDescriptor = String.serializer().descriptor
|
||||||
|
|
||||||
|
override fun deserialize(decoder: Decoder): StartPlugin {
|
||||||
|
val name = decoder.decodeString()
|
||||||
|
return registeredPlugins[name] ?: error("Unable to find startup plugin for $name")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun serialize(encoder: Encoder, value: StartPlugin) {
|
||||||
|
val name = registeredPluginsByPlugin[value] ?: uuid4().toString().also {
|
||||||
|
registeredPlugins[it] = value
|
||||||
|
registeredPluginsByPlugin[value] = it
|
||||||
|
}
|
||||||
|
encoder.encodeString(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register plugin inside of this [KSerializer]. Since plugin has been registered, you may use its [name] in any
|
||||||
|
* serialized [dev.inmo.micro_utils.startup.launcher.Config] to retrieve [plugin] you passed here
|
||||||
|
*/
|
||||||
|
fun registerPlugin(name: String, plugin: StartPlugin) {
|
||||||
|
registeredPlugins[name] = plugin
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user