Compare commits

..

1 Commits

Author SHA1 Message Date
renovate[bot]
a42ca88841 Update dependency com.android.tools.build:gradle to v9 2026-05-21 14:19:00 +00:00
11 changed files with 8 additions and 160 deletions

View File

@@ -12,7 +12,7 @@ jobs:
with:
java-version: 17
- name: Build
run: ./gradlew build && ./gradlew :micro_utils.dokka:dokkaGenerate
run: ./gradlew build && ./gradlew dokkaHtml
- name: Publish KDocs
uses: peaceiris/actions-gh-pages@v3
with:

View File

@@ -1,10 +1,5 @@
# Changelog
## 0.29.4
* `Meta`:
* Inited
## 0.29.3
* `Versions`:

View File

@@ -17,7 +17,7 @@ kotlin {
browser()
nodejs()
}
androidTarget {}
android {}
sourceSets {
commonMain {
@@ -91,7 +91,7 @@ kotlin {
private List<SourceDirectorySet> findSourcesWithName(String... approximateNames) {
return parent.subprojects
.findAll { it != project && it.hasProperty("kotlin") && (it.name.contains("dokka") == false) }
.findAll { it != project && it.hasProperty("kotlin") }
.collectMany { it.kotlin.sourceSets }
.findAll { sourceSet ->
approximateNames.any { nameToFilter ->
@@ -100,14 +100,14 @@ private List<SourceDirectorySet> findSourcesWithName(String... approximateNames)
}.collect { it.kotlin }
}
dokka {
tasks.dokkaHtml {
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
sourceLink {
localDirectory.set(file("../"))
remoteUrl.set(new URI("https://github.com/InsanusMokrassar/MicroUtils/blob/master/"))
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/MicroUtils/blob/master/"))
remoteLineSuffix.set("#L")
}
}
@@ -130,12 +130,4 @@ dokka {
}
}
//dependencies {
// project.parent.subprojects.forEach {
// if (it != project) {
// dokka(it)
// }
// }
//}
apply from: "$defaultAndroidSettings"

View File

@@ -18,5 +18,5 @@ crypto_js_version=4.1.1
# Project data
group=dev.inmo
version=0.29.4
android_code_version=314
version=0.29.3
android_code_version=313

View File

@@ -33,7 +33,7 @@ kotlin-poet = "2.3.0"
versions = "0.54.0"
nmcp = "1.5.0"
android-gradle = "8.12.+"
android-gradle = "9.2.+"
dexcount = "4.0.0"
android-coreKtx = "1.18.0"

View File

@@ -1,8 +1,6 @@
project.version = "$version"
project.group = "$group"
apply plugin: 'org.jetbrains.dokka'
kotlin {
sourceSets {
commonMain {

View File

@@ -1,12 +0,0 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "com.android.library"
}
apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {
}
}

View File

@@ -1,94 +0,0 @@
package dev.inmo.micro_utils.meta
import kotlinx.serialization.Polymorphic
import kotlinx.serialization.Serializable
/**
* A polymorphic container for storing heterogeneous key-value pairs with type-safe retrieval.
* Each key is bound to a specific type, enabling type-safe access to stored values.
*
* @property map The underlying map storing key-value pairs with polymorphic values.
*/
@Serializable
data class MetaContainer(
@MetaContainerRootMapWarning
val map: Map<Key<*>, @Polymorphic Any>
) {
/**
* A marker interface for type-safe keys in [MetaContainer].
*
* @param T The type of value associated with this key.
*/
interface Key<T : Any>
/**
* Retrieves a value from the container by its key.
*
* @param key The type-safe key to look up.
* @return The value associated with the key, or null if not present.
*/
@Suppress("UNCHECKED_CAST", "OPT_IN_USAGE")
operator fun <T : Any> get(key: Key<T>): T? = map[key] as? T?
/**
* Checks whether a value exists for the given key.
*
* @param key The type-safe key to check.
* @return true if the key exists and has a non-null value, false otherwise.
*/
operator fun <T : Any> contains(key: Key<T>): Boolean = get(key) != null
/**
* Builder for constructing [MetaContainer] instances with a fluent API.
*/
class Builder(
@MetaContainerRootMapWarning
private val map: MutableMap<Key<*>, Any> = mutableMapOf<Key<*>, Any>()
) {
/**
* Puts a value associated with the given key into the builder.
*
* @param k The type-safe key.
* @param v The value to store.
*/
fun <T : Any> put(k: Key<T>, v: T) {
map[k] = v
}
/**
* Retrieves a value from the builder by its key.
*
* @param key The type-safe key to look up.
* @return The value associated with the key, or null if not present.
*/
@Suppress("UNCHECKED_CAST")
operator fun <T : Any> get(key: Key<T>): T? = map[key] as T?
/**
* Checks whether a value exists for the given key in the builder.
*
* @param key The type-safe key to check.
* @return true if the key exists and has a non-null value, false otherwise.
*/
operator fun <T : Any> contains(key: Key<T>): Boolean = get(key) != null
/**
* Builds and returns the immutable [MetaContainer] instance.
*
* @return A new [MetaContainer] with the accumulated key-value pairs.
*/
fun build(): MetaContainer = MetaContainer(map.toMap())
}
companion object {
/**
* An empty [MetaContainer] instance with no entries.
*/
val EMPTY = MetaContainer(emptyMap())
}
}

View File

@@ -1,17 +0,0 @@
package dev.inmo.micro_utils.meta
/**
* Marks the direct use of [MetaContainer.map] as requiring explicit opt-in.
*
* This annotation warns against direct manipulation of the internal map without using
* the type-safe accessors, which could break type safety guarantees.
*/
@RequiresOptIn(
"Do not use this directly without any special reason",
RequiresOptIn.Level.WARNING
)
@Target(
AnnotationTarget.FIELD,
)
@Retention(AnnotationRetention.BINARY)
annotation class MetaContainerRootMapWarning

View File

@@ -1,13 +0,0 @@
package dev.inmo.micro_utils.meta
/**
* DSL builder function for creating a [MetaContainer] with a lambda block.
*
* @param block A lambda with receiver ([MetaContainer.Builder]) to configure the container.
* @return A new [MetaContainer] instance built from the DSL block.
*/
fun buildMetaContainer(block: MetaContainer.Builder.() -> Unit): MetaContainer {
val builder = MetaContainer.Builder()
builder.block()
return builder.build()
}

View File

@@ -1,7 +1,6 @@
rootProject.name='micro_utils'
String[] includes = [
":meta",
":common",
":common:compose",
":transactions",