now poject is multiplatform

This commit is contained in:
InsanusMokrassar 2019-11-05 11:26:42 +06:00
parent 6c50bb0e97
commit dfc2824d7a
19 changed files with 30 additions and 18 deletions

View File

@ -1,4 +1,4 @@
project.group = "com.insanusmokrassar" project.group = "$project_public_group"
buildscript { buildscript {
repositories { repositories {

View File

@ -15,9 +15,8 @@ buildscript {
} }
} }
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'kotlinx-serialization' apply plugin: 'kotlinx-serialization'
apply plugin: 'kotlin-multiplatform'
repositories { repositories {
mavenLocal() mavenLocal()
@ -26,15 +25,24 @@ repositories {
maven { url "https://kotlin.bintray.com/kotlinx" } maven { url "https://kotlin.bintray.com/kotlinx" }
} }
dependencies { kotlin {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" jvm("jvm8")
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
api "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlin_serialisation_runtime_version"
api "joda-time:joda-time:$joda_time_version"
}
compileKotlin { sourceSets {
kotlinOptions { commonMain {
freeCompilerArgs = [ disableImplicitReflectionSerializerAnnotation ] dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
api "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$kotlin_coroutines_version"
api "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$kotlin_serialisation_runtime_version"
api "com.soywiz.korlibs.klock:klock:$klockVersion"
}
}
jvm8Main {
dependencies {
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
api "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlin_serialisation_runtime_version"
}
}
} }
} }

View File

@ -1,7 +1,7 @@
package com.insanusmokrassar.postssystem.core.post package com.insanusmokrassar.postssystem.core.post
import com.insanusmokrassar.postssystem.core.content.ContentId import com.insanusmokrassar.postssystem.core.content.ContentId
import org.joda.time.DateTime import com.soywiz.klock.DateTime
typealias PostId = String typealias PostId = String
typealias ContentIds = List<ContentId> typealias ContentIds = List<ContentId>

View File

@ -7,7 +7,7 @@ import com.insanusmokrassar.postssystem.core.utils.MAX_DATE
import com.insanusmokrassar.postssystem.core.utils.MIN_DATE import com.insanusmokrassar.postssystem.core.utils.MIN_DATE
import com.insanusmokrassar.postssystem.core.utils.pagination.Pagination import com.insanusmokrassar.postssystem.core.utils.pagination.Pagination
import com.insanusmokrassar.postssystem.core.utils.pagination.PaginationResult import com.insanusmokrassar.postssystem.core.utils.pagination.PaginationResult
import org.joda.time.DateTime import com.soywiz.klock.DateTime
/** /**
* Simple read API by different properties * Simple read API by different properties

View File

@ -1,6 +1,6 @@
package com.insanusmokrassar.postssystem.core.utils package com.insanusmokrassar.postssystem.core.utils
import org.joda.time.DateTime import com.soywiz.klock.DateTime
internal val MIN_DATE = DateTime(0) internal val MIN_DATE = DateTime(0)
internal val MAX_DATE = DateTime(Long.MAX_VALUE) internal val MAX_DATE = DateTime(Long.MAX_VALUE)

View File

@ -2,9 +2,8 @@ package com.insanusmokrassar.postssystem.core.utils
import com.insanusmokrassar.postssystem.core.content.ContentId import com.insanusmokrassar.postssystem.core.content.ContentId
import com.insanusmokrassar.postssystem.core.post.PostId import com.insanusmokrassar.postssystem.core.post.PostId
import java.util.*
private fun generateId() = UUID.randomUUID().toString() internal expect fun generateId(): String
internal fun generatePostId(): PostId = generateId() internal fun generatePostId(): PostId = generateId()
internal fun generateContentId(): ContentId = generateId() internal fun generateContentId(): ContentId = generateId()

View File

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

View File

@ -3,7 +3,7 @@ kotlin_version=1.3.50
kotlin_coroutines_version=1.3.1 kotlin_coroutines_version=1.3.1
kotlin_serialisation_runtime_version=0.13.0 kotlin_serialisation_runtime_version=0.13.0
joda_time_version=2.10.3 klockVersion=1.7.3
gradle_bintray_plugin_version=1.8.4 gradle_bintray_plugin_version=1.8.4