From 52e25e934d2f0a501f8d0baf2dbe84cb191b4d25 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 14 May 2020 14:07:23 +0600 Subject: [PATCH] add TelegramBotAPI-all --- CHANGELOG.md | 2 + README.md | 12 +++-- TelegramBotAPI-all/README.md | 7 +++ TelegramBotAPI-all/build.gradle | 52 ++++++++++++++++++ TelegramBotAPI-all/maven.publish.gradle | 57 ++++++++++++++++++++ TelegramBotAPI-all/mpp_publish_template.json | 1 + TelegramBotAPI-all/publish.gradle | 55 +++++++++++++++++++ TelegramBotAPI/build.gradle | 9 ---- settings.gradle | 1 + 9 files changed, 183 insertions(+), 13 deletions(-) create mode 100644 TelegramBotAPI-all/README.md create mode 100644 TelegramBotAPI-all/build.gradle create mode 100644 TelegramBotAPI-all/maven.publish.gradle create mode 100644 TelegramBotAPI-all/mpp_publish_template.json create mode 100644 TelegramBotAPI-all/publish.gradle diff --git a/CHANGELOG.md b/CHANGELOG.md index 9629b3172a..d9534633ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,8 @@ * Updates utils were added * New extensions `setWebhook` and `includeWebhookInRoute` was added * New extension `CoroutineScope#updateHandlerWithMediaGroupsAdaptation` was added +* `TelegramBotAPI-all`: + * Project is created ### 0.27.2 diff --git a/README.md b/README.md index 8aea86a70a..b522762079 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ the list of this complex currently next projects: `RequestsExecutor`), which allows to use the core library in more pleasant way * [TelegramBotAPI Util Extensions](TelegramBotAPI-extensions-utils/README.md) - contains extensions for more comfortable work with commands, updates and other different things +* [TelegramBotAPI All](TelegramBotAPI-all/README.md) - concentration of all previously mentioned libraries Most part of some specific solves or unuseful moments are describing by official [Telegram Bot API](https://core.telegram.org/bots/api). @@ -62,12 +63,15 @@ kotlin { ## Ok, where should I start? -In most cases, the most simple way will be to implement -[TelegramBotAPI Extensions](TelegramBotAPI-extensions-api/README.md) and -[TelegramBotAPI Util Extensions](TelegramBotAPI-extensions-utils/README.md) for the reason that they contains more -simple tools. If you want to dive deeper in the core of library or develop something for it - welcome to +In most cases, the most simple way will be to implement [TelegramBotAPI All](TelegramBotAPI-all/README.md) - it contains +all necessary tools for comfort usage of this library. If you want to exclude some libraries, you can implement just +[TelegramBotAPI API Extensions](TelegramBotAPI-extensions-api/README.md), +[TelegramBotAPI Util Extensions](TelegramBotAPI-extensions-utils/README.md) or even [TelegramBotAPI](TelegramBotAPI/README.md). +If you want to dive deeper in the core of library or develop something for it - welcome to learn more from +[TelegramBotAPI](TelegramBotAPI/README.md) and our [Telegram Chat](https://teleg.one/InMoTelegramBotAPIChat). + Anyway, all libraries are very typical inside of them. Examples: * In `TelegramBotAPI` common request look like `requestsExecutor.execute(SomeRequest())` diff --git a/TelegramBotAPI-all/README.md b/TelegramBotAPI-all/README.md new file mode 100644 index 0000000000..a60c71722e --- /dev/null +++ b/TelegramBotAPI-all/README.md @@ -0,0 +1,7 @@ +# TelegramBotAPI-all + +Concentration of all TelegramBotAPI libraries: + +* [TelegramBotAPI](TelegramBotAPI/README.md) +* [TelegramBotAPI Extensions](TelegramBotAPI-extensions-api/README.md) +* [TelegramBotAPI Util Extensions](TelegramBotAPI-extensions-utils/README.md) diff --git a/TelegramBotAPI-all/build.gradle b/TelegramBotAPI-all/build.gradle new file mode 100644 index 0000000000..fd13bbb88f --- /dev/null +++ b/TelegramBotAPI-all/build.gradle @@ -0,0 +1,52 @@ +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 = "$library_version" +project.group = "$library_group" + +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 "${project.group}:TelegramBotAPI:$library_version" + api "${project.group}:TelegramBotAPI-extensions-api:$library_version" + api "${project.group}:TelegramBotAPI-extensions-utils:$library_version" + } else { + implementation project(":TelegramBotAPI") + implementation project(":TelegramBotAPI-extensions-api") + implementation project(":TelegramBotAPI-extensions-utils") + } + } + } + } +} diff --git a/TelegramBotAPI-all/maven.publish.gradle b/TelegramBotAPI-all/maven.publish.gradle new file mode 100644 index 0000000000..41fee78166 --- /dev/null +++ b/TelegramBotAPI-all/maven.publish.gradle @@ -0,0 +1,57 @@ +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.withXml { + asNode().children().last() + { + resolveStrategy = Closure.DELEGATE_FIRST + + description "This project just include all subproject of TelegramBotAPI" + name "Telegram Bot API All" + url "https://insanusmokrassar.github.io/TelegramBotAPI" + + scm { + developerConnection "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" + url "https://github.com/insanusmokrassar/TelegramBotAPI.git" + } + + developers { + + developer { + id "InsanusMokrassar" + name "Ovsiannikov Aleksei" + email "ovsyannikov.alexey95@gmail.com" + } + + } + + licenses { + + license { + name "Apache Software License 2.0" + url "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" + } + + } + } + } + } +} \ No newline at end of file diff --git a/TelegramBotAPI-all/mpp_publish_template.json b/TelegramBotAPI-all/mpp_publish_template.json new file mode 100644 index 0000000000..cbda0864b1 --- /dev/null +++ b/TelegramBotAPI-all/mpp_publish_template.json @@ -0,0 +1 @@ +{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API All","description":"This project just include all subproject of TelegramBotAPI","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"} \ No newline at end of file diff --git a/TelegramBotAPI-all/publish.gradle b/TelegramBotAPI-all/publish.gradle new file mode 100644 index 0000000000..2fd72b3b1a --- /dev/null +++ b/TelegramBotAPI-all/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 = "StandardRepository" + name = "${project.name}" + vcsUrl = "https://github.com/InsanusMokrassar/TelegramBotAPI" + 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/TelegramBotAPI/build.gradle b/TelegramBotAPI/build.gradle index d42e420763..c475e31eed 100644 --- a/TelegramBotAPI/build.gradle +++ b/TelegramBotAPI/build.gradle @@ -81,13 +81,4 @@ kotlin { } } } - - - targets.all { - compilations.all { - kotlinOptions { - freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi", "-Xopt-in=kotlin.RequiresOptIn"] - } - } - } } diff --git a/settings.gradle b/settings.gradle index 80b7407c7b..b75fc6176b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,5 @@ include ":TelegramBotAPI" include ":TelegramBotAPI-extensions-api" include ":TelegramBotAPI-extensions-utils" +include ":TelegramBotAPI-all" include ":docs"