update dependencies

This commit is contained in:
InsanusMokrassar 2022-04-01 22:31:59 +06:00
parent 37114f0ddb
commit a993459b97
11 changed files with 109 additions and 58 deletions

View File

@ -7,11 +7,12 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.4' classpath libs.buildscript.kt.gradle
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath libs.buildscript.kt.serialization
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" classpath libs.buildscript.jb.dokka
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version" classpath libs.buildscript.gh.release
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" classpath libs.buildscript.android.gradle
classpath libs.buildscript.android.dexcount
} }
} }

View File

@ -40,7 +40,7 @@ kotlin {
jvmMain { jvmMain {
dependencies { dependencies {
api "io.ktor:ktor-client-apache:$ktor_version" api libs.ktor.client.apache
} }
} }

View File

@ -26,12 +26,12 @@ android {
} }
} }
compileSdkVersion "$android_compileSdkVersion".toInteger() compileSdkVersion libs.versions.android.props.compileSdk.get().toInteger()
buildToolsVersion "$android_buildToolsVersion" buildToolsVersion libs.versions.android.props.buildTools.get()
defaultConfig { defaultConfig {
minSdkVersion "$android_minSdkVersion".toInteger() minSdkVersion libs.versions.android.props.minSdk.get().toInteger()
targetSdkVersion "$android_compileSdkVersion".toInteger() targetSdkVersion libs.versions.android.props.compileSdk.get().toInteger()
versionCode "${android_code_version}".toInteger() versionCode "${android_code_version}".toInteger()
versionName "$version" versionName "$version"
} }

View File

@ -1,14 +1,12 @@
package dev.inmo.postssystem.features.auth.client.ui package dev.inmo.postssystem.features.auth.client.ui
import dev.inmo.postssystem.features.common.common.ui.fsm.UIFSMState import dev.inmo.postssystem.features.common.common.ui.fsm.UIFSMState
import dev.inmo.postssystem.features.common.common.ui.fsm.UIFSMStateSerializer
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
@Serializable @Serializable
data class AuthUIFSMState( data class AuthUIFSMState(
@Serializable(UIFSMStateSerializer::class)
override val from: UIFSMState?, override val from: UIFSMState?,
override val context: String = "main" override val context: String = "main"
) : UIFSMState { ) : UIFSMState
companion object {
val default = AuthUIFSMState(null)
}
}

View File

@ -3,10 +3,49 @@ package dev.inmo.postssystem.features.auth.common
import com.benasher44.uuid.uuid4 import com.benasher44.uuid.uuid4
import dev.inmo.postssystem.features.users.common.Username import dev.inmo.postssystem.features.users.common.Username
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlin.jvm.JvmInline import kotlin.jvm.JvmInline
@Serializable(AuthKeySerializer::class)
sealed interface AuthKey sealed interface AuthKey
@Serializable
private data class AuthKeySurrogate(
val authCreds: AuthCreds?,
val token: AuthToken?,
val refreshToken: RefreshToken?
)
@Serializer(AuthKey::class)
object AuthKeySerializer : KSerializer<AuthKey> {
override val descriptor: SerialDescriptor
get() = AuthKeySurrogate.serializer().descriptor
override fun deserialize(decoder: Decoder): AuthKey {
val surrogate = AuthKeySurrogate.serializer().deserialize(decoder)
when {
surrogate.authCreds != null -> return surrogate.authCreds
surrogate.token != null -> return surrogate.token
surrogate.refreshToken != null -> return surrogate.refreshToken
}
error("Unsupported version of auth key surrogate")
}
override fun serialize(encoder: Encoder, value: AuthKey) {
AuthKeySurrogate.serializer().serialize(
encoder,
AuthKeySurrogate(
value as? AuthCreds,
value as? AuthToken,
value as? RefreshToken
)
)
}
}
@Serializable @Serializable
@SerialName("authcreds") @SerialName("authcreds")
data class AuthCreds( data class AuthCreds(

View File

@ -13,8 +13,8 @@ kotlin {
dependencies { dependencies {
api project(":postssystem.features.common.common") api project(":postssystem.features.common.common")
api libs.microutils.repos.ktor.client api libs.microutils.repos.ktor.client
api "io.ktor:ktor-client-auth:$ktor_version" api libs.ktor.client.auth
api "io.ktor:ktor-client-logging:$ktor_version" api libs.ktor.client.logging
api libs.microutils.common.compose api libs.microutils.common.compose
api libs.microutils.coroutines.compose api libs.microutils.coroutines.compose

View File

@ -14,19 +14,19 @@ kotlin {
api libs.microutils.serialization.typedserializer api libs.microutils.serialization.typedserializer
api libs.microutils.mimetypes api libs.microutils.mimetypes
api libs.klock api libs.klock
api "io.insert-koin:koin-core:$koin_version" api libs.koin.core
api "com.benasher44:uuid:$uuid_version" api libs.uuid
api "io.ktor:ktor-http:$ktor_version" api libs.ktor.http
} }
} }
jvmMain { jvmMain {
dependencies { dependencies {
api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" api libs.kotlin.reflect
} }
} }
androidMain { androidMain {
dependencies { dependencies {
api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" api libs.kotlin.reflect
} }
} }
} }

View File

@ -17,8 +17,8 @@ kotlin {
} }
jvmMain { jvmMain {
dependencies { dependencies {
api "io.ktor:ktor-auth:$ktor_version" api libs.ktor.auth
api "ch.qos.logback:logback-classic:$logback_version" api libs.logback
} }
} }
} }

View File

@ -15,8 +15,8 @@ kotlin {
} }
jvmMain { jvmMain {
dependencies { dependencies {
api "io.ktor:ktor-auth:$ktor_version" api libs.ktor.auth
api "io.ktor:ktor-server-sessions:$ktor_version" api libs.ktor.server.sessions
} }
} }
} }

View File

@ -7,34 +7,6 @@ kotlin.incremental.js=true
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
# Common
kotlin_version=1.6.10
kotlin_serialisation_core_version=1.3.2
koin_version=3.1.2
ktor_version=1.6.7
logback_version=1.2.10
uuid_version=0.4.0
# JS
kotlinx_html_version=0.7.3
# ANDROID
android_minSdkVersion=21
android_compileSdkVersion=32
android_buildToolsVersion=32.0.0
dexcount_version=3.0.1
junit_version=4.12
test_ext_junit_version=1.1.2
espresso_core=3.3.0
# Dokka
dokka_version=1.6.10
# Project data # Project data
group=dev.inmo group=dev.inmo

View File

@ -2,24 +2,44 @@
kotlin = "1.6.10" kotlin = "1.6.10"
kotlin-serialization = "1.3.2" kotlin-serialization = "1.3.2"
jsuikit = "0.0.45" jsuikit = "0.0.48"
compose = "1.1.1" compose = "1.1.1"
microutils = "0.9.16" microutils = "0.9.18"
tgbotapi = "0.38.9" tgbotapi = "0.38.11"
ktor = "1.6.8" ktor = "1.6.8"
klock = "2.6.3" klock = "2.7.0"
koin = "3.1.5"
exposed = "0.37.3" exposed = "0.37.3"
psql = "42.3.0" psql = "42.3.0"
scrimage = "4.0.31" scrimage = "4.0.31"
dokka = "1.6.10"
logback = "1.2.10"
uuid = "0.4.0"
android-dexcount = "3.0.1" android-dexcount = "3.0.1"
android-junit = "4.12" android-junit = "4.12"
android-test-junit = "1.1.2" android-test-junit = "1.1.2"
android-espresso-core = "3.3.0" android-espresso-core = "3.3.0"
gh-release = "2.2.12"
android-gradle = "7.0.4"
dexcount = "3.0.1"
android-coreKtx = "1.7.0"
android-recyclerView = "1.2.1"
android-appCompat = "1.4.1"
android-espresso = "3.3.0"
android-test = "1.1.2"
android-props-minSdk = "19"
android-props-compileSdk = "32"
android-props-buildTools = "32.0.0"
[libraries] [libraries]
kotlin-std = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } kotlin-std = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" } kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" }
kotlin-serialization-properties = { module = "org.jetbrains.kotlinx:kotlinx-serialization-properties", version.ref = "kotlin-serialization" } kotlin-serialization-properties = { module = "org.jetbrains.kotlinx:kotlinx-serialization-properties", version.ref = "kotlin-serialization" }
@ -29,9 +49,21 @@ postgresql = { module = "org.postgresql:postgresql", version.ref = "psql" }
exposed-jdbs = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" } exposed-jdbs = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" }
ktor-client-apache = { module = "io.ktor:ktor-client-apache", version.ref = "ktor" }
ktor-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" }
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
ktor-http = { module = "io.ktor:ktor-http", version.ref = "ktor" }
ktor-auth = { module = "io.ktor:ktor-auth", version.ref = "ktor" }
ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" } ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" }
ktor-server-sessions = { module = "io.ktor:ktor-server-sessions", version.ref = "ktor" }
ktor-websockets = { module = "io.ktor:ktor-websockets", version.ref = "ktor" } ktor-websockets = { module = "io.ktor:ktor-websockets", version.ref = "ktor" }
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
microutils-common = { module = "dev.inmo:micro_utils.common", version.ref = "microutils" } microutils-common = { module = "dev.inmo:micro_utils.common", version.ref = "microutils" }
microutils-common-compose = { module = "dev.inmo:micro_utils.common.compose", version.ref = "microutils" } microutils-common-compose = { module = "dev.inmo:micro_utils.common.compose", version.ref = "microutils" }
microutils-pagination-common = { module = "dev.inmo:micro_utils.pagination.common", version.ref = "microutils" } microutils-pagination-common = { module = "dev.inmo:micro_utils.pagination.common", version.ref = "microutils" }
@ -57,6 +89,15 @@ scrimage = { module = "com.sksamuel.scrimage:scrimage-core", version.ref = "scri
androidx-test-junit = { module = "androidx.test.ext:junit", version.ref = "android-test-junit" } androidx-test-junit = { module = "androidx.test.ext:junit", version.ref = "android-test-junit" }
androidx-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "android-espresso-core" } androidx-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "android-espresso-core" }
# classpaths
buildscript-kt-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
buildscript-kt-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
buildscript-jb-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
buildscript-gh-release = { module = "com.github.breadmoirai:github-release", version.ref = "gh-release" }
buildscript-android-gradle = { module = "com.android.tools.build:gradle", version.ref = "android-gradle" }
buildscript-android-dexcount = { module = "com.getkeepsafe.dexcount:dexcount-gradle-plugin", version.ref = "dexcount" }
[plugins] [plugins]
compose = { id = "org.jetbrains.compose", version.ref = "compose" } compose = { id = "org.jetbrains.compose", version.ref = "compose" }