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", ]