From 36480eb5395d2da8ab0875f7d45ede157313c3a8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 10 Apr 2020 14:01:13 +0600 Subject: [PATCH] fixes --- .../postssystem/core/utils/pagination/Pagination.kt | 5 ----- .../core/utils/pagination/SimplePagination.kt | 2 +- .../postssystem/core/api/ContentSerialization.kt | 4 ++-- postssystem.exposed/build.gradle | 12 +++++++++++- postssystem.exposed/gradle.properties | 1 - 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/pagination/Pagination.kt b/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/pagination/Pagination.kt index 11a3401d..87e37032 100644 --- a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/pagination/Pagination.kt +++ b/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/pagination/Pagination.kt @@ -48,8 +48,3 @@ fun calculatePagesNumber(datasetSize: Long, pageSize: Int): Int { fun calculatePagesNumber(datasetSize: Int, pageSize: Int): Int { return ceil(datasetSize.toDouble() / pageSize).toInt() } - -/** - * Calculates pages count for given [datasetSize] - */ -inline fun Pagination.calculatePagesNumber(datasetSize: Int): Int = calculatePagesNumber(datasetSize, size) diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/pagination/SimplePagination.kt b/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/pagination/SimplePagination.kt index e90f5612..b967aeaa 100644 --- a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/pagination/SimplePagination.kt +++ b/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/pagination/SimplePagination.kt @@ -10,7 +10,7 @@ const val defaultExtraLargePageSize = 15 @Suppress("NOTHING_TO_INLINE", "FunctionName") inline fun FirstPagePagination(size: Int = defaultMediumPageSize) = SimplePagination( page = 0, - size = defaultMediumPageSize + size = size ) @Suppress("NOTHING_TO_INLINE") diff --git a/postssystem.core/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt b/postssystem.core/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt index a4e0bc3d..8d03e596 100644 --- a/postssystem.core/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt +++ b/postssystem.core/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt @@ -26,11 +26,11 @@ class ContentSerialization { } val stringified = registeredContentFakes.map { - Json.plain.stringify(RegisteredContent.serializer(), it) + Json.stringify(RegisteredContent.serializer(), it) } val parsed = stringified.map { - Json.plain.parse(RegisteredContent.serializer(), it) + Json.parse(RegisteredContent.serializer(), it) } parsed.forEachIndexed { i, registeredContent -> assertEquals(registeredContentFakes[i], registeredContent) } diff --git a/postssystem.exposed/build.gradle b/postssystem.exposed/build.gradle index cf7c2439..f5b86387 100644 --- a/postssystem.exposed/build.gradle +++ b/postssystem.exposed/build.gradle @@ -38,7 +38,6 @@ kotlin { dependencies { implementation kotlin('stdlib') api "org.jetbrains.exposed:exposed-core:$exposed_version" - api "com.soywiz.korlibs.klock:klock:$klockVersion" if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { api "com.insanusmokrassar:postssystem.core:$core_version" @@ -53,6 +52,11 @@ kotlin { implementation kotlin('test-annotations-common') } } + jvmMain { + dependencies { + implementation kotlin('stdlib') + } + } jvmTest { dependencies { @@ -60,6 +64,12 @@ kotlin { implementation "org.xerial:sqlite-jdbc:$test_sqlite_version" } } + + jsMain { + dependencies { + implementation kotlin('stdlib') + } + } } } diff --git a/postssystem.exposed/gradle.properties b/postssystem.exposed/gradle.properties index 4eb6426b..2620278d 100644 --- a/postssystem.exposed/gradle.properties +++ b/postssystem.exposed/gradle.properties @@ -1,3 +1,2 @@ exposed_version=0.23.1 test_sqlite_version=3.30.1 -test_junit_version=5.5.2