From e3b0cc13573661984c906aeee5ffb74677b09921 Mon Sep 17 00:00:00 2001 From: alexander Date: Sat, 27 Nov 2021 17:02:14 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20binary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/content/binary/client/build.gradle | 18 ++++++++++++++++++ .../binary/client/src/main/AndroidManifest.xml | 1 + features/content/binary/common/build.gradle | 17 +++++++++++++++++ .../BinaryContent.kt | 9 +++++++++ ...inaryContentSerializerModuleConfigurator.kt | 11 +++++++++++ .../binary/common/src/main/AndroidManifest.xml | 1 + features/content/binary/server/build.gradle | 17 +++++++++++++++++ gradle.properties | 2 +- settings.gradle | 4 ++++ 9 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 features/content/binary/client/build.gradle create mode 100644 features/content/binary/client/src/main/AndroidManifest.xml create mode 100644 features/content/binary/common/build.gradle create mode 100644 features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt create mode 100644 features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt create mode 100644 features/content/binary/common/src/main/AndroidManifest.xml create mode 100644 features/content/binary/server/build.gradle diff --git a/features/content/binary/client/build.gradle b/features/content/binary/client/build.gradle new file mode 100644 index 00000000..fa327c6b --- /dev/null +++ b/features/content/binary/client/build.gradle @@ -0,0 +1,18 @@ +plugins { + id "org.jetbrains.kotlin.multiplatform" + id "org.jetbrains.kotlin.plugin.serialization" + id "com.android.library" +} + +apply from: "$mppProjectWithSerializationPresetPath" + +kotlin { + sourceSets { + commonMain { + dependencies { + api project(":postssystem.features.content.binary.common") + api project(":postssystem.features.common.client") + } + } + } +} diff --git a/features/content/binary/client/src/main/AndroidManifest.xml b/features/content/binary/client/src/main/AndroidManifest.xml new file mode 100644 index 00000000..85ed176b --- /dev/null +++ b/features/content/binary/client/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/features/content/binary/common/build.gradle b/features/content/binary/common/build.gradle new file mode 100644 index 00000000..d4a562e5 --- /dev/null +++ b/features/content/binary/common/build.gradle @@ -0,0 +1,17 @@ +plugins { + id "org.jetbrains.kotlin.multiplatform" + id "org.jetbrains.kotlin.plugin.serialization" + id "com.android.library" +} + +apply from: "$mppProjectWithSerializationPresetPath" + +kotlin { + sourceSets { + commonMain { + dependencies { + api project(":postssystem.features.common.common") + } + } + } +} diff --git a/features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt b/features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt new file mode 100644 index 00000000..8c5ea30a --- /dev/null +++ b/features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt @@ -0,0 +1,9 @@ +package dev.inmo.postssystem.features.content.binary.common + +import dev.inmo.postssystem.features.content.common.Content +import kotlinx.serialization.Serializable + +@Serializable +data class BinaryContent( + val bytes: ByteArray +) : Content \ No newline at end of file diff --git a/features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt b/features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt new file mode 100644 index 00000000..ad2d8bf0 --- /dev/null +++ b/features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt @@ -0,0 +1,11 @@ +package dev.inmo.postssystem.features.content.binary.common + +import dev.inmo.postssystem.features.content.common.Content +import dev.inmo.postssystem.features.content.common.ContentSerializersModuleConfigurator +import kotlinx.serialization.modules.PolymorphicModuleBuilder + +object BinaryContentSerializerModuleConfigurator : ContentSerializersModuleConfigurator.Element { + override fun PolymorphicModuleBuilder.invoke() { + subclass(BinaryContent::class, BinaryContent.serializer()) + } +} \ No newline at end of file diff --git a/features/content/binary/common/src/main/AndroidManifest.xml b/features/content/binary/common/src/main/AndroidManifest.xml new file mode 100644 index 00000000..39d05da4 --- /dev/null +++ b/features/content/binary/common/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/features/content/binary/server/build.gradle b/features/content/binary/server/build.gradle new file mode 100644 index 00000000..148d393a --- /dev/null +++ b/features/content/binary/server/build.gradle @@ -0,0 +1,17 @@ +plugins { + id "org.jetbrains.kotlin.multiplatform" + id "org.jetbrains.kotlin.plugin.serialization" +} + +apply from: "$mppJavaProjectPresetPath" + +kotlin { + sourceSets { + commonMain { + dependencies { + api project(":postssystem.features.content.binary.common") + api project(":postssystem.features.common.server") + } + } + } +} diff --git a/gradle.properties b/gradle.properties index 72e5f67c..e31f9583 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ kotlin_serialisation_core_version=1.3.1 koin_version=3.1.2 microutils_version=0.8.5 -ktor_version=1.6.6 +ktor_version=1.6.5 logback_version=1.2.6 uuid_version=0.3.1 klock_version=2.4.8 diff --git a/settings.gradle b/settings.gradle index 8bb86c9a..987bb1db 100644 --- a/settings.gradle +++ b/settings.gradle @@ -37,6 +37,10 @@ String[] includes = [ ":features:content:text:client", ":features:content:text:server", + ":features:content:binary:common", + ":features:content:binary:client", + ":features:content:binary:server", + ":server", ":client", ] From 731ce96bbbbab3b88fdeeaf8cf88ad58a82e436a Mon Sep 17 00:00:00 2001 From: alexander Date: Sat, 27 Nov 2021 17:51:20 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=B0=D1=81=D1=8F=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/content/binary/common/build.gradle | 1 + .../BinaryContent.kt | 0 .../BinaryContentSerializerModuleConfigurator.kt | 0 3 files changed, 1 insertion(+) rename features/content/binary/common/src/commonMain/{kotkin => kotlin}/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt (100%) rename features/content/binary/common/src/commonMain/{kotkin => kotlin}/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt (100%) diff --git a/features/content/binary/common/build.gradle b/features/content/binary/common/build.gradle index d4a562e5..f4369eca 100644 --- a/features/content/binary/common/build.gradle +++ b/features/content/binary/common/build.gradle @@ -11,6 +11,7 @@ kotlin { commonMain { dependencies { api project(":postssystem.features.common.common") + api project(":postssystem.features.content.common") } } } diff --git a/features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt b/features/content/binary/common/src/commonMain/kotlin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt similarity index 100% rename from features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt rename to features/content/binary/common/src/commonMain/kotlin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt diff --git a/features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt b/features/content/binary/common/src/commonMain/kotlin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt similarity index 100% rename from features/content/binary/common/src/commonMain/kotkin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt rename to features/content/binary/common/src/commonMain/kotlin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt From c42dd8146483b07653190234e23e4e073963b727 Mon Sep 17 00:00:00 2001 From: alexander Date: Sat, 27 Nov 2021 18:07:24 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB?= =?UTF-8?q?=20=D1=80=D0=B0=D1=81=D0=BF=D0=BE=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../postssystem/features/content/binary/common}/BinaryContent.kt | 0 .../binary/common}/BinaryContentSerializerModuleConfigurator.kt | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename features/content/binary/common/src/commonMain/kotlin/{dev.inmo.postsystem.features.content.binary.common => dev/inmo/postssystem/features/content/binary/common}/BinaryContent.kt (100%) rename features/content/binary/common/src/commonMain/kotlin/{dev.inmo.postsystem.features.content.binary.common => dev/inmo/postssystem/features/content/binary/common}/BinaryContentSerializerModuleConfigurator.kt (100%) diff --git a/features/content/binary/common/src/commonMain/kotlin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt b/features/content/binary/common/src/commonMain/kotlin/dev/inmo/postssystem/features/content/binary/common/BinaryContent.kt similarity index 100% rename from features/content/binary/common/src/commonMain/kotlin/dev.inmo.postsystem.features.content.binary.common/BinaryContent.kt rename to features/content/binary/common/src/commonMain/kotlin/dev/inmo/postssystem/features/content/binary/common/BinaryContent.kt diff --git a/features/content/binary/common/src/commonMain/kotlin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt b/features/content/binary/common/src/commonMain/kotlin/dev/inmo/postssystem/features/content/binary/common/BinaryContentSerializerModuleConfigurator.kt similarity index 100% rename from features/content/binary/common/src/commonMain/kotlin/dev.inmo.postsystem.features.content.binary.common/BinaryContentSerializerModuleConfigurator.kt rename to features/content/binary/common/src/commonMain/kotlin/dev/inmo/postssystem/features/content/binary/common/BinaryContentSerializerModuleConfigurator.kt