experimentally add uuid library

This commit is contained in:
InsanusMokrassar 2019-11-05 12:14:36 +06:00
parent 5b3b3afe8d
commit 6a4b904b9a
4 changed files with 4 additions and 6 deletions

View File

@ -36,6 +36,7 @@ kotlin {
api "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$kotlin_serialisation_runtime_version"
api "com.soywiz.korlibs.klock:klock:$klockVersion"
api "com.benasher44:uuid:$uuidVersion"
}
}
jvm8Main {

View File

@ -1,9 +1,10 @@
package com.insanusmokrassar.postssystem.core.utils
import com.benasher44.uuid.uuid4
import com.insanusmokrassar.postssystem.core.content.ContentId
import com.insanusmokrassar.postssystem.core.post.PostId
internal expect fun generateId(): String
private fun generateId() = uuid4().toString()
internal fun generatePostId(): PostId = generateId()
internal fun generateContentId(): ContentId = generateId()

View File

@ -1,5 +0,0 @@
package com.insanusmokrassar.postssystem.core.utils
import java.util.*
internal actual fun generateId(): String = UUID.randomUUID().toString()

View File

@ -4,6 +4,7 @@ kotlin_coroutines_version=1.3.1
kotlin_serialisation_runtime_version=0.13.0
klockVersion=1.7.3
uuidVersion=0.0.5
gradle_bintray_plugin_version=1.8.4