From fa18e7299d8116baf4d48009c1b02eb3519f77cb Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 3 Feb 2021 22:59:37 +0600 Subject: [PATCH 01/10] 0.32.4 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 838d6cac4a..c7dbf3318a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 0.32.4 + ## 0.32.3 * `Behaviour Builder`: diff --git a/gradle.properties b/gradle.properties index a8a2fe0fb5..90519c8f83 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,6 +17,6 @@ micro_utils_version=0.4.23 javax_activation_version=1.1.1 library_group=dev.inmo -library_version=0.32.3 +library_version=0.32.4 github_release_plugin_version=2.2.12 From 86bfe043a5617dd6f914b2da9ca9dc4e6a2b658e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 3 Feb 2021 23:05:17 +0600 Subject: [PATCH 02/10] update dependencies --- CHANGELOG.md | 4 ++++ gradle.properties | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7dbf3318a..1cfbee8d4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.32.4 +* `Common`: + * `Version`: + * `Kotlin`: `1.4.21` -> `1.4.30` + ## 0.32.3 * `Behaviour Builder`: diff --git a/gradle.properties b/gradle.properties index 90519c8f83..f7ebee4b84 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ kotlin.js.generate.externals=true kotlin.incremental=true kotlin.incremental.js=true -kotlin_version=1.4.21 +kotlin_version=1.4.30 kotlin_coroutines_version=1.4.2 kotlin_serialisation_runtime_version=1.0.1 klock_version=2.0.4 From 0b93b472a34b561bb1a8a8494cdf71fbdf55cbf4 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Feb 2021 14:22:42 +0600 Subject: [PATCH 03/10] update klock --- CHANGELOG.md | 1 + gradle.properties | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cfbee8d4f..256741a340 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * `Common`: * `Version`: * `Kotlin`: `1.4.21` -> `1.4.30` + * `Klock`: `2.0.4` -> `2.0.6` ## 0.32.3 diff --git a/gradle.properties b/gradle.properties index f7ebee4b84..e2d32b11ac 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ kotlin.incremental.js=true kotlin_version=1.4.30 kotlin_coroutines_version=1.4.2 kotlin_serialisation_runtime_version=1.0.1 -klock_version=2.0.4 +klock_version=2.0.6 uuid_version=0.2.3 ktor_version=1.5.1 From 6a625d7b9fa8a1e3c648713309b66e5855c6e3fb Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Feb 2021 16:08:28 +0600 Subject: [PATCH 04/10] update publishing scripts --- tgbotapi.core/publish.gradle | 16 ---------------- tgbotapi.extensions.api/publish.gradle | 16 ---------------- .../publish.gradle | 16 ---------------- tgbotapi.extensions.utils/publish.gradle | 16 ---------------- tgbotapi/publish.gradle | 16 ---------------- 5 files changed, 80 deletions(-) diff --git a/tgbotapi.core/publish.gradle b/tgbotapi.core/publish.gradle index 830dcfc8cd..ee36f78c8d 100644 --- a/tgbotapi.core/publish.gradle +++ b/tgbotapi.core/publish.gradle @@ -4,22 +4,6 @@ apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' } -task sourceJar (type : Jar) { - classifier = 'sources' -} - -afterEvaluate { - project.publishing.publications.all { - // rename artifacts - groupId "${project.group}" - if (it.name.contains('kotlinMultiplatform')) { - artifactId = "${project.name}" - artifact sourceJar - } else { - artifactId = "${project.name}-$name" - } - } -} publishing { publications.all { diff --git a/tgbotapi.extensions.api/publish.gradle b/tgbotapi.extensions.api/publish.gradle index 0266714313..23dc08108a 100644 --- a/tgbotapi.extensions.api/publish.gradle +++ b/tgbotapi.extensions.api/publish.gradle @@ -4,22 +4,6 @@ apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' } -task sourceJar (type : Jar) { - classifier = 'sources' -} - -afterEvaluate { - project.publishing.publications.all { - // rename artifacts - groupId "${project.group}" - if (it.name.contains('kotlinMultiplatform')) { - artifactId = "${project.name}" - artifact sourceJar - } else { - artifactId = "${project.name}-$name" - } - } -} publishing { publications.all { diff --git a/tgbotapi.extensions.behaviour_builder/publish.gradle b/tgbotapi.extensions.behaviour_builder/publish.gradle index 810de33d55..b2ca3d0bc5 100644 --- a/tgbotapi.extensions.behaviour_builder/publish.gradle +++ b/tgbotapi.extensions.behaviour_builder/publish.gradle @@ -4,22 +4,6 @@ apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' } -task sourceJar (type : Jar) { - classifier = 'sources' -} - -afterEvaluate { - project.publishing.publications.all { - // rename artifacts - groupId "${project.group}" - if (it.name.contains('kotlinMultiplatform')) { - artifactId = "${project.name}" - artifact sourceJar - } else { - artifactId = "${project.name}-$name" - } - } -} publishing { publications.all { diff --git a/tgbotapi.extensions.utils/publish.gradle b/tgbotapi.extensions.utils/publish.gradle index e812aa7116..9edc0af8e4 100644 --- a/tgbotapi.extensions.utils/publish.gradle +++ b/tgbotapi.extensions.utils/publish.gradle @@ -4,22 +4,6 @@ apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' } -task sourceJar (type : Jar) { - classifier = 'sources' -} - -afterEvaluate { - project.publishing.publications.all { - // rename artifacts - groupId "${project.group}" - if (it.name.contains('kotlinMultiplatform')) { - artifactId = "${project.name}" - artifact sourceJar - } else { - artifactId = "${project.name}-$name" - } - } -} publishing { publications.all { diff --git a/tgbotapi/publish.gradle b/tgbotapi/publish.gradle index c862f41bc1..3a4ba9984e 100644 --- a/tgbotapi/publish.gradle +++ b/tgbotapi/publish.gradle @@ -4,22 +4,6 @@ apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' } -task sourceJar (type : Jar) { - classifier = 'sources' -} - -afterEvaluate { - project.publishing.publications.all { - // rename artifacts - groupId "${project.group}" - if (it.name.contains('kotlinMultiplatform')) { - artifactId = "${project.name}" - artifact sourceJar - } else { - artifactId = "${project.name}-$name" - } - } -} publishing { publications.all { From 51871ea94c2fe1a9dee7e0f07e669e0b07f1e1b0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Feb 2021 16:08:45 +0600 Subject: [PATCH 05/10] update micro_utils version --- CHANGELOG.md | 1 + gradle.properties | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 256741a340..545b4a8061 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * `Version`: * `Kotlin`: `1.4.21` -> `1.4.30` * `Klock`: `2.0.4` -> `2.0.6` + * `MicroUtils`: `0.4.23` -> `0.4.24` ## 0.32.3 diff --git a/gradle.properties b/gradle.properties index e2d32b11ac..7c3511a5ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ klock_version=2.0.6 uuid_version=0.2.3 ktor_version=1.5.1 -micro_utils_version=0.4.23 +micro_utils_version=0.4.24 javax_activation_version=1.1.1 From 18913af3c3ef8e92ac63d19d381634b8807380eb Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 6 Feb 2021 00:50:51 +0600 Subject: [PATCH 06/10] update publishing scripts --- tgbotapi.core/mpp_publish_template.kpsb | 2 +- tgbotapi.core/publish.gradle | 12 +++++++++++- tgbotapi.extensions.api/mpp_publish_template.kpsb | 2 +- tgbotapi.extensions.api/publish.gradle | 12 +++++++++++- .../mpp_publish_template.kpsb | 2 +- tgbotapi.extensions.behaviour_builder/publish.gradle | 12 +++++++++++- tgbotapi.extensions.utils/mpp_publish_template.kpsb | 2 +- tgbotapi.extensions.utils/publish.gradle | 12 +++++++++++- tgbotapi/mpp_publish_template.kpsb | 2 +- tgbotapi/publish.gradle | 12 +++++++++++- 10 files changed, 60 insertions(+), 10 deletions(-) diff --git a/tgbotapi.core/mpp_publish_template.kpsb b/tgbotapi.core/mpp_publish_template.kpsb index 6a42a55995..3ab5711efd 100644 --- a/tgbotapi.core/mpp_publish_template.kpsb +++ b/tgbotapi.core/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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 Core","description":"Library for Object-Oriented and type-safe work with Telegram Bot API","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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 Core","description":"Library for Object-Oriented and type-safe work with Telegram Bot API","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file diff --git a/tgbotapi.core/publish.gradle b/tgbotapi.core/publish.gradle index ee36f78c8d..4da193013f 100644 --- a/tgbotapi.core/publish.gradle +++ b/tgbotapi.core/publish.gradle @@ -48,6 +48,16 @@ publishing { password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') } } + + maven { + name = "sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER') + password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') + } + } + } } @@ -55,5 +65,5 @@ publishing { signing { useGpgCmd() - publishing.publications.forEach { sign it } + sign publishing.publications } diff --git a/tgbotapi.extensions.api/mpp_publish_template.kpsb b/tgbotapi.extensions.api/mpp_publish_template.kpsb index 761921ed95..11162eaf0c 100644 --- a/tgbotapi.extensions.api/mpp_publish_template.kpsb +++ b/tgbotapi.extensions.api/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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 Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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 Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file diff --git a/tgbotapi.extensions.api/publish.gradle b/tgbotapi.extensions.api/publish.gradle index 23dc08108a..373e5538f1 100644 --- a/tgbotapi.extensions.api/publish.gradle +++ b/tgbotapi.extensions.api/publish.gradle @@ -48,6 +48,16 @@ publishing { password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') } } + + maven { + name = "sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER') + password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') + } + } + } } @@ -55,5 +65,5 @@ publishing { signing { useGpgCmd() - publishing.publications.forEach { sign it } + sign publishing.publications } diff --git a/tgbotapi.extensions.behaviour_builder/mpp_publish_template.kpsb b/tgbotapi.extensions.behaviour_builder/mpp_publish_template.kpsb index 0c1022373b..b1cec57fa3 100644 --- a/tgbotapi.extensions.behaviour_builder/mpp_publish_template.kpsb +++ b/tgbotapi.extensions.behaviour_builder/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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 Steps Extensions","description":"This extensions project contains tools for simple interaction with chats","url":"https://insanusmokrassar.github.io/TelegramBotAPI/tgbotapi.extensions.steps","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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 Steps Extensions","description":"This extensions project contains tools for simple interaction with chats","url":"https://insanusmokrassar.github.io/TelegramBotAPI/tgbotapi.extensions.steps","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file diff --git a/tgbotapi.extensions.behaviour_builder/publish.gradle b/tgbotapi.extensions.behaviour_builder/publish.gradle index b2ca3d0bc5..0ffbe9a1e4 100644 --- a/tgbotapi.extensions.behaviour_builder/publish.gradle +++ b/tgbotapi.extensions.behaviour_builder/publish.gradle @@ -48,6 +48,16 @@ publishing { password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') } } + + maven { + name = "sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER') + password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') + } + } + } } @@ -55,5 +65,5 @@ publishing { signing { useGpgCmd() - publishing.publications.forEach { sign it } + sign publishing.publications } diff --git a/tgbotapi.extensions.utils/mpp_publish_template.kpsb b/tgbotapi.extensions.utils/mpp_publish_template.kpsb index 461908fb92..4bca81cb8c 100644 --- a/tgbotapi.extensions.utils/mpp_publish_template.kpsb +++ b/tgbotapi.extensions.utils/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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 Utility Extensions","description":"Util extensions for more useful work with updates and other things","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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 Utility Extensions","description":"Util extensions for more useful work with updates and other things","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file diff --git a/tgbotapi.extensions.utils/publish.gradle b/tgbotapi.extensions.utils/publish.gradle index 9edc0af8e4..d164628dc6 100644 --- a/tgbotapi.extensions.utils/publish.gradle +++ b/tgbotapi.extensions.utils/publish.gradle @@ -48,6 +48,16 @@ publishing { password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') } } + + maven { + name = "sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER') + password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') + } + } + } } @@ -55,5 +65,5 @@ publishing { signing { useGpgCmd() - publishing.publications.forEach { sign it } + sign publishing.publications } diff --git a/tgbotapi/mpp_publish_template.kpsb b/tgbotapi/mpp_publish_template.kpsb index f41897a8f8..e4f257f9fa 100644 --- a/tgbotapi/mpp_publish_template.kpsb +++ b/tgbotapi/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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","description":"This project just include all subproject of TelegramBotAPI","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"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","description":"This project just include all subproject of TelegramBotAPI","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file diff --git a/tgbotapi/publish.gradle b/tgbotapi/publish.gradle index 3a4ba9984e..37804a0141 100644 --- a/tgbotapi/publish.gradle +++ b/tgbotapi/publish.gradle @@ -48,6 +48,16 @@ publishing { password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') } } + + maven { + name = "sonatype" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER') + password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') + } + } + } } @@ -55,5 +65,5 @@ publishing { signing { useGpgCmd() - publishing.publications.forEach { sign it } + sign publishing.publications } From baf8ed3a77d365c33301e952a58dccbc1bf65dbc Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 6 Feb 2021 00:52:39 +0600 Subject: [PATCH 07/10] now JVM part will be compiled with IR --- tgbotapi.core/build.gradle | 4 +++- tgbotapi.extensions.api/build.gradle | 4 +++- tgbotapi.extensions.behaviour_builder/build.gradle | 4 +++- tgbotapi.extensions.utils/build.gradle | 4 +++- tgbotapi/build.gradle | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tgbotapi.core/build.gradle b/tgbotapi.core/build.gradle index 1894298a2a..9646921743 100644 --- a/tgbotapi.core/build.gradle +++ b/tgbotapi.core/build.gradle @@ -29,7 +29,9 @@ repositories { } kotlin { - jvm() + jvm { + compilations.main.kotlinOptions.useIR = true + } js(BOTH) { browser() nodejs() diff --git a/tgbotapi.extensions.api/build.gradle b/tgbotapi.extensions.api/build.gradle index 8d969fa877..1d557205fe 100644 --- a/tgbotapi.extensions.api/build.gradle +++ b/tgbotapi.extensions.api/build.gradle @@ -29,7 +29,9 @@ repositories { } kotlin { - jvm() + jvm { + compilations.main.kotlinOptions.useIR = true + } js(BOTH) { browser() nodejs() diff --git a/tgbotapi.extensions.behaviour_builder/build.gradle b/tgbotapi.extensions.behaviour_builder/build.gradle index d84108226f..ffa6a93381 100644 --- a/tgbotapi.extensions.behaviour_builder/build.gradle +++ b/tgbotapi.extensions.behaviour_builder/build.gradle @@ -29,7 +29,9 @@ repositories { } kotlin { - jvm() + jvm { + compilations.main.kotlinOptions.useIR = true + } js(BOTH) { browser() nodejs() diff --git a/tgbotapi.extensions.utils/build.gradle b/tgbotapi.extensions.utils/build.gradle index 8d969fa877..1d557205fe 100644 --- a/tgbotapi.extensions.utils/build.gradle +++ b/tgbotapi.extensions.utils/build.gradle @@ -29,7 +29,9 @@ repositories { } kotlin { - jvm() + jvm { + compilations.main.kotlinOptions.useIR = true + } js(BOTH) { browser() nodejs() diff --git a/tgbotapi/build.gradle b/tgbotapi/build.gradle index 29cf75b274..895e728acf 100644 --- a/tgbotapi/build.gradle +++ b/tgbotapi/build.gradle @@ -29,7 +29,9 @@ repositories { } kotlin { - jvm() + jvm { + compilations.main.kotlinOptions.useIR = true + } js(BOTH) { browser() nodejs() From 27dc302f5d6f5d881436cacfe5a5e2c23a6a6015 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 6 Feb 2021 11:53:30 +0600 Subject: [PATCH 08/10] update for compiling --- gradle.properties | 2 +- .../bot/settings/limiters/CommonLimiter.kt | 2 + .../requests/chat/modify/SetChatPhoto.kt | 2 + .../tgbotapi/requests/send/polls/SendPoll.kt | 107 ++++++++++++++---- .../passport/decrypted/AddressSecureValue.kt | 4 +- .../decrypted/PersonalDetailsSecureValue.kt | 4 +- .../dev/inmo/tgbotapi/types/polls/Poll.kt | 3 + 7 files changed, 98 insertions(+), 26 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7c3511a5ab..20ac5b4bd5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ kotlin.incremental.js=true kotlin_version=1.4.30 kotlin_coroutines_version=1.4.2 -kotlin_serialisation_runtime_version=1.0.1 +kotlin_serialisation_runtime_version=1.1.0-RC klock_version=2.0.6 uuid_version=0.2.3 ktor_version=1.5.1 diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/CommonLimiter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/CommonLimiter.kt index a38d5a60fd..822f2170a6 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/CommonLimiter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/CommonLimiter.kt @@ -17,7 +17,9 @@ class CommonLimiter( @Transient private val scope: CoroutineScope = CoroutineScope(Dispatchers.Default) ) : RequestLimiter { + @Transient private val quotaSemaphore = Semaphore(lockCount) + @Transient private val counterRegeneratorJob = scope.launch { val regenDelay: MilliSeconds = (regenTime.toDouble() / lockCount).roundToLong() while (isActive) { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt index f439f7e80a..4513de5fba 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt @@ -18,6 +18,8 @@ data class SetChatPhoto ( override fun method(): String = "setChatPhoto" override val resultDeserializer: DeserializationStrategy get() = Boolean.serializer() + @Transient override val mediaMap: Map = mapOf(photoField to photo) + @Transient override val paramsJson: JsonObject = toJson(serializer()) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt index 0115d80198..d4bfd445cf 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.requests.send.polls import com.soywiz.klock.DateTime +import com.soywiz.klock.TimeSpan import dev.inmo.tgbotapi.CommonAbstracts.* import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest @@ -16,6 +17,11 @@ import kotlinx.serialization.* private val commonResultDeserializer: DeserializationStrategy> = TelegramBotAPIMessageDeserializationStrategyClass() +private inline val ApproximateScheduledCloseInfo.openPeriod + get() = openDuration.millisecondsLong.div(1000) +private inline val ExactScheduledCloseInfo.closeDate + get() = closeDateTime.unixMillisLong.div(1000) + private fun checkPollInfo( question: String, options: List @@ -138,12 +144,23 @@ sealed class SendPoll : SendMessageRequest>, abstract val options: List abstract val isAnonymous: Boolean abstract val isClosed: Boolean - abstract val closeInfo: ScheduledCloseInfo? abstract val type: String internal abstract val openPeriod: LongSeconds? internal abstract val closeDate: LongSeconds? + protected val creationDate = DateTime.now() + open val closeInfo: ScheduledCloseInfo? + get() { + val openPeriod = openPeriod + val closeDate = closeDate + return when { + openPeriod != null -> openPeriod.asApproximateScheduledCloseInfo(creationDate) + closeDate != null -> closeDate.asExactScheduledCloseInfo + else -> null + } + } + override fun method(): String = "sendPoll" override val resultDeserializer: DeserializationStrategy> get() = commonResultDeserializer @@ -163,8 +180,10 @@ data class SendRegularPoll( override val isClosed: Boolean = false, @SerialName(allowsMultipleAnswersField) val allowMultipleAnswers: Boolean = false, - @Transient - override val closeInfo: ScheduledCloseInfo? = null, + @SerialName(openPeriodField) + override val openPeriod: LongSeconds?= null, + @SerialName(closeDateField) + override val closeDate: LongSeconds?, @SerialName(disableNotificationField) override val disableNotification: Boolean = false, @SerialName(replyToMessageIdField) @@ -178,20 +197,39 @@ data class SendRegularPoll( override val requestSerializer: SerializationStrategy<*> get() = serializer() - @SerialName(openPeriodField) - override val openPeriod: LongSeconds? - = (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.millisecondsLong ?.div(1000) - - @SerialName(closeDateField) - override val closeDate: LongSeconds? - = (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000) - init { checkPollInfo(question, options) closeInfo ?.checkSendData() } } +fun SendRegularPoll( + chatId: ChatIdentifier, + question: String, + options: List, + isAnonymous: Boolean = true, + isClosed: Boolean = false, + allowMultipleAnswers: Boolean = false, + closeInfo: ScheduledCloseInfo? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = SendRegularPoll( + chatId, + question, + options, + isAnonymous, + isClosed, + allowMultipleAnswers, + (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod, + (closeInfo as? ExactScheduledCloseInfo) ?.closeDate, + disableNotification, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + fun SendQuizPoll( chatId: ChatIdentifier, question: String, @@ -253,6 +291,39 @@ fun SendQuizPoll( replyMarkup ) +internal fun SendQuizPoll( + chatId: ChatIdentifier, + question: String, + options: List, + correctOptionId: Int, + isAnonymous: Boolean = true, + isClosed: Boolean = false, + explanation: String? = null, + parseMode: ParseMode? = null, + rawEntities: List? = null, + closeInfo: ScheduledCloseInfo? = null, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = SendQuizPoll( + chatId, + question, + options, + correctOptionId, + isAnonymous, + isClosed, + explanation, + parseMode, + rawEntities, + (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod, + (closeInfo as? ExactScheduledCloseInfo) ?.closeDate, + disableNotification, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + @Serializable data class SendQuizPoll internal constructor( @SerialName(chatIdField) @@ -273,8 +344,10 @@ data class SendQuizPoll internal constructor( override val parseMode: ParseMode? = null, @SerialName(explanationEntitiesField) private val rawEntities: List? = null, - @Transient - override val closeInfo: ScheduledCloseInfo? = null, + @SerialName(openPeriodField) + override val openPeriod: LongSeconds? = null, + @SerialName(closeDateField) + override val closeDate: LongSeconds? = null, @SerialName(disableNotificationField) override val disableNotification: Boolean = false, @SerialName(replyToMessageIdField) @@ -291,14 +364,6 @@ data class SendQuizPoll internal constructor( rawEntities ?.asTextParts(explanation ?: return@lazy null) ?.justTextSources() } - @SerialName(openPeriodField) - override val openPeriod: LongSeconds? - = (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.millisecondsLong ?.div(1000) - - @SerialName(closeDateField) - override val closeDate: LongSeconds? - = (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000) - init { checkPollInfo(question, options) closeInfo ?.checkSendData() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue.kt index d403e11db3..e46f85bea3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue.kt @@ -4,13 +4,13 @@ import dev.inmo.tgbotapi.types.dataField import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials import dev.inmo.tgbotapi.types.passport.credentials.EndDataCredentials import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import kotlinx.serialization.* @Serializable data class AddressSecureValue( @SerialName(dataField) override val data: DataCredentials ) : SecureValueWithData { + @Transient override val credentials: List = listOf(data) } \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PersonalDetailsSecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PersonalDetailsSecureValue.kt index 120b2bf77a..d269f76402 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PersonalDetailsSecureValue.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/PersonalDetailsSecureValue.kt @@ -4,13 +4,13 @@ import dev.inmo.tgbotapi.types.dataField import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials import dev.inmo.tgbotapi.types.passport.credentials.EndDataCredentials import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable +import kotlinx.serialization.* @Serializable data class PersonalDetailsSecureValue( @SerialName(dataField) override val data: DataCredentials ) : SecureValueWithData { + @Transient override val credentials: List = listOf(data) } \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt index 709fc5c9fe..8ca845fcd0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt @@ -33,6 +33,9 @@ val LongSeconds.asApproximateScheduledCloseInfo get() = ApproximateScheduledCloseInfo( TimeSpan(this * 1000.0) ) +fun LongSeconds.asApproximateScheduledCloseInfo(startPoint: DateTime) = ApproximateScheduledCloseInfo( + TimeSpan(this * 1000.0), startPoint +) val LongSeconds.asExactScheduledCloseInfo get() = ExactScheduledCloseInfo( DateTime(unixMillis = this * 1000.0) From a2ea15d4b0d09f802d34d77ca9a324edef92b4a6 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 7 Feb 2021 11:02:13 +0600 Subject: [PATCH 09/10] update wrapper version --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b9d52d8cb7..9fccb7a76d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip From 4748b6813ac8b9f90f7a4353e4701ba353ad74c0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 7 Feb 2021 12:40:05 +0600 Subject: [PATCH 10/10] ExceptionsOnlyLimiter now will not use Result to provide success/failure state of result --- .../bot/settings/limiters/ExceptionsOnlyLimiter.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/ExceptionsOnlyLimiter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/ExceptionsOnlyLimiter.kt index 643d302bbd..b3193160f0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/ExceptionsOnlyLimiter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/ExceptionsOnlyLimiter.kt @@ -37,11 +37,12 @@ class ExceptionsOnlyLimiter( override suspend fun limit(block: suspend () -> T): T { while (true) { lockState.first { !it } + var throwable: Throwable? = null val result = safely({ - when (it) { + throwable = when (it) { is TooMuchRequestsException -> { lock(it.retryAfter.leftToRetry) - Result.failure(it) + it } is ClientRequestException -> { if (it.response.status == HttpStatusCode.TooManyRequests) { @@ -49,15 +50,16 @@ class ExceptionsOnlyLimiter( } else { throw it } - Result.failure(it) + it } else -> throw it } + null }) { - Result.success(block()) + block() } - if (result.isSuccess) { - return result.getOrNull()!! + if (throwable == null) { + return result!! } } }