From 93f70fe874efb9ffd59a181658a324c264005161 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 5 Aug 2020 16:21:30 +0600 Subject: [PATCH] temporal push for keeping history --- core/api/build.gradle | 76 +++++++++++++++++ .../api}/maven.publish.gradle | 0 .../api}/publish.gradle | 0 .../api}/publish_config.json | 0 .../postssystem/core/IdUtils.kt | 0 .../postssystem/core/content/Content.kt | 0 .../core/content/api/ContentRepo.kt | 0 .../core/content/api/ReadContentRepo.kt | 0 .../core/content/api/WriteContentRepo.kt | 0 .../core/post/BusinessPublishablePostsRepo.kt | 0 .../postssystem/core/post/Post.kt | 0 .../postssystem/core/post/repo/PostsRepo.kt | 0 .../core/post/repo/ReadPostsRepo.kt | 0 .../core/post/repo/WritePostsRepo.kt | 0 .../core/utils/ByteArrayAllocator.kt | 0 .../postssystem/core/utils/DateTimeUtils.kt | 0 .../postssystem/core/utils/HandleSafely.kt | 0 .../core/api/ContentSerialization.kt | 0 .../exposed}/build.gradle | 6 +- .../exposed}/gradle.properties | 0 .../exposed}/maven.publish.gradle | 0 .../exposed}/publish.gradle | 0 .../exposed}/publish_config.json | 0 .../core/exposed/ExposedContentRepo.kt | 0 .../core/exposed/ExposedPostsRepo.kt | 0 .../content/BinaryContentHolderRepo.kt | 0 .../core/exposed/content/ContentHolderRepo.kt | 0 .../content/SpecialContentHolderRepo.kt | 0 .../exposed/content/TextContentHolderRepo.kt | 0 .../exposed/ExposedContentAPICommonTests.kt | 0 .../exposed/ExposedPostsRepoCommonTests.kt | 0 core/ktor/client/build.gradle | 78 ++++++++++++++++++ core/ktor/client/gradle.properties | 1 + core/ktor/client/publish.gradle | 0 core/ktor/client/publish_config.json | 1 + core/ktor/client/settings.gradle | 1 + .../content/ReadContentRepoKtorClient.kt | 32 ++++++++ core/ktor/common/build.gradle | 78 ++++++++++++++++++ core/ktor/common/gradle.properties | 1 + core/ktor/common/publish.gradle | 0 core/ktor/common/publish_config.json | 1 + .../postssystem/core/ktor/Routes.kt | 5 ++ .../commons}/build.gradle | 8 +- .../commons}/gradle.properties | 0 .../commons}/maven.publish.gradle | 0 .../commons}/publish.gradle | 0 .../commons}/publish_config.kpsb | 0 .../exposed/commons/QueryExtensions.kt | 0 gradle.properties | 4 +- gradle/wrapper/gradle-wrapper.properties | 3 +- ktor/client/build.gradle | 82 +++++++++++++++++++ .../client}/maven.publish.gradle | 0 .../client}/publish.gradle | 0 .../client}/publish_config.kpsb | 0 .../common}/build.gradle | 15 +--- ktor/common/publish.gradle | 0 ktor/common/publish_config.kpsb | 1 + .../postssystem/ktor/StandardSerializer.kt | 5 ++ .../build.gradle | 4 +- .../html}/build.gradle | 6 +- .../html}/gradle.properties | 0 .../html}/maven.publish.gradle | 0 .../html}/publish.gradle | 0 .../html}/publish_config.kpsb | 0 .../markups/html/HtmlMarkupPlugin.kt | 10 +++ .../markups/html/HtmlMarkupPlugin.kt | 10 +++ .../maven.publish.gradle | 0 .../publish.gradle | 0 .../publish_config.kpsb | 0 .../markups/core/AbstractMarkupPlugin.kt | 24 ++++++ .../postssystem/markups/core/MarkupPlugin.kt | 0 .../postssystem/markups/core/MarkupsSystem.kt | 0 .../markups/core/utils/ListBuilder.kt | 0 .../markups/core/AbstractMarkupPlugin.kt | 24 ------ .../markups/html/HtmlMarkupPlugin.kt | 11 --- .../markups/html/HtmlMarkupPlugin.kt | 11 --- .../api}/build.gradle | 4 +- .../api}/maven.publish.gradle | 0 .../api}/publish.gradle | 0 .../api}/publish_config.kpsb | 0 .../core/publishing/PublishingRegistrar.kt | 0 .../core/publishing/PublishingTrigger.kt | 0 .../publishing/repos/PublishingKeysRepo.kt | 0 .../exposed}/build.gradle | 4 +- .../exposed}/gradle.properties | 0 .../exposed}/maven.publish.gradle | 0 .../exposed}/publish.gradle | 0 .../exposed}/publish_config.kpsb | 0 .../exposed/ExposedPublishingKeysRepo.kt | 0 settings.gradle | 30 +++++-- .../repos}/build.gradle | 0 .../repos/exposed}/build.gradle | 8 +- .../repos/exposed}/gradle.properties | 0 utils/repos/exposed/maven.publish.gradle | 53 ++++++++++++ .../repos/exposed}/publish.gradle | 0 utils/repos/exposed/publish_config.kpsb | 1 + .../repos/exposed/AbstractExposedCRUDRepo.kt | 0 .../exposed/AbstractExposedReadCRUDRepo.kt | 0 .../exposed/AbstractExposedWriteCRUDRepo.kt | 0 .../utils/repos/exposed/ExposedCRUDRepo.kt | 0 .../exposed/ExposedTableInitialization.kt | 0 .../keyvalue/AbstractExposedKeyValueRepo.kt | 0 .../AbstractExposedReadKeyValueRepo.kt | 0 .../AbstractOneToManyExposedKeyValueRepo.kt | 0 ...bstractOneToManyExposedReadKeyValueRepo.kt | 0 .../repos}/maven.publish.gradle | 0 utils/repos/publish.gradle | 55 +++++++++++++ .../repos}/publish_config.kpsb | 0 .../postssystem/utils/repos/IdUtils.kt | 0 .../utils/repos/OneToManyKeyValueRepo.kt | 0 .../postssystem/utils/repos/Repo.kt | 0 .../utils/repos/StandardCRUDRepo.kt | 0 .../utils/repos/StandardKeyValueRepo.kt | 0 .../utils/repos/pagination/Pagination.kt | 0 .../repos/pagination/PaginationResult.kt | 0 .../repos/pagination/SimplePagination.kt | 0 116 files changed, 562 insertions(+), 91 deletions(-) create mode 100644 core/api/build.gradle rename {postssystem.core => core/api}/maven.publish.gradle (100%) rename {postssystem.core.publishing.exposed => core/api}/publish.gradle (100%) rename {postssystem.core => core/api}/publish_config.json (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/IdUtils.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/Content.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ContentRepo.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ReadContentRepo.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/WriteContentRepo.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/BusinessPublishablePostsRepo.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/Post.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/PostsRepo.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/ReadPostsRepo.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/WritePostsRepo.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/ByteArrayAllocator.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/DateTimeUtils.kt (100%) rename {postssystem.core => core/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/HandleSafely.kt (100%) rename {postssystem.core => core/api}/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt (100%) rename {postssystem.core.exposed => core/exposed}/build.gradle (88%) rename {postssystem.core.exposed => core/exposed}/gradle.properties (100%) rename {postssystem.core.exposed => core/exposed}/maven.publish.gradle (100%) rename {postssystem.core.exposed => core/exposed}/publish.gradle (100%) rename {postssystem.core.exposed => core/exposed}/publish_config.json (100%) rename {postssystem.core.exposed => core/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt (100%) rename {postssystem.core.exposed => core/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt (100%) rename {postssystem.core.exposed => core/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/BinaryContentHolderRepo.kt (100%) rename {postssystem.core.exposed => core/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/ContentHolderRepo.kt (100%) rename {postssystem.core.exposed => core/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/SpecialContentHolderRepo.kt (100%) rename {postssystem.core.exposed => core/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/TextContentHolderRepo.kt (100%) rename {postssystem.core.exposed => core/exposed}/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentAPICommonTests.kt (100%) rename {postssystem.core.exposed => core/exposed}/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepoCommonTests.kt (100%) create mode 100644 core/ktor/client/build.gradle create mode 100644 core/ktor/client/gradle.properties create mode 100644 core/ktor/client/publish.gradle create mode 100644 core/ktor/client/publish_config.json create mode 100644 core/ktor/client/settings.gradle create mode 100644 core/ktor/client/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/ktor/client/content/ReadContentRepoKtorClient.kt create mode 100644 core/ktor/common/build.gradle create mode 100644 core/ktor/common/gradle.properties create mode 100644 core/ktor/common/publish.gradle create mode 100644 core/ktor/common/publish_config.json create mode 100644 core/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/ktor/Routes.kt rename {postssystem.exposed.commons => exposed/commons}/build.gradle (78%) rename {postssystem.exposed.commons => exposed/commons}/gradle.properties (100%) rename {postssystem.exposed.commons => exposed/commons}/maven.publish.gradle (100%) rename {postssystem.core.publishing => exposed/commons}/publish.gradle (100%) rename {postssystem.exposed.commons => exposed/commons}/publish_config.kpsb (100%) rename {postssystem.exposed.commons => exposed/commons}/src/main/kotlin/com/insanusmokrassar/postssystem/exposed/commons/QueryExtensions.kt (100%) create mode 100644 ktor/client/build.gradle rename {postssystem.utils.repos.exposed => ktor/client}/maven.publish.gradle (100%) rename {postssystem.core => ktor/client}/publish.gradle (100%) rename {postssystem.utils.repos.exposed => ktor/client}/publish_config.kpsb (100%) rename {postssystem.core => ktor/common}/build.gradle (72%) create mode 100644 ktor/common/publish.gradle create mode 100644 ktor/common/publish_config.kpsb create mode 100644 ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/ktor/StandardSerializer.kt rename {postssystem.markups.core => markups}/build.gradle (95%) rename {postssystem.markups.html => markups/html}/build.gradle (92%) rename {postssystem.markups.html => markups/html}/gradle.properties (100%) rename {postssystem.markups.core => markups/html}/maven.publish.gradle (100%) rename {postssystem.exposed.commons => markups/html}/publish.gradle (100%) rename {postssystem.markups.core => markups/html}/publish_config.kpsb (100%) create mode 100644 markups/html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt create mode 100644 markups/html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt rename {postssystem.markups.html => markups}/maven.publish.gradle (100%) rename {postssystem.markups.core => markups}/publish.gradle (100%) rename {postssystem.markups.html => markups}/publish_config.kpsb (100%) create mode 100644 markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt rename {postssystem.markups.core => markups}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupPlugin.kt (100%) rename {postssystem.markups.core => markups}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupsSystem.kt (100%) rename {postssystem.markups.core => markups}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/utils/ListBuilder.kt (100%) delete mode 100644 postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt delete mode 100644 postssystem.markups.html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt delete mode 100644 postssystem.markups.html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt rename {postssystem.core.publishing => publishing/api}/build.gradle (93%) rename {postssystem.core.publishing => publishing/api}/maven.publish.gradle (100%) rename {postssystem.markups.html => publishing/api}/publish.gradle (100%) rename {postssystem.core.publishing => publishing/api}/publish_config.kpsb (100%) rename {postssystem.core.publishing => publishing/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingRegistrar.kt (100%) rename {postssystem.core.publishing => publishing/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingTrigger.kt (100%) rename {postssystem.core.publishing => publishing/api}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/repos/PublishingKeysRepo.kt (100%) rename {postssystem.core.publishing.exposed => publishing/exposed}/build.gradle (92%) rename {postssystem.core.publishing.exposed => publishing/exposed}/gradle.properties (100%) rename {postssystem.core.publishing.exposed => publishing/exposed}/maven.publish.gradle (100%) rename {postssystem.utils.repos.exposed => publishing/exposed}/publish.gradle (100%) rename {postssystem.core.publishing.exposed => publishing/exposed}/publish_config.kpsb (100%) rename {postssystem.core.publishing.exposed => publishing/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/core/publishing/exposed/ExposedPublishingKeysRepo.kt (100%) rename {postssystem.utils.repos => utils/repos}/build.gradle (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/build.gradle (83%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/gradle.properties (100%) create mode 100644 utils/repos/exposed/maven.publish.gradle rename {postssystem.utils.repos => utils/repos/exposed}/publish.gradle (100%) create mode 100644 utils/repos/exposed/publish_config.kpsb rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedCRUDRepo.kt (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedReadCRUDRepo.kt (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedWriteCRUDRepo.kt (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedCRUDRepo.kt (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedTableInitialization.kt (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedKeyValueRepo.kt (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedReadKeyValueRepo.kt (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedKeyValueRepo.kt (100%) rename {postssystem.utils.repos.exposed => utils/repos/exposed}/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedReadKeyValueRepo.kt (100%) rename {postssystem.utils.repos => utils/repos}/maven.publish.gradle (100%) create mode 100644 utils/repos/publish.gradle rename {postssystem.utils.repos => utils/repos}/publish_config.kpsb (100%) rename {postssystem.utils.repos => utils/repos}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/IdUtils.kt (100%) rename {postssystem.utils.repos => utils/repos}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/OneToManyKeyValueRepo.kt (100%) rename {postssystem.utils.repos => utils/repos}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/Repo.kt (100%) rename {postssystem.utils.repos => utils/repos}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardCRUDRepo.kt (100%) rename {postssystem.utils.repos => utils/repos}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardKeyValueRepo.kt (100%) rename {postssystem.utils.repos => utils/repos}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/Pagination.kt (100%) rename {postssystem.utils.repos => utils/repos}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/PaginationResult.kt (100%) rename {postssystem.utils.repos => utils/repos}/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/SimplePagination.kt (100%) diff --git a/core/api/build.gradle b/core/api/build.gradle new file mode 100644 index 00000000..ffa6da90 --- /dev/null +++ b/core/api/build.gradle @@ -0,0 +1,76 @@ +buildscript { + repositories { + mavenLocal() + jcenter() + mavenCentral() + } + + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" + classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version" + } +} + +plugins { + id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version" + id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" +} + +project.version = "$core_version" +project.group = "com.insanusmokrassar" + +apply from: "publish.gradle" + +repositories { + mavenLocal() + jcenter() + mavenCentral() + maven { url "https://kotlin.bintray.com/kotlinx" } +} + +project.kotlin { + jvm() + js() + + sourceSets { + commonMain { + dependencies { + implementation kotlin('stdlib') + + if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { + api "com.insanusmokrassar:postssystem.utils.repos:$core_version" + } else { + api project(":utils:repos") + } + } + } + commonTest { + dependencies { + implementation kotlin('test-common') + implementation kotlin('test-annotations-common') + } + } + jvmMain { + dependencies { + implementation kotlin('stdlib-jdk8') + } + } + jvmTest { + dependencies { + implementation kotlin('test-junit') + } + } + jsMain { + dependencies { + implementation kotlin('stdlib-js') + } + } + jsTest { + dependencies { + implementation kotlin('test-js') + implementation kotlin('test-junit') + } + } + } +} diff --git a/postssystem.core/maven.publish.gradle b/core/api/maven.publish.gradle similarity index 100% rename from postssystem.core/maven.publish.gradle rename to core/api/maven.publish.gradle diff --git a/postssystem.core.publishing.exposed/publish.gradle b/core/api/publish.gradle similarity index 100% rename from postssystem.core.publishing.exposed/publish.gradle rename to core/api/publish.gradle diff --git a/postssystem.core/publish_config.json b/core/api/publish_config.json similarity index 100% rename from postssystem.core/publish_config.json rename to core/api/publish_config.json diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/IdUtils.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/IdUtils.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/IdUtils.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/IdUtils.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/Content.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/Content.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/Content.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/Content.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ContentRepo.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ContentRepo.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ContentRepo.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ContentRepo.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ReadContentRepo.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ReadContentRepo.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ReadContentRepo.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/ReadContentRepo.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/WriteContentRepo.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/WriteContentRepo.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/WriteContentRepo.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/content/api/WriteContentRepo.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/BusinessPublishablePostsRepo.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/BusinessPublishablePostsRepo.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/BusinessPublishablePostsRepo.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/BusinessPublishablePostsRepo.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/Post.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/Post.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/Post.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/Post.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/PostsRepo.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/PostsRepo.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/PostsRepo.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/PostsRepo.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/ReadPostsRepo.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/ReadPostsRepo.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/ReadPostsRepo.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/ReadPostsRepo.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/WritePostsRepo.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/WritePostsRepo.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/WritePostsRepo.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/post/repo/WritePostsRepo.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/ByteArrayAllocator.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/ByteArrayAllocator.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/ByteArrayAllocator.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/ByteArrayAllocator.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/DateTimeUtils.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/DateTimeUtils.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/DateTimeUtils.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/DateTimeUtils.kt diff --git a/postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/HandleSafely.kt b/core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/HandleSafely.kt similarity index 100% rename from postssystem.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/HandleSafely.kt rename to core/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/utils/HandleSafely.kt diff --git a/postssystem.core/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt b/core/api/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt similarity index 100% rename from postssystem.core/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt rename to core/api/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/ContentSerialization.kt diff --git a/postssystem.core.exposed/build.gradle b/core/exposed/build.gradle similarity index 88% rename from postssystem.core.exposed/build.gradle rename to core/exposed/build.gradle index 29ca7dde..c3e01416 100644 --- a/postssystem.core.exposed/build.gradle +++ b/core/exposed/build.gradle @@ -34,11 +34,11 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { - api "com.insanusmokrassar:postssystem.core:$core_version" + api "com.insanusmokrassar:postssystem.core.api:$core_version" api "com.insanusmokrassar:postssystem.exposed.commons:$core_version" } else { - api project(":postssystem.core") - api project(":postssystem.exposed.commons") + api project(":core:api") + api project(":exposed:commons") } testImplementation "org.xerial:sqlite-jdbc:$test_sqlite_version" diff --git a/postssystem.core.exposed/gradle.properties b/core/exposed/gradle.properties similarity index 100% rename from postssystem.core.exposed/gradle.properties rename to core/exposed/gradle.properties diff --git a/postssystem.core.exposed/maven.publish.gradle b/core/exposed/maven.publish.gradle similarity index 100% rename from postssystem.core.exposed/maven.publish.gradle rename to core/exposed/maven.publish.gradle diff --git a/postssystem.core.exposed/publish.gradle b/core/exposed/publish.gradle similarity index 100% rename from postssystem.core.exposed/publish.gradle rename to core/exposed/publish.gradle diff --git a/postssystem.core.exposed/publish_config.json b/core/exposed/publish_config.json similarity index 100% rename from postssystem.core.exposed/publish_config.json rename to core/exposed/publish_config.json diff --git a/postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt similarity index 100% rename from postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt rename to core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt diff --git a/postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt similarity index 100% rename from postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt rename to core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt diff --git a/postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/BinaryContentHolderRepo.kt b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/BinaryContentHolderRepo.kt similarity index 100% rename from postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/BinaryContentHolderRepo.kt rename to core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/BinaryContentHolderRepo.kt diff --git a/postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/ContentHolderRepo.kt b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/ContentHolderRepo.kt similarity index 100% rename from postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/ContentHolderRepo.kt rename to core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/ContentHolderRepo.kt diff --git a/postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/SpecialContentHolderRepo.kt b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/SpecialContentHolderRepo.kt similarity index 100% rename from postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/SpecialContentHolderRepo.kt rename to core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/SpecialContentHolderRepo.kt diff --git a/postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/TextContentHolderRepo.kt b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/TextContentHolderRepo.kt similarity index 100% rename from postssystem.core.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/TextContentHolderRepo.kt rename to core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/content/TextContentHolderRepo.kt diff --git a/postssystem.core.exposed/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentAPICommonTests.kt b/core/exposed/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentAPICommonTests.kt similarity index 100% rename from postssystem.core.exposed/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentAPICommonTests.kt rename to core/exposed/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentAPICommonTests.kt diff --git a/postssystem.core.exposed/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepoCommonTests.kt b/core/exposed/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepoCommonTests.kt similarity index 100% rename from postssystem.core.exposed/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepoCommonTests.kt rename to core/exposed/src/test/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepoCommonTests.kt diff --git a/core/ktor/client/build.gradle b/core/ktor/client/build.gradle new file mode 100644 index 00000000..373cfb75 --- /dev/null +++ b/core/ktor/client/build.gradle @@ -0,0 +1,78 @@ +buildscript { + repositories { + mavenLocal() + jcenter() + mavenCentral() + } + + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" + classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version" + } +} + +plugins { + id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version" + id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" +} + +project.version = "$core_version" +project.group = "com.insanusmokrassar" + +apply from: "publish.gradle" + +repositories { + mavenLocal() + jcenter() + mavenCentral() + maven { url "https://kotlin.bintray.com/kotlinx" } +} + +kotlin { + jvm() + js() + + sourceSets { + commonMain { + dependencies { + implementation kotlin('stdlib') + + if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { + api "com.insanusmokrassar:postssystem.core.ktor.common:$core_version" + api "com.insanusmokrassar:postssystem.ktor.client:$core_version" + } else { + api project(":core:ktor:common") + api project(":ktor:client") + } + } + } + commonTest { + dependencies { + implementation kotlin('test-common') + implementation kotlin('test-annotations-common') + } + } + jvmMain { + dependencies { + implementation kotlin('stdlib-jdk8') + } + } + jvmTest { + dependencies { + implementation kotlin('test-junit') + } + } + jsMain { + dependencies { + implementation kotlin('stdlib-js') + } + } + jsTest { + dependencies { + implementation kotlin('test-js') + implementation kotlin('test-junit') + } + } + } +} diff --git a/core/ktor/client/gradle.properties b/core/ktor/client/gradle.properties new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/core/ktor/client/gradle.properties @@ -0,0 +1 @@ + diff --git a/core/ktor/client/publish.gradle b/core/ktor/client/publish.gradle new file mode 100644 index 00000000..e69de29b diff --git a/core/ktor/client/publish_config.json b/core/ktor/client/publish_config.json new file mode 100644 index 00000000..769ff599 --- /dev/null +++ b/core/ktor/client/publish_config.json @@ -0,0 +1 @@ +{"bintrayConfig":{"repo":"InsanusMokrassar","packageName":"${project.name}","packageVcs":"https://github.com/PostsSystem/PostsSystemCore"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE"}],"mavenConfig":{"name":"PostsSystem Core Exposed realization","description":"Exposed realisation for PostsSystem Core","url":"https://git.insanusmokrassar.com/PostsSystem/Core/","vcsUrl":"https://git.insanusmokrassar.com/PostsSystem/Core/.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"JVM"} \ No newline at end of file diff --git a/core/ktor/client/settings.gradle b/core/ktor/client/settings.gradle new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/core/ktor/client/settings.gradle @@ -0,0 +1 @@ + diff --git a/core/ktor/client/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/ktor/client/content/ReadContentRepoKtorClient.kt b/core/ktor/client/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/ktor/client/content/ReadContentRepoKtorClient.kt new file mode 100644 index 00000000..06c14148 --- /dev/null +++ b/core/ktor/client/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/ktor/client/content/ReadContentRepoKtorClient.kt @@ -0,0 +1,32 @@ +package com.insanusmokrassar.postssystem.core.ktor.client.content + +//import com.insanusmokrassar.postssystem.core.content.ContentId +//import com.insanusmokrassar.postssystem.core.content.RegisteredContent +//import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo +//import com.insanusmokrassar.postssystem.core.ktor.getContentByIdRoute +//import com.insanusmokrassar.postssystem.core.ktor.getContentsIdsRoute +//import com.insanusmokrassar.postssystem.utils.repos.pagination.Pagination +//import com.insanusmokrassar.postssystem.utils.repos.pagination.PaginationResult +//import io.ktor.client.HttpClient +//import io.ktor.client.request.get +//import io.ktor.client.statement.HttpResponse +//import kotlinx.io.InputStream +// +//class ReadContentRepoKtorClient( +// private val client: HttpClient, +// private val baseUrl: String +//) : ReadContentRepo { +// override suspend fun getContentsIds(): Set = client.get( +// "$baseUrl/$getContentsIdsRoute" +// ).content.let { +// TODO() +// } +// +// override suspend fun getContentById(id: ContentId): RegisteredContent? { +// TODO("Not yet implemented") +// } +// +// override suspend fun getContentByPagination(pagination: Pagination): PaginationResult { +// TODO("Not yet implemented") +// } +//} \ No newline at end of file diff --git a/core/ktor/common/build.gradle b/core/ktor/common/build.gradle new file mode 100644 index 00000000..d74a4900 --- /dev/null +++ b/core/ktor/common/build.gradle @@ -0,0 +1,78 @@ +buildscript { + repositories { + mavenLocal() + jcenter() + mavenCentral() + } + + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" + classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version" + } +} + +plugins { + id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version" + id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" +} + +project.version = "$core_version" +project.group = "com.insanusmokrassar" + +apply from: "publish.gradle" + +repositories { + mavenLocal() + jcenter() + mavenCentral() + maven { url "https://kotlin.bintray.com/kotlinx" } +} + +kotlin { + jvm() + js() + + sourceSets { + commonMain { + dependencies { + implementation kotlin('stdlib') + + if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { + api "com.insanusmokrassar:postssystem.ktor.common:$core_version" + api "com.insanusmokrassar:postssystem.core.api:$core_version" + } else { + api project(":ktor:common") + api project(":core:api") + } + } + } + commonTest { + dependencies { + implementation kotlin('test-common') + implementation kotlin('test-annotations-common') + } + } + jvmMain { + dependencies { + implementation kotlin('stdlib-jdk8') + } + } + jvmTest { + dependencies { + implementation kotlin('test-junit') + } + } + jsMain { + dependencies { + implementation kotlin('stdlib-js') + } + } + jsTest { + dependencies { + implementation kotlin('test-js') + implementation kotlin('test-junit') + } + } + } +} diff --git a/core/ktor/common/gradle.properties b/core/ktor/common/gradle.properties new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/core/ktor/common/gradle.properties @@ -0,0 +1 @@ + diff --git a/core/ktor/common/publish.gradle b/core/ktor/common/publish.gradle new file mode 100644 index 00000000..e69de29b diff --git a/core/ktor/common/publish_config.json b/core/ktor/common/publish_config.json new file mode 100644 index 00000000..769ff599 --- /dev/null +++ b/core/ktor/common/publish_config.json @@ -0,0 +1 @@ +{"bintrayConfig":{"repo":"InsanusMokrassar","packageName":"${project.name}","packageVcs":"https://github.com/PostsSystem/PostsSystemCore"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE"}],"mavenConfig":{"name":"PostsSystem Core Exposed realization","description":"Exposed realisation for PostsSystem Core","url":"https://git.insanusmokrassar.com/PostsSystem/Core/","vcsUrl":"https://git.insanusmokrassar.com/PostsSystem/Core/.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"JVM"} \ No newline at end of file diff --git a/core/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/ktor/Routes.kt b/core/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/ktor/Routes.kt new file mode 100644 index 00000000..fe6d11f7 --- /dev/null +++ b/core/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/ktor/Routes.kt @@ -0,0 +1,5 @@ +package com.insanusmokrassar.postssystem.core.ktor + +const val getContentsIdsRoute = "getContentsIds" +const val getContentByIdRoute = "getContentById" +const val getContentByPaginationRoute = "getContentByPagination" diff --git a/postssystem.exposed.commons/build.gradle b/exposed/commons/build.gradle similarity index 78% rename from postssystem.exposed.commons/build.gradle rename to exposed/commons/build.gradle index 1985ad13..88327bd5 100644 --- a/postssystem.exposed.commons/build.gradle +++ b/exposed/commons/build.gradle @@ -31,17 +31,15 @@ repositories { } dependencies { - api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" api "org.jetbrains.exposed:exposed-core:$exposed_version" - api "org.jetbrains.exposed:exposed-jdbc:$exposed_version" if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { - api "com.insanusmokrassar:postssystem.core:$core_version" + api "com.insanusmokrassar:postssystem.utils.repos:$core_version" } else { - api project(":postssystem.core") + api project(":utils:repos") } - testImplementation "org.xerial:sqlite-jdbc:$test_sqlite_version" testImplementation "org.jetbrains.kotlin:kotlin-test" testImplementation "org.jetbrains.kotlin:kotlin-test-junit" } diff --git a/postssystem.exposed.commons/gradle.properties b/exposed/commons/gradle.properties similarity index 100% rename from postssystem.exposed.commons/gradle.properties rename to exposed/commons/gradle.properties diff --git a/postssystem.exposed.commons/maven.publish.gradle b/exposed/commons/maven.publish.gradle similarity index 100% rename from postssystem.exposed.commons/maven.publish.gradle rename to exposed/commons/maven.publish.gradle diff --git a/postssystem.core.publishing/publish.gradle b/exposed/commons/publish.gradle similarity index 100% rename from postssystem.core.publishing/publish.gradle rename to exposed/commons/publish.gradle diff --git a/postssystem.exposed.commons/publish_config.kpsb b/exposed/commons/publish_config.kpsb similarity index 100% rename from postssystem.exposed.commons/publish_config.kpsb rename to exposed/commons/publish_config.kpsb diff --git a/postssystem.exposed.commons/src/main/kotlin/com/insanusmokrassar/postssystem/exposed/commons/QueryExtensions.kt b/exposed/commons/src/main/kotlin/com/insanusmokrassar/postssystem/exposed/commons/QueryExtensions.kt similarity index 100% rename from postssystem.exposed.commons/src/main/kotlin/com/insanusmokrassar/postssystem/exposed/commons/QueryExtensions.kt rename to exposed/commons/src/main/kotlin/com/insanusmokrassar/postssystem/exposed/commons/QueryExtensions.kt diff --git a/gradle.properties b/gradle.properties index 38acef74..b4b0a7b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,10 @@ kotlin.code.style=official kotlin_version=1.3.72 -kotlin_coroutines_version=1.3.7 +kotlin_coroutines_version=1.3.8 kotlin_serialisation_runtime_version=0.20.0 +ktor_version=1.3.2 + klockVersion=1.11.12 uuidVersion=0.1.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 35f37208..492d706a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,4 @@ -#Wed JAN 29 22:07:00 OMST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/ktor/client/build.gradle b/ktor/client/build.gradle new file mode 100644 index 00000000..d7b7f187 --- /dev/null +++ b/ktor/client/build.gradle @@ -0,0 +1,82 @@ +buildscript { + repositories { + mavenLocal() + jcenter() + mavenCentral() + } + + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" + classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version" + } +} + +plugins { + id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version" + id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" +} + +project.version = "$core_version" +project.group = "com.insanusmokrassar" + +apply from: "publish.gradle" + +repositories { + mavenLocal() + jcenter() + mavenCentral() + maven { url "https://kotlin.bintray.com/kotlinx" } +} + +kotlin { + jvm() + js() + + sourceSets { + commonMain { + dependencies { + implementation kotlin('stdlib') + + if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { + api "com.insanusmokrassar:postssystem.ktor.common:$core_version" + } else { + api project(":ktor:common") + } + + api "io.ktor:ktor-client-core:$ktor_version" + } + } + commonTest { + dependencies { + implementation kotlin('test-common') + implementation kotlin('test-annotations-common') + } + } + jvmMain { + dependencies { + implementation kotlin('stdlib-jdk8') + + api "io.ktor:ktor-client:$ktor_version" + } + } + jvmTest { + dependencies { + implementation kotlin('test-junit') + } + } + jsMain { + dependencies { + implementation kotlin('stdlib-js') + + api "io.ktor:ktor-client-js:$ktor_version" + } + } + jsTest { + dependencies { + implementation kotlin('test-js') + implementation kotlin('test-junit') + } + } + } +} diff --git a/postssystem.utils.repos.exposed/maven.publish.gradle b/ktor/client/maven.publish.gradle similarity index 100% rename from postssystem.utils.repos.exposed/maven.publish.gradle rename to ktor/client/maven.publish.gradle diff --git a/postssystem.core/publish.gradle b/ktor/client/publish.gradle similarity index 100% rename from postssystem.core/publish.gradle rename to ktor/client/publish.gradle diff --git a/postssystem.utils.repos.exposed/publish_config.kpsb b/ktor/client/publish_config.kpsb similarity index 100% rename from postssystem.utils.repos.exposed/publish_config.kpsb rename to ktor/client/publish_config.kpsb diff --git a/postssystem.core/build.gradle b/ktor/common/build.gradle similarity index 72% rename from postssystem.core/build.gradle rename to ktor/common/build.gradle index 9b26e026..f0dfaebc 100644 --- a/postssystem.core/build.gradle +++ b/ktor/common/build.gradle @@ -37,17 +37,8 @@ kotlin { commonMain { dependencies { implementation kotlin('stdlib') - 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" - api "com.benasher44:uuid:$uuidVersion" - - if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { - api "com.insanusmokrassar:postssystem.utils.repos:$core_version" - } else { - api project(":postssystem.utils.repos") - } + api "org.jetbrains.kotlinx:kotlinx-serialization-cbor-common:$kotlin_serialisation_runtime_version" } } commonTest { @@ -59,8 +50,8 @@ kotlin { jvmMain { dependencies { implementation kotlin('stdlib-jdk8') - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" api "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlin_serialisation_runtime_version" + api "org.jetbrains.kotlinx:kotlinx-serialization-cbor:$kotlin_serialisation_runtime_version" } } jvmTest { @@ -71,8 +62,8 @@ kotlin { jsMain { dependencies { implementation kotlin('stdlib-js') - api "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$kotlin_coroutines_version" api "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$kotlin_serialisation_runtime_version" + api "org.jetbrains.kotlinx:kotlinx-serialization-cbor-js:$kotlin_serialisation_runtime_version" } } jsTest { diff --git a/ktor/common/publish.gradle b/ktor/common/publish.gradle new file mode 100644 index 00000000..e69de29b diff --git a/ktor/common/publish_config.kpsb b/ktor/common/publish_config.kpsb new file mode 100644 index 00000000..2bd43e2b --- /dev/null +++ b/ktor/common/publish_config.kpsb @@ -0,0 +1 @@ +{"bintrayConfig":{"repo":"InsanusMokrassar","packageName":"${project.name}","packageVcs":"https://github.com/PostsSystem/PostsSystemCore"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE"}],"mavenConfig":{"name":"PostsSystem Exposed commons","description":"Common utils for all exposed modules","url":"https://git.insanusmokrassar.com/PostsSystem/Core/","vcsUrl":"https://git.insanusmokrassar.com/PostsSystem/Core/.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"} \ No newline at end of file diff --git a/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/ktor/StandardSerializer.kt b/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/ktor/StandardSerializer.kt new file mode 100644 index 00000000..b2a9004d --- /dev/null +++ b/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/ktor/StandardSerializer.kt @@ -0,0 +1,5 @@ +package com.insanusmokrassar.postssystem.ktor + +import kotlinx.serialization.cbor.Cbor + +val standardKtorSerializer = Cbor diff --git a/postssystem.markups.core/build.gradle b/markups/build.gradle similarity index 95% rename from postssystem.markups.core/build.gradle rename to markups/build.gradle index f065c698..a2e60835 100644 --- a/postssystem.markups.core/build.gradle +++ b/markups/build.gradle @@ -41,9 +41,9 @@ kotlin { api "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$kotlin_serialisation_runtime_version" if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { - api "com.insanusmokrassar:postssystem.core:$core_version" + api "com.insanusmokrassar:postssystem.core.api:$core_version" } else { - api project(":postssystem.core") + api project(":core:api") } api "com.soywiz.korlibs.klock:klock:$klockVersion" diff --git a/postssystem.markups.html/build.gradle b/markups/html/build.gradle similarity index 92% rename from postssystem.markups.html/build.gradle rename to markups/html/build.gradle index abbbdd76..2780a39e 100644 --- a/postssystem.markups.html/build.gradle +++ b/markups/html/build.gradle @@ -13,8 +13,8 @@ buildscript { } plugins { - id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version" - id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" + id "org.jetbrains.kotlin.multiplatform" + id "org.jetbrains.kotlin.plugin.serialization" } project.version = "$core_version" @@ -43,7 +43,7 @@ kotlin { if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { api "com.insanusmokrassar:postssystem.markups.core:$core_version" } else { - api project(":postssystem.markups.core") + api project(":markups") } } } diff --git a/postssystem.markups.html/gradle.properties b/markups/html/gradle.properties similarity index 100% rename from postssystem.markups.html/gradle.properties rename to markups/html/gradle.properties diff --git a/postssystem.markups.core/maven.publish.gradle b/markups/html/maven.publish.gradle similarity index 100% rename from postssystem.markups.core/maven.publish.gradle rename to markups/html/maven.publish.gradle diff --git a/postssystem.exposed.commons/publish.gradle b/markups/html/publish.gradle similarity index 100% rename from postssystem.exposed.commons/publish.gradle rename to markups/html/publish.gradle diff --git a/postssystem.markups.core/publish_config.kpsb b/markups/html/publish_config.kpsb similarity index 100% rename from postssystem.markups.core/publish_config.kpsb rename to markups/html/publish_config.kpsb diff --git a/markups/html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt b/markups/html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt new file mode 100644 index 00000000..ee950f65 --- /dev/null +++ b/markups/html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt @@ -0,0 +1,10 @@ +package com.insanusmokrassar.postssystem.markups.html + +import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo +import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo +import kotlinx.html.FlowContent + +//abstract class HtmlMarkupPlugin( +// postsRepo: ReadPostsRepo, +// postsContentRepo: ReadContentRepo +//) : AbstractMarkupPlugin(postsRepo, postsContentRepo) diff --git a/markups/html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt b/markups/html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt new file mode 100644 index 00000000..ee950f65 --- /dev/null +++ b/markups/html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt @@ -0,0 +1,10 @@ +package com.insanusmokrassar.postssystem.markups.html + +import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo +import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo +import kotlinx.html.FlowContent + +//abstract class HtmlMarkupPlugin( +// postsRepo: ReadPostsRepo, +// postsContentRepo: ReadContentRepo +//) : AbstractMarkupPlugin(postsRepo, postsContentRepo) diff --git a/postssystem.markups.html/maven.publish.gradle b/markups/maven.publish.gradle similarity index 100% rename from postssystem.markups.html/maven.publish.gradle rename to markups/maven.publish.gradle diff --git a/postssystem.markups.core/publish.gradle b/markups/publish.gradle similarity index 100% rename from postssystem.markups.core/publish.gradle rename to markups/publish.gradle diff --git a/postssystem.markups.html/publish_config.kpsb b/markups/publish_config.kpsb similarity index 100% rename from postssystem.markups.html/publish_config.kpsb rename to markups/publish_config.kpsb diff --git a/markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt b/markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt new file mode 100644 index 00000000..43cd3dd5 --- /dev/null +++ b/markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt @@ -0,0 +1,24 @@ +package com.insanusmokrassar.postssystem.markups.core + +import com.insanusmokrassar.postssystem.core.content.RegisteredContent +import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo +import com.insanusmokrassar.postssystem.core.post.PostId +import com.insanusmokrassar.postssystem.core.post.RegisteredPost +import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo + +//abstract class AbstractMarkupPlugin( +// @Suppress("MemberVisibilityCanBePrivate") +// protected val postsRepo: ReadPostsRepo, +// @Suppress("MemberVisibilityCanBePrivate") +// protected val postsContentRepo: ReadContentRepo +//) : MarkupPlugin { +// override suspend fun drawMarkupBuilder(on: MarkupTarget, postId: PostId) { +// val post = postsRepo.getPostById(postId) ?: return +// val contents = post.content.mapNotNull { +// postsContentRepo.getContentById(it) +// } +// drawMarkupBuilder(on, post, contents) +// } +// +// abstract suspend fun drawMarkupBuilder(target: MarkupTarget, forPost: RegisteredPost, content: List) +//} diff --git a/postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupPlugin.kt b/markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupPlugin.kt similarity index 100% rename from postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupPlugin.kt rename to markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupPlugin.kt diff --git a/postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupsSystem.kt b/markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupsSystem.kt similarity index 100% rename from postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupsSystem.kt rename to markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupsSystem.kt diff --git a/postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/utils/ListBuilder.kt b/markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/utils/ListBuilder.kt similarity index 100% rename from postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/utils/ListBuilder.kt rename to markups/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/utils/ListBuilder.kt diff --git a/postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt b/postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt deleted file mode 100644 index 6b4bd9ac..00000000 --- a/postssystem.markups.core/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.core - -import com.insanusmokrassar.postssystem.core.content.RegisteredContent -import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo -import com.insanusmokrassar.postssystem.core.post.PostId -import com.insanusmokrassar.postssystem.core.post.RegisteredPost -import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo - -abstract class AbstractMarkupPlugin( - @Suppress("MemberVisibilityCanBePrivate") - protected val postsRepo: ReadPostsRepo, - @Suppress("MemberVisibilityCanBePrivate") - protected val postsContentRepo: ReadContentRepo -) : MarkupPlugin { - override suspend fun drawMarkupBuilder(on: MarkupTarget, postId: PostId) { - val post = postsRepo.getPostById(postId) ?: return - val contents = post.content.mapNotNull { - postsContentRepo.getContentById(it) - } - drawMarkupBuilder(on, post, contents) - } - - abstract suspend fun drawMarkupBuilder(target: MarkupTarget, forPost: RegisteredPost, content: List) -} diff --git a/postssystem.markups.html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt b/postssystem.markups.html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt deleted file mode 100644 index 71bdb943..00000000 --- a/postssystem.markups.html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.html - -import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo -import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo -import com.insanusmokrassar.postssystem.markups.core.AbstractMarkupPlugin -import kotlinx.html.FlowContent - -abstract class HtmlMarkupPlugin( - postsRepo: ReadPostsRepo, - postsContentRepo: ReadContentRepo -) : AbstractMarkupPlugin(postsRepo, postsContentRepo) diff --git a/postssystem.markups.html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt b/postssystem.markups.html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt deleted file mode 100644 index 71bdb943..00000000 --- a/postssystem.markups.html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.html - -import com.insanusmokrassar.postssystem.core.content.api.ReadContentRepo -import com.insanusmokrassar.postssystem.core.post.repo.ReadPostsRepo -import com.insanusmokrassar.postssystem.markups.core.AbstractMarkupPlugin -import kotlinx.html.FlowContent - -abstract class HtmlMarkupPlugin( - postsRepo: ReadPostsRepo, - postsContentRepo: ReadContentRepo -) : AbstractMarkupPlugin(postsRepo, postsContentRepo) diff --git a/postssystem.core.publishing/build.gradle b/publishing/api/build.gradle similarity index 93% rename from postssystem.core.publishing/build.gradle rename to publishing/api/build.gradle index 803f9189..6e9a5d17 100644 --- a/postssystem.core.publishing/build.gradle +++ b/publishing/api/build.gradle @@ -39,9 +39,9 @@ kotlin { implementation kotlin('stdlib') if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { - api "com.insanusmokrassar:postssystem.core:$core_version" + api "com.insanusmokrassar:postssystem.core.api:$core_version" } else { - api project(":postssystem.core") + api project(":core:api") } } } diff --git a/postssystem.core.publishing/maven.publish.gradle b/publishing/api/maven.publish.gradle similarity index 100% rename from postssystem.core.publishing/maven.publish.gradle rename to publishing/api/maven.publish.gradle diff --git a/postssystem.markups.html/publish.gradle b/publishing/api/publish.gradle similarity index 100% rename from postssystem.markups.html/publish.gradle rename to publishing/api/publish.gradle diff --git a/postssystem.core.publishing/publish_config.kpsb b/publishing/api/publish_config.kpsb similarity index 100% rename from postssystem.core.publishing/publish_config.kpsb rename to publishing/api/publish_config.kpsb diff --git a/postssystem.core.publishing/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingRegistrar.kt b/publishing/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingRegistrar.kt similarity index 100% rename from postssystem.core.publishing/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingRegistrar.kt rename to publishing/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingRegistrar.kt diff --git a/postssystem.core.publishing/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingTrigger.kt b/publishing/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingTrigger.kt similarity index 100% rename from postssystem.core.publishing/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingTrigger.kt rename to publishing/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/PublishingTrigger.kt diff --git a/postssystem.core.publishing/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/repos/PublishingKeysRepo.kt b/publishing/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/repos/PublishingKeysRepo.kt similarity index 100% rename from postssystem.core.publishing/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/repos/PublishingKeysRepo.kt rename to publishing/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing/repos/PublishingKeysRepo.kt diff --git a/postssystem.core.publishing.exposed/build.gradle b/publishing/exposed/build.gradle similarity index 92% rename from postssystem.core.publishing.exposed/build.gradle rename to publishing/exposed/build.gradle index 27294b27..1640c450 100644 --- a/postssystem.core.publishing.exposed/build.gradle +++ b/publishing/exposed/build.gradle @@ -37,8 +37,8 @@ dependencies { api "com.insanusmokrassar:postssystem.core.publishing:$core_version" api "com.insanusmokrassar:postssystem.exposed.commons:$core_version" } else { - api project(":postssystem.core.publishing") - api project(":postssystem.exposed.commons") + api project(":publishing:api") + api project(":exposed:commons") } testImplementation "org.xerial:sqlite-jdbc:$test_sqlite_version" diff --git a/postssystem.core.publishing.exposed/gradle.properties b/publishing/exposed/gradle.properties similarity index 100% rename from postssystem.core.publishing.exposed/gradle.properties rename to publishing/exposed/gradle.properties diff --git a/postssystem.core.publishing.exposed/maven.publish.gradle b/publishing/exposed/maven.publish.gradle similarity index 100% rename from postssystem.core.publishing.exposed/maven.publish.gradle rename to publishing/exposed/maven.publish.gradle diff --git a/postssystem.utils.repos.exposed/publish.gradle b/publishing/exposed/publish.gradle similarity index 100% rename from postssystem.utils.repos.exposed/publish.gradle rename to publishing/exposed/publish.gradle diff --git a/postssystem.core.publishing.exposed/publish_config.kpsb b/publishing/exposed/publish_config.kpsb similarity index 100% rename from postssystem.core.publishing.exposed/publish_config.kpsb rename to publishing/exposed/publish_config.kpsb diff --git a/postssystem.core.publishing.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/publishing/exposed/ExposedPublishingKeysRepo.kt b/publishing/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/publishing/exposed/ExposedPublishingKeysRepo.kt similarity index 100% rename from postssystem.core.publishing.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/publishing/exposed/ExposedPublishingKeysRepo.kt rename to publishing/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/publishing/exposed/ExposedPublishingKeysRepo.kt diff --git a/settings.gradle b/settings.gradle index 2832018b..22602ee9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,14 +1,26 @@ rootProject.name='postssystem' -include ':postssystem.utils.repos' -include ':postssystem.exposed.commons' -include ':postssystem.utils.repos.exposed' +String[] includes = [ + ':utils:repos', + ':utils:repos:exposed', -include ':postssystem.core' -include ':postssystem.core.exposed' + ':exposed:commons', -include ':postssystem.core.publishing' -include ':postssystem.core.publishing.exposed' + ':ktor:common', + ':ktor:client', -include ':postssystem.markups.core' -include ':postssystem.markups.html' + ':core:api', + ':core:exposed', + ':core:ktor:common', + ':core:ktor:client', + + ':publishing:api', + ':publishing:exposed', + + ':markups', + ':markups:html' +] + +includes.each { + include it +} diff --git a/postssystem.utils.repos/build.gradle b/utils/repos/build.gradle similarity index 100% rename from postssystem.utils.repos/build.gradle rename to utils/repos/build.gradle diff --git a/postssystem.utils.repos.exposed/build.gradle b/utils/repos/exposed/build.gradle similarity index 83% rename from postssystem.utils.repos.exposed/build.gradle rename to utils/repos/exposed/build.gradle index cd67605a..554e442f 100644 --- a/postssystem.utils.repos.exposed/build.gradle +++ b/utils/repos/exposed/build.gradle @@ -13,7 +13,7 @@ buildscript { } plugins { - id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" + id "org.jetbrains.kotlin.plugin.serialization" } project.version = "$core_version" @@ -31,14 +31,14 @@ repositories { } dependencies { - api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { api "com.insanusmokrassar:postssystem.utils.repos:$core_version" api "com.insanusmokrassar:postssystem.exposed.commons:$core_version" } else { - api project(":postssystem.utils.repos") - api project(":postssystem.exposed.commons") + api project(":utils:repos") + api project(":exposed:commons") } testImplementation "org.xerial:sqlite-jdbc:$test_sqlite_version" diff --git a/postssystem.utils.repos.exposed/gradle.properties b/utils/repos/exposed/gradle.properties similarity index 100% rename from postssystem.utils.repos.exposed/gradle.properties rename to utils/repos/exposed/gradle.properties diff --git a/utils/repos/exposed/maven.publish.gradle b/utils/repos/exposed/maven.publish.gradle new file mode 100644 index 00000000..50ee129b --- /dev/null +++ b/utils/repos/exposed/maven.publish.gradle @@ -0,0 +1,53 @@ +apply plugin: 'maven-publish' + +task javadocsJar(type: Jar) { + classifier = 'javadoc' +} + +afterEvaluate { + project.publishing.publications.all { + // rename artifacts + groupId "${project.group}" + if (it.name.contains('kotlinMultiplatform')) { + artifactId = "${project.name}" + } else { + artifactId = "${project.name}-$name" + } + } +} + +publishing { + publications.all { + artifact javadocsJar + + pom { + description = "Common utils for all exposed modules" + name = "PostsSystem Exposed commons" + url = "https://git.insanusmokrassar.com/PostsSystem/Core/" + + scm { + developerConnection = "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/Core/.git[push=]https://git.insanusmokrassar.com/PostsSystem/Core/.git" + url = "https://git.insanusmokrassar.com/PostsSystem/Core/.git" + } + + developers { + + developer { + id = "InsanusMokrassar" + name = "Ovsiannikov Aleksei" + email = "ovsyannikov.alexey95@gmail.com" + } + + } + + licenses { + + license { + name = "Apache Software License 2.0" + url = "https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE" + } + + } + } + } +} \ No newline at end of file diff --git a/postssystem.utils.repos/publish.gradle b/utils/repos/exposed/publish.gradle similarity index 100% rename from postssystem.utils.repos/publish.gradle rename to utils/repos/exposed/publish.gradle diff --git a/utils/repos/exposed/publish_config.kpsb b/utils/repos/exposed/publish_config.kpsb new file mode 100644 index 00000000..2bd43e2b --- /dev/null +++ b/utils/repos/exposed/publish_config.kpsb @@ -0,0 +1 @@ +{"bintrayConfig":{"repo":"InsanusMokrassar","packageName":"${project.name}","packageVcs":"https://github.com/PostsSystem/PostsSystemCore"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE"}],"mavenConfig":{"name":"PostsSystem Exposed commons","description":"Common utils for all exposed modules","url":"https://git.insanusmokrassar.com/PostsSystem/Core/","vcsUrl":"https://git.insanusmokrassar.com/PostsSystem/Core/.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"} \ No newline at end of file diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedCRUDRepo.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedCRUDRepo.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedCRUDRepo.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedCRUDRepo.kt diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedReadCRUDRepo.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedReadCRUDRepo.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedReadCRUDRepo.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedReadCRUDRepo.kt diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedWriteCRUDRepo.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedWriteCRUDRepo.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedWriteCRUDRepo.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/AbstractExposedWriteCRUDRepo.kt diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedCRUDRepo.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedCRUDRepo.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedCRUDRepo.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedCRUDRepo.kt diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedTableInitialization.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedTableInitialization.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedTableInitialization.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/ExposedTableInitialization.kt diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedKeyValueRepo.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedKeyValueRepo.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedKeyValueRepo.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedKeyValueRepo.kt diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedReadKeyValueRepo.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedReadKeyValueRepo.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedReadKeyValueRepo.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/keyvalue/AbstractExposedReadKeyValueRepo.kt diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedKeyValueRepo.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedKeyValueRepo.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedKeyValueRepo.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedKeyValueRepo.kt diff --git a/postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedReadKeyValueRepo.kt b/utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedReadKeyValueRepo.kt similarity index 100% rename from postssystem.utils.repos.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedReadKeyValueRepo.kt rename to utils/repos/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/utils/repos/exposed/onetomany/AbstractOneToManyExposedReadKeyValueRepo.kt diff --git a/postssystem.utils.repos/maven.publish.gradle b/utils/repos/maven.publish.gradle similarity index 100% rename from postssystem.utils.repos/maven.publish.gradle rename to utils/repos/maven.publish.gradle diff --git a/utils/repos/publish.gradle b/utils/repos/publish.gradle new file mode 100644 index 00000000..b8cf4528 --- /dev/null +++ b/utils/repos/publish.gradle @@ -0,0 +1,55 @@ +apply plugin: 'com.jfrog.bintray' + +apply from: "maven.publish.gradle" + +bintray { + user = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') + key = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') + filesSpec { + from "${buildDir}/publications/" + eachFile { + String directorySubname = it.getFile().parentFile.name + if (it.getName() == "module.json") { + if (directorySubname == "kotlinMultiplatform") { + it.setPath("${project.name}/${project.version}/${project.name}-${project.version}.module") + } else { + it.setPath("${project.name}-${directorySubname}/${project.version}/${project.name}-${directorySubname}-${project.version}.module") + } + } else { + if (directorySubname == "kotlinMultiplatform" && it.getName() == "pom-default.xml") { + it.setPath("${project.name}/${project.version}/${project.name}-${project.version}.pom") + } else { + it.exclude() + } + } + } + into "${project.group}".replace(".", "/") + } + pkg { + repo = "InsanusMokrassar" + name = "${project.name}" + vcsUrl = "https://github.com/PostsSystem/PostsSystemCore" + licenses = ["Apache-2.0"] + version { + name = "${project.version}" + released = new Date() + vcsTag = "${project.version}" + gpg { + sign = true + passphrase = project.hasProperty('signing.gnupg.passphrase') ? project.property('signing.gnupg.passphrase') : System.getenv('signing.gnupg.passphrase') + } + } + } +} + +bintrayUpload.doFirst { + publications = publishing.publications.collect { + if (it.name.contains('kotlinMultiplatform')) { + null + } else { + it.name + } + } - null +} + +bintrayUpload.dependsOn publishToMavenLocal \ No newline at end of file diff --git a/postssystem.utils.repos/publish_config.kpsb b/utils/repos/publish_config.kpsb similarity index 100% rename from postssystem.utils.repos/publish_config.kpsb rename to utils/repos/publish_config.kpsb diff --git a/postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/IdUtils.kt b/utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/IdUtils.kt similarity index 100% rename from postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/IdUtils.kt rename to utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/IdUtils.kt diff --git a/postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/OneToManyKeyValueRepo.kt b/utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/OneToManyKeyValueRepo.kt similarity index 100% rename from postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/OneToManyKeyValueRepo.kt rename to utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/OneToManyKeyValueRepo.kt diff --git a/postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/Repo.kt b/utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/Repo.kt similarity index 100% rename from postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/Repo.kt rename to utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/Repo.kt diff --git a/postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardCRUDRepo.kt b/utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardCRUDRepo.kt similarity index 100% rename from postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardCRUDRepo.kt rename to utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardCRUDRepo.kt diff --git a/postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardKeyValueRepo.kt b/utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardKeyValueRepo.kt similarity index 100% rename from postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardKeyValueRepo.kt rename to utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/StandardKeyValueRepo.kt diff --git a/postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/Pagination.kt b/utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/Pagination.kt similarity index 100% rename from postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/Pagination.kt rename to utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/Pagination.kt diff --git a/postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/PaginationResult.kt b/utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/PaginationResult.kt similarity index 100% rename from postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/PaginationResult.kt rename to utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/PaginationResult.kt diff --git a/postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/SimplePagination.kt b/utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/SimplePagination.kt similarity index 100% rename from postssystem.utils.repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/SimplePagination.kt rename to utils/repos/src/commonMain/kotlin/com/insanusmokrassar/postssystem/utils/repos/pagination/SimplePagination.kt