diff --git a/markups/commons/build.gradle b/markups/commons/build.gradle deleted file mode 100644 index bab85aa2..00000000 --- a/markups/commons/build.gradle +++ /dev/null @@ -1,84 +0,0 @@ -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 (BOTH) { - browser() - nodejs() - } - - sourceSets { - commonMain { - dependencies { - implementation kotlin('stdlib') - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlin_serialisation_core_version" - - if ((project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true") { - api "com.insanusmokrassar:postssystem.core.api:$core_version" - } else { - api projectByName("postssystem.core.api") - } - - api "com.soywiz.korlibs.klock:klock:$klockVersion" - api "com.benasher44:uuid:$uuidVersion" - } - } - 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/markups/commons/maven.publish.gradle b/markups/commons/maven.publish.gradle deleted file mode 100644 index c871a756..00000000 --- a/markups/commons/maven.publish.gradle +++ /dev/null @@ -1,60 +0,0 @@ -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 = "PostsSystem Core Repos utility subproject" - name = "PostsSystem Core Repos" - url = "https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore" - - scm { - developerConnection = "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git[push=]https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git" - url = "https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git" - } - - developers { - - developer { - id = "InsanusMokrassar" - name = "Ovsiannikov Aleksei" - email = "ovsyannikov.alexey95@gmail.com" - } - - - developer { - id = "mi-ast" - name = "Michail Astafiev" - email = "astaf65@gmail.com" - } - - } - - licenses { - - license { - name = "Apache Software License 2.0" - url = "https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore/src/master/LICENSE" - } - - } - } - } -} \ No newline at end of file diff --git a/markups/commons/publish.gradle b/markups/commons/publish.gradle deleted file mode 100644 index b8cf4528..00000000 --- a/markups/commons/publish.gradle +++ /dev/null @@ -1,55 +0,0 @@ -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/markups/commons/publish_config.kpsb b/markups/commons/publish_config.kpsb deleted file mode 100644 index 71046854..00000000 --- a/markups/commons/publish_config.kpsb +++ /dev/null @@ -1 +0,0 @@ -{"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/PostsSystemCore/src/master/LICENSE"}],"mavenConfig":{"name":"PostsSystem Markups Core subsystem","description":"PostsSystem Markups Core subsystem with base things for future markups modules","url":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore","vcsUrl":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"} \ No newline at end of file diff --git a/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt b/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt deleted file mode 100644 index 8fd9f496..00000000 --- a/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/AbstractMarkupPlugin.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.core - -//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/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupPlugin.kt b/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupPlugin.kt deleted file mode 100644 index e1046f27..00000000 --- a/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupPlugin.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.core - -typealias MarkupPluginName = String -typealias MarkupPluginIdentifier = String - -/** - * That is the plugin for platform, which is able to be drawn on the [MarkupTarget]. - * - * * Plugin could be some Telegram plugin - * * [MarkupTarget] could be web. - */ -interface MarkupPlugin { - /** - * This name will be used in `select`-questions on site - */ - val pluginName: MarkupPluginName - - val pluginId: MarkupPluginIdentifier - get() = pluginName - - /** - * Link to icon which will be used for links onto this plugin - */ - val iconLink: String? -} diff --git a/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupsSystem.kt b/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupsSystem.kt deleted file mode 100644 index 78b3bfdd..00000000 --- a/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/MarkupsSystem.kt +++ /dev/null @@ -1,47 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.core - -import com.insanusmokrassar.postssystem.markups.core.utils.ListBuilder -import com.insanusmokrassar.postssystem.utils.common.pagination.* -import com.insanusmokrassar.postssystem.utils.repos.ReadStandardCRUDRepo -import kotlin.math.min - -abstract class MarkupsSystem( - protected val plugins: List -) : ReadStandardCRUDRepo { - private val pluginsMap: Map = plugins.associateBy { it.pluginId } - - override suspend fun contains(id: MarkupPluginIdentifier): Boolean = pluginsMap.keys.contains(id) - override suspend fun getById(id: MarkupPluginIdentifier): MarkupPlugin? = pluginsMap[id] - override suspend fun getByPagination(pagination: Pagination): PaginationResult { - if (pagination.firstIndex > plugins.lastIndex) { - return emptyList().createPaginationResult( - pagination, - plugins.size.toLong() - ) - } - val lastExclusiveIndex = min(pagination.lastExclusiveIndex, plugins.size) - return plugins.subList(pagination.firstIndex, lastExclusiveIndex).createPaginationResult( - pagination, - plugins.size.toLong() - ) - } - - fun drawPluginsNamedList( - listBuilder: ListBuilder - ) { - listBuilder.createLinkedItems( - plugins.map { - it.pluginName to it.pluginId - } - ) - } - fun drawPluginsIconsList( - listBuilder: ListBuilder - ) { - listBuilder.createLinkedIconItems( - plugins.mapNotNull { - (it.iconLink ?: return@mapNotNull null) to it.pluginId - } - ) - } -} diff --git a/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/utils/ListBuilder.kt b/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/utils/ListBuilder.kt deleted file mode 100644 index 962fd2a8..00000000 --- a/markups/commons/src/commonMain/kotlin/com/insanusmokrassar/postssystem/markups/core/utils/ListBuilder.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.core.utils - -import com.insanusmokrassar.postssystem.markups.core.MarkupPluginIdentifier -import com.insanusmokrassar.postssystem.markups.core.MarkupPluginName - -typealias TitledListItem = Pair -typealias IconLinkListItem = Pair - -interface ListBuilder { - /** - * Accept the list of titled items with their ids - */ - fun createLinkedItems(data: List) - /** - * Accept the list of items with their icons links and ids - */ - fun createLinkedIconItems(data: List) -} diff --git a/markups/html/build.gradle b/markups/html/build.gradle deleted file mode 100644 index 37bb5578..00000000 --- a/markups/html/build.gradle +++ /dev/null @@ -1,83 +0,0 @@ -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 (BOTH) { - browser() - nodejs() - } - - sourceSets { - commonMain { - dependencies { - implementation kotlin('stdlib') - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlin_serialisation_core_version" - - 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 projectByName("postssystem.markups.commons") - } - } - } - commonTest { - dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') - } - } - jvmMain { - dependencies { - implementation kotlin('stdlib-jdk8') - api "org.jetbrains.kotlinx:kotlinx-html-jvm:$kotlinx_html_version" - } - } - jvmTest { - dependencies { - implementation kotlin('test-junit') - } - } - jsMain { - dependencies { - implementation kotlin('stdlib-js') - api "org.jetbrains.kotlinx:kotlinx-html-js:$kotlinx_html_version" - } - } - jsTest { - dependencies { - implementation kotlin('test-js') - implementation kotlin('test-junit') - } - } - } -} diff --git a/markups/html/gradle.properties b/markups/html/gradle.properties deleted file mode 100644 index a975e392..00000000 --- a/markups/html/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -kotlinx_html_version=0.7.1 diff --git a/markups/html/maven.publish.gradle b/markups/html/maven.publish.gradle deleted file mode 100644 index c871a756..00000000 --- a/markups/html/maven.publish.gradle +++ /dev/null @@ -1,60 +0,0 @@ -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 = "PostsSystem Core Repos utility subproject" - name = "PostsSystem Core Repos" - url = "https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore" - - scm { - developerConnection = "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git[push=]https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git" - url = "https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git" - } - - developers { - - developer { - id = "InsanusMokrassar" - name = "Ovsiannikov Aleksei" - email = "ovsyannikov.alexey95@gmail.com" - } - - - developer { - id = "mi-ast" - name = "Michail Astafiev" - email = "astaf65@gmail.com" - } - - } - - licenses { - - license { - name = "Apache Software License 2.0" - url = "https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore/src/master/LICENSE" - } - - } - } - } -} \ No newline at end of file diff --git a/markups/html/publish.gradle b/markups/html/publish.gradle deleted file mode 100644 index b8cf4528..00000000 --- a/markups/html/publish.gradle +++ /dev/null @@ -1,55 +0,0 @@ -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/markups/html/publish_config.kpsb b/markups/html/publish_config.kpsb deleted file mode 100644 index 71046854..00000000 --- a/markups/html/publish_config.kpsb +++ /dev/null @@ -1 +0,0 @@ -{"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/PostsSystemCore/src/master/LICENSE"}],"mavenConfig":{"name":"PostsSystem Markups Core subsystem","description":"PostsSystem Markups Core subsystem with base things for future markups modules","url":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore","vcsUrl":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"} \ No newline at end of file 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 deleted file mode 100644 index afd825b5..00000000 --- a/markups/html/src/jsMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.html - -//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 deleted file mode 100644 index afd825b5..00000000 --- a/markups/html/src/jvmMain/kotlin/com/insanusmokrassar/postssystem/markups/html/HtmlMarkupPlugin.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.insanusmokrassar.postssystem.markups.html - -//abstract class HtmlMarkupPlugin( -// postsRepo: ReadPostsRepo, -// postsContentRepo: ReadContentRepo -//) : AbstractMarkupPlugin(postsRepo, postsContentRepo) diff --git a/settings.gradle b/settings.gradle index dbb6eb43..02f5474c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -27,10 +27,7 @@ String[] includes = [ ':publishing:exposed', ':publishing:ktor:common', ':publishing:ktor:client', - ':publishing:ktor:server', - - ':markups:commons', - ':markups:html' + ':publishing:ktor:server' ]