mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-18 23:09:23 +00:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
ae546dd9ad | |||
8110c42be0 | |||
bd2b5ae5fc | |||
2ddfffa6a9 | |||
a4b54e861d | |||
c6785f1a4f | |||
83fe621c56 | |||
b3a93e17eb | |||
546a391af3 | |||
786cf9bd8b | |||
dfd6fe062d | |||
b6ef818613 |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,5 +1,27 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.19.6
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Coroutines`: `1.6.4` -> `1.7.1`
|
||||||
|
* `Ktor`: `2.3.1` -> `2.3.2`
|
||||||
|
* `Compose`: `1.4.0` -> `1.4.1`
|
||||||
|
|
||||||
|
## 0.19.5
|
||||||
|
|
||||||
|
* `Repos`:
|
||||||
|
* `Generator`:
|
||||||
|
* Fixes in new type generation
|
||||||
|
|
||||||
|
## 0.19.4
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Koin`: `3.4.1` -> `3.4.2`
|
||||||
|
* `Android Fragments`: `1.5.7` -> `1.6.0`
|
||||||
|
* `Koin`
|
||||||
|
* `Generator`
|
||||||
|
* Fixes in new generic generator part
|
||||||
|
|
||||||
## 0.19.3
|
## 0.19.3
|
||||||
|
|
||||||
* `Koin`
|
* `Koin`
|
||||||
|
@@ -17,6 +17,10 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
alias(libs.plugins.versions)
|
||||||
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
@@ -38,3 +42,4 @@ allprojects {
|
|||||||
|
|
||||||
apply from: "./extensions.gradle"
|
apply from: "./extensions.gradle"
|
||||||
apply from: "./github_release.gradle"
|
apply from: "./github_release.gradle"
|
||||||
|
apply from: "./versions_plugin_setup.gradle"
|
||||||
|
@@ -14,5 +14,5 @@ crypto_js_version=4.1.1
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.19.3
|
version=0.19.6
|
||||||
android_code_version=199
|
android_code_version=202
|
||||||
|
@@ -2,35 +2,37 @@
|
|||||||
|
|
||||||
kt = "1.8.20"
|
kt = "1.8.20"
|
||||||
kt-serialization = "1.5.1"
|
kt-serialization = "1.5.1"
|
||||||
kt-coroutines = "1.6.4"
|
kt-coroutines = "1.7.1"
|
||||||
|
|
||||||
kslog = "1.1.1"
|
kslog = "1.1.1"
|
||||||
|
|
||||||
jb-compose = "1.4.0"
|
jb-compose = "1.4.1"
|
||||||
jb-exposed = "0.41.1"
|
jb-exposed = "0.41.1"
|
||||||
jb-dokka = "1.8.20"
|
jb-dokka = "1.8.20"
|
||||||
|
|
||||||
korlibs = "4.0.3"
|
korlibs = "4.0.3"
|
||||||
uuid = "0.7.1"
|
uuid = "0.7.1"
|
||||||
|
|
||||||
ktor = "2.3.1"
|
ktor = "2.3.2"
|
||||||
|
|
||||||
gh-release = "2.4.1"
|
gh-release = "2.4.1"
|
||||||
|
|
||||||
koin = "3.4.1"
|
koin = "3.4.2"
|
||||||
|
|
||||||
okio = "3.3.0"
|
okio = "3.3.0"
|
||||||
|
|
||||||
ksp = "1.8.20-1.0.11"
|
ksp = "1.8.20-1.0.11"
|
||||||
kotlin-poet = "1.14.2"
|
kotlin-poet = "1.14.2"
|
||||||
|
|
||||||
|
versions = "0.47.0"
|
||||||
|
|
||||||
android-gradle = "7.4.2"
|
android-gradle = "7.4.2"
|
||||||
dexcount = "4.0.0"
|
dexcount = "4.0.0"
|
||||||
|
|
||||||
android-coreKtx = "1.10.1"
|
android-coreKtx = "1.10.1"
|
||||||
android-recyclerView = "1.3.0"
|
android-recyclerView = "1.3.0"
|
||||||
android-appCompat = "1.6.1"
|
android-appCompat = "1.6.1"
|
||||||
android-fragment = "1.5.7"
|
android-fragment = "1.6.0"
|
||||||
android-espresso = "3.5.1"
|
android-espresso = "3.5.1"
|
||||||
android-test = "1.1.5"
|
android-test = "1.1.5"
|
||||||
|
|
||||||
@@ -109,3 +111,5 @@ buildscript-android-dexcount = { module = "com.getkeepsafe.dexcount:dexcount-gra
|
|||||||
[plugins]
|
[plugins]
|
||||||
|
|
||||||
jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" }
|
jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" }
|
||||||
|
|
||||||
|
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
||||||
|
@@ -13,3 +13,8 @@ dependencies {
|
|||||||
api libs.kotlin.poet
|
api libs.kotlin.poet
|
||||||
api libs.ksp
|
api libs.ksp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
@@ -127,7 +127,7 @@ class Processor(
|
|||||||
addModifiers(KModifier.INLINE)
|
addModifiers(KModifier.INLINE)
|
||||||
targetTypeAsGenericType ?.let {
|
targetTypeAsGenericType ?.let {
|
||||||
addTypeVariable(it)
|
addTypeVariable(it)
|
||||||
returns(it)
|
returns(it.copy(nullable = nullable))
|
||||||
} ?: returns(targetType)
|
} ?: returns(targetType)
|
||||||
addCode(
|
addCode(
|
||||||
"return " + (if (nullable) {
|
"return " + (if (nullable) {
|
||||||
|
@@ -97,3 +97,28 @@ public inline fun <reified T : Any> Module.singleTest(createdAtStart: Boolean =
|
|||||||
*/
|
*/
|
||||||
public inline fun <reified T : Any> Module.factoryTest(noinline definition: Definition<T>):
|
public inline fun <reified T : Any> Module.factoryTest(noinline definition: Definition<T>):
|
||||||
KoinDefinition<T> = factory(named("test"), definition = definition)
|
KoinDefinition<T> = factory(named("test"), definition = definition)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Definition by key "testNullable" with [parameters]
|
||||||
|
*/
|
||||||
|
public inline fun <reified T : Any> Scope.testNullable(noinline parameters: ParametersDefinition? =
|
||||||
|
null): T? = getOrNull(named("testNullable"), parameters)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Definition by key "testNullable" with [parameters]
|
||||||
|
*/
|
||||||
|
public inline fun <reified T : Any> Koin.testNullable(noinline parameters: ParametersDefinition? =
|
||||||
|
null): T? = getOrNull(named("testNullable"), parameters)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will register [definition] with [org.koin.core.module.Module.single] and key "testNullable"
|
||||||
|
*/
|
||||||
|
public inline fun <reified T : Any> Module.singleTestNullable(createdAtStart: Boolean = false,
|
||||||
|
noinline definition: Definition<T>): KoinDefinition<T> = single(named("testNullable"),
|
||||||
|
createdAtStart = createdAtStart, definition = definition)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will register [definition] with [org.koin.core.module.Module.factory] and key "testNullable"
|
||||||
|
*/
|
||||||
|
public inline fun <reified T : Any> Module.factoryTestNullable(noinline definition: Definition<T>):
|
||||||
|
KoinDefinition<T> = factory(named("testNullable"), definition = definition)
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
@file:GenerateKoinDefinition("sampleInfo", Test::class, String::class, nullable = false)
|
@file:GenerateKoinDefinition("sampleInfo", Test::class, String::class, nullable = false)
|
||||||
@file:GenerateGenericKoinDefinition("test", nullable = false)
|
@file:GenerateGenericKoinDefinition("test", nullable = false)
|
||||||
|
@file:GenerateGenericKoinDefinition("testNullable", nullable = true)
|
||||||
package dev.inmo.micro_utils.koin.generator.test
|
package dev.inmo.micro_utils.koin.generator.test
|
||||||
|
|
||||||
import dev.inmo.micro_utils.koin.annotations.GenerateGenericKoinDefinition
|
import dev.inmo.micro_utils.koin.annotations.GenerateGenericKoinDefinition
|
||||||
|
@@ -14,3 +14,8 @@ dependencies {
|
|||||||
api libs.kotlin.poet
|
api libs.kotlin.poet
|
||||||
api libs.ksp
|
api libs.ksp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
@@ -100,7 +100,11 @@ class Processor(
|
|||||||
primaryConstructor(
|
primaryConstructor(
|
||||||
FunSpec.constructorBuilder().apply {
|
FunSpec.constructorBuilder().apply {
|
||||||
ksClassProperties.forEach {
|
ksClassProperties.forEach {
|
||||||
addParameter(it.simpleName.getShortName(), it.typeName)
|
addParameter(
|
||||||
|
ParameterSpec.builder(it.simpleName.getShortName(), it.typeName).apply {
|
||||||
|
annotations += it.annotations.map { it.toAnnotationSpec() }
|
||||||
|
}.build()
|
||||||
|
)
|
||||||
typeBuilder.addProperty(
|
typeBuilder.addProperty(
|
||||||
PropertySpec.builder(it.simpleName.getShortName(), it.typeName, KModifier.OVERRIDE).apply {
|
PropertySpec.builder(it.simpleName.getShortName(), it.typeName, KModifier.OVERRIDE).apply {
|
||||||
initializer(it.simpleName.getShortName())
|
initializer(it.simpleName.getShortName())
|
||||||
|
@@ -11,18 +11,20 @@ import kotlinx.serialization.Serializable
|
|||||||
@Serializable
|
@Serializable
|
||||||
@SerialName(value = "NewTest")
|
@SerialName(value = "NewTest")
|
||||||
public data class NewTest(
|
public data class NewTest(
|
||||||
public override val property1: String,
|
override val property1: String,
|
||||||
public override val property2: Int,
|
override val property2: Int,
|
||||||
public override val parent: ParentTypeId?,
|
@Serializable
|
||||||
|
override val parent: ParentTypeId?,
|
||||||
) : Test
|
) : Test
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@SerialName(value = "RegisteredTest")
|
@SerialName(value = "RegisteredTest")
|
||||||
public data class RegisteredTest(
|
public data class RegisteredTest(
|
||||||
public override val id: TestId,
|
override val id: TestId,
|
||||||
public override val property1: String,
|
override val property1: String,
|
||||||
public override val property2: Int,
|
override val property2: Int,
|
||||||
public override val parent: ParentTypeId?,
|
@Serializable
|
||||||
|
override val parent: ParentTypeId?,
|
||||||
) : Test, IRegisteredTest
|
) : Test, IRegisteredTest
|
||||||
|
|
||||||
public fun Test.asNew(): NewTest = NewTest(property1, property2, parent)
|
public fun Test.asNew(): NewTest = NewTest(property1, property2, parent)
|
||||||
|
@@ -17,6 +17,7 @@ typealias ParentTypeId = TestId
|
|||||||
sealed interface Test {
|
sealed interface Test {
|
||||||
val property1: String
|
val property1: String
|
||||||
val property2: Int
|
val property2: Int
|
||||||
|
@Serializable
|
||||||
val parent: ParentTypeId?
|
val parent: ParentTypeId?
|
||||||
|
|
||||||
@GenerateCRUDModelExcludeOverride
|
@GenerateCRUDModelExcludeOverride
|
||||||
|
11
versions_plugin_setup.gradle
Normal file
11
versions_plugin_setup.gradle
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
def isNonStable = { String version ->
|
||||||
|
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
|
||||||
|
def regex = /^[0-9,.v-]+(-r)?$/
|
||||||
|
return !stableKeyword && !(version ==~ regex)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named("dependencyUpdates").configure {
|
||||||
|
rejectVersionIf {
|
||||||
|
isNonStable(it.candidate.version)
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user