From 02cedc662616960aee9f233d41a0b85e4fe88964 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 29 Jun 2022 13:27:29 +0600 Subject: [PATCH 1/4] start 2.1.2 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bdeebef0b..5a97db4abb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 2.1.2 + ## 2.1.1 * `API`: diff --git a/gradle.properties b/gradle.properties index eb67e259bb..43048feac1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,6 +20,6 @@ javax_activation_version=1.1.1 dokka_version=1.6.21 library_group=dev.inmo -library_version=2.1.1 +library_version=2.1.2 github_release_plugin_version=2.4.1 From e18e8ba6df87041bb341a8feb78dc1405ff6f048 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 29 Jun 2022 13:47:21 +0600 Subject: [PATCH 2/4] start to use more unified way of scripts organization --- build.gradle | 16 ++--- docs/build.gradle | 2 +- extensions.gradle | 8 +++ gradle/libs.versions.toml | 26 ++++++++ mppJsProject.gradle | 32 ++++++++++ mppProjectWithSerialization.gradle | 49 +++++++++++++++ tgbotapi.api/build.gradle | 39 +----------- tgbotapi.behaviour_builder.fsm/build.gradle | 41 +------------ tgbotapi.behaviour_builder/build.gradle | 39 +----------- tgbotapi.core/build.gradle | 67 +++------------------ tgbotapi.utils/build.gradle | 57 +----------------- tgbotapi.webapps/build.gradle | 40 +----------- 12 files changed, 139 insertions(+), 277 deletions(-) create mode 100644 extensions.gradle create mode 100644 gradle/libs.versions.toml create mode 100644 mppJsProject.gradle create mode 100644 mppProjectWithSerialization.gradle diff --git a/build.gradle b/build.gradle index 42562e8321..a953b15edf 100644 --- a/build.gradle +++ b/build.gradle @@ -6,19 +6,20 @@ buildscript { } dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" + classpath libs.kotlin.gradle.plugin + classpath libs.kotlin.serialization.plugin + classpath libs.kotlin.dokka.plugin classpath "com.github.breadmoirai:github-release:$github_release_plugin_version" } } -plugins { - id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version" apply false - id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" apply false -} - // temporal crutch until legacy tests will be stabled or legacy target will be removed allprojects { + repositories { + mavenLocal() + mavenCentral() + google() + } if (it != rootProject.findProject("docs")) { tasks.whenTaskAdded { task -> if(task.name == "jsLegacyBrowserTest" || task.name == "jsLegacyNodeTest") { @@ -27,6 +28,7 @@ allprojects { } } } +apply from: "./extensions.gradle" private String getCurrentVersionChangelog() { OutputStream changelogDataOS = new ByteArrayOutputStream() diff --git a/docs/build.gradle b/docs/build.gradle index 460bce0fc3..5a567aa1e2 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -14,7 +14,7 @@ buildscript { plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "org.jetbrains.dokka" version "$dokka_version" + id "org.jetbrains.dokka" } repositories { diff --git a/extensions.gradle b/extensions.gradle new file mode 100644 index 0000000000..bbe44c025d --- /dev/null +++ b/extensions.gradle @@ -0,0 +1,8 @@ +allprojects { + ext { + mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerialization.gradle" + mppJsProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJsProject.gradle" + + publishGradlePath = "${rootProject.projectDir.absolutePath}/publish.gradle" + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000000..334dea6b0f --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,26 @@ +[versions] + +kotlin = "1.6.21" +kotlin-serialization = "1.3.3" +kotlin-gradle-plugin = "7.0.4" + +[libraries] + +kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" } +kotlin-test-common = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlin" } +kotlin-test-annotations-common = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlin" } +kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } +kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref = "kotlin" } + +# buildscript classpaths + +android-tools-build = { module = "com.android.tools.build:gradle", version.ref = "kotlin-gradle-plugin" } +kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } +kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "kotlin" } + +[plugins] + +kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } diff --git a/mppJsProject.gradle b/mppJsProject.gradle new file mode 100644 index 0000000000..f7499b3c3b --- /dev/null +++ b/mppJsProject.gradle @@ -0,0 +1,32 @@ +project.version = "$version" +project.group = "$group" + +apply from: "$publishGradlePath" + +kotlin { + js (IR) { + browser() + nodejs() + } + + sourceSets { + commonMain { + dependencies { + implementation libs.kotlin + api libs.kotlin.serialization + } + } + commonTest { + dependencies { + implementation libs.kotlin.test.common + implementation libs.kotlin.test.annotations.common + } + } + jsTest { + dependencies { + implementation libs.kotlin.test.js + implementation libs.kotlin.test.junit + } + } + } +} diff --git a/mppProjectWithSerialization.gradle b/mppProjectWithSerialization.gradle new file mode 100644 index 0000000000..eba900f32b --- /dev/null +++ b/mppProjectWithSerialization.gradle @@ -0,0 +1,49 @@ +project.version = "$library_version" +project.group = "$library_group" + +apply from: "$publishGradlePath" + +kotlin { + jvm { + compilations.main { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + js (IR) { + browser() + nodejs() + } + + sourceSets { + commonMain { + dependencies { + implementation libs.kotlin + api libs.kotlin.serialization + } + } + commonTest { + dependencies { + implementation libs.kotlin.test.common + implementation libs.kotlin.test.annotations.common + } + } + jvmTest { + dependencies { + implementation libs.kotlin.test.junit + } + } + jsTest { + dependencies { + implementation libs.kotlin.test.js + implementation libs.kotlin.test.junit + } + } + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} diff --git a/tgbotapi.api/build.gradle b/tgbotapi.api/build.gradle index f6d1e00bcf..a8733e81fb 100644 --- a/tgbotapi.api/build.gradle +++ b/tgbotapi.api/build.gradle @@ -1,56 +1,19 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" } -project.version = "$library_version" -project.group = "$library_group" project.description = "API extensions with \"Telegram Bot API\"-like extensions for TelegramBot and RequestsExecutor" -apply from: "../publish.gradle" - -repositories { - mavenLocal() - mavenCentral() -} +apply from: "$mppProjectWithSerializationPresetPath" kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { commonMain { dependencies { - implementation kotlin('stdlib') api project(":tgbotapi.core") } } } } -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - diff --git a/tgbotapi.behaviour_builder.fsm/build.gradle b/tgbotapi.behaviour_builder.fsm/build.gradle index 1a2d2cc76d..271970635b 100644 --- a/tgbotapi.behaviour_builder.fsm/build.gradle +++ b/tgbotapi.behaviour_builder.fsm/build.gradle @@ -1,56 +1,19 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" } -project.version = "$library_version" -project.group = "$library_group" -project.description = "Behaviour Builder extension with built-in FSM" +project.description = "Behaviour Builder DSL" -apply from: "../publish.gradle" - -repositories { - mavenLocal() - mavenCentral() -} +apply from: "$mppProjectWithSerializationPresetPath" kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { commonMain { dependencies { - implementation kotlin('stdlib') api project(":tgbotapi.behaviour_builder") api "dev.inmo:micro_utils.fsm.common:$micro_utils_version" } } } } - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} diff --git a/tgbotapi.behaviour_builder/build.gradle b/tgbotapi.behaviour_builder/build.gradle index 68224e8bc7..9f6ea76c57 100644 --- a/tgbotapi.behaviour_builder/build.gradle +++ b/tgbotapi.behaviour_builder/build.gradle @@ -1,55 +1,18 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" } -project.version = "$library_version" -project.group = "$library_group" project.description = "Behaviour Builder DSL" -apply from: "../publish.gradle" - -repositories { - mavenLocal() - mavenCentral() -} +apply from: "$mppProjectWithSerializationPresetPath" kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { commonMain { dependencies { - implementation kotlin('stdlib') api project(":tgbotapi.utils") } } } } - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} diff --git a/tgbotapi.core/build.gradle b/tgbotapi.core/build.gradle index 28889e2fb0..a9ba153e57 100644 --- a/tgbotapi.core/build.gradle +++ b/tgbotapi.core/build.gradle @@ -1,48 +1,16 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" } -project.version = "$library_version" -project.group = "$library_group" project.description = "Core part of tgbotapi with all (and only) required functionality for working with Telegram Bot API" -apply from: "../publish.gradle" - -repositories { - mavenLocal() - mavenCentral() -} +apply from: "$mppProjectWithSerializationPresetPath" kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { commonMain { dependencies { - implementation kotlin('stdlib') api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_runtime_version" api "org.jetbrains.kotlinx:kotlinx-serialization-properties:$kotlin_serialisation_runtime_version" @@ -63,12 +31,9 @@ kotlin { } commonTest { dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') implementation project(":tgbotapi.utils") } } - jvmMain { dependencies { api "io.ktor:ktor-server:$ktor_version" @@ -79,29 +44,13 @@ kotlin { api "javax.activation:activation:$javax_activation_version" } } - jvmTest { - dependencies { - implementation kotlin('test-junit') - } - } - jsTest { - dependencies { - implementation kotlin('test-junit') - implementation kotlin('test-js') - } - } } - targets.all { - compilations.all { - kotlinOptions { - freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi", "-Xopt-in=kotlin.RequiresOptIn"] - } - } - } -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 +// targets.all { +// compilations.all { +// kotlinOptions { +// freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi", "-Xopt-in=kotlin.RequiresOptIn"] +// } +// } +// } } diff --git a/tgbotapi.utils/build.gradle b/tgbotapi.utils/build.gradle index d84f636549..a860a8e6e2 100644 --- a/tgbotapi.utils/build.gradle +++ b/tgbotapi.utils/build.gradle @@ -1,73 +1,18 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" } -project.version = "$library_version" -project.group = "$library_group" project.description = "Additional extensions for core part of tgbotapi" -apply from: "../publish.gradle" - -repositories { - mavenLocal() - mavenCentral() -} +apply from: "$mppProjectWithSerializationPresetPath" kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { commonMain { dependencies { - implementation kotlin('stdlib') api project(":tgbotapi.core") } } - - commonTest { - dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') - } - } - jvmTest { - dependencies { - implementation kotlin('test-junit') - } - } - jsTest { - dependencies { - implementation kotlin('test-junit') - implementation kotlin('test-js') - } - } } } - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} diff --git a/tgbotapi.webapps/build.gradle b/tgbotapi.webapps/build.gradle index 951c331574..ca80bfe22b 100644 --- a/tgbotapi.webapps/build.gradle +++ b/tgbotapi.webapps/build.gradle @@ -1,56 +1,18 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" } -project.version = "$library_version" -project.group = "$library_group" project.description = "Web App bindings for the Telegram Web Apps API" -apply from: "../publish.gradle" - -repositories { - mavenLocal() - mavenCentral() -} +apply from: "$mppProjectWithSerializationPresetPath" kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { commonMain { dependencies { - implementation kotlin('stdlib') api project(":tgbotapi.core") } } } } - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - From 864992aff0a3b31ed98c8d0705d04e6c6e17aef1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 29 Jun 2022 14:23:45 +0600 Subject: [PATCH 3/4] complete rewriting on libs.versions.toml --- build.gradle | 2 +- docs/build.gradle | 39 ++------------------ gradle.properties | 16 -------- gradle/libs.versions.toml | 35 +++++++++++++++++- mppProjectWithSerialization.gradle | 2 - tgbotapi.api/build.gradle | 1 + tgbotapi.behaviour_builder.fsm/build.gradle | 3 +- tgbotapi.behaviour_builder/build.gradle | 1 + tgbotapi.core/build.gradle | 35 +++++++++--------- tgbotapi.utils/build.gradle | 1 + tgbotapi.webapps/build.gradle | 1 + tgbotapi/build.gradle | 41 +-------------------- 12 files changed, 64 insertions(+), 113 deletions(-) diff --git a/build.gradle b/build.gradle index a953b15edf..521ed33ff9 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { classpath libs.kotlin.gradle.plugin classpath libs.kotlin.serialization.plugin classpath libs.kotlin.dokka.plugin - classpath "com.github.breadmoirai:github-release:$github_release_plugin_version" + classpath libs.github.release.plugin } } diff --git a/docs/build.gradle b/docs/build.gradle index 5a567aa1e2..0dc857b3ea 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -1,45 +1,17 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" - } -} - plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" id "org.jetbrains.dokka" } -repositories { - mavenLocal() - mavenCentral() -} +project.description = "Full collection of all built-in tgbotapi tools" + +apply from: "$mppProjectWithSerializationPresetPath" kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { commonMain { dependencies { - implementation kotlin('stdlib') - api project(":tgbotapi.core") api project(":tgbotapi.api") api project(":tgbotapi.utils") @@ -103,8 +75,3 @@ Object callback = { tasks.dokkaGfm(callback) tasks.dokkaHtml(callback) - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} diff --git a/gradle.properties b/gradle.properties index 43048feac1..790b2f75cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,21 +5,5 @@ kotlin.js.generate.externals=true kotlin.incremental=true kotlin.incremental.js=true -kotlin_version=1.6.21 -kotlin_coroutines_version=1.6.1 -kotlin_serialisation_runtime_version=1.3.3 -korlibs_version=2.7.0 -uuid_version=0.4.1 -ktor_version=2.0.2 - -micro_utils_version=0.11.6 - -javax_activation_version=1.1.1 - - -dokka_version=1.6.21 - library_group=dev.inmo library_version=2.1.2 - -github_release_plugin_version=2.4.1 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 334dea6b0f..055ce188e3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,23 +2,56 @@ kotlin = "1.6.21" kotlin-serialization = "1.3.3" +kotlin-coroutines = "1.6.3" kotlin-gradle-plugin = "7.0.4" +javax-activation = "1.1.1" + +korlibs = "2.7.0" +uuid = "0.4.1" +ktor = "2.0.3" + +microutils = "0.11.9" + +github-release-plugin = "2.4.1" + [libraries] kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" } kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" } +kotlin-serialization-properties = { module = "org.jetbrains.kotlinx:kotlinx-serialization-properties", version.ref = "kotlin-serialization" } kotlin-test-common = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlin" } kotlin-test-annotations-common = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlin" } kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref = "kotlin" } +ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } +ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } +ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" } +ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.ref = "ktor" } + +javax-activation = { module = "javax.activation:activation", version.ref = "javax-activation" } + +korlibs-klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "korlibs" } +korlibs-krypto = { module = "com.soywiz.korlibs.krypto:krypto", version.ref = "korlibs" } + +uuid = { module = "com.benasher44:uuid", version.ref = "uuid" } + +microutils-coroutines = { module = "dev.inmo:micro_utils.coroutines", version.ref = "microutils" } +microutils-serialization-base64 = { module = "dev.inmo:micro_utils.serialization.base64", version.ref = "microutils" } +microutils-serialization-encapsulator = { module = "dev.inmo:micro_utils.serialization.encapsulator", version.ref = "microutils" } +microutils-serialization-typedSerializer = { module = "dev.inmo:micro_utils.serialization.typed_serializer", version.ref = "microutils" } +microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", version.ref = "microutils" } +microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" } +microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" } + # buildscript classpaths -android-tools-build = { module = "com.android.tools.build:gradle", version.ref = "kotlin-gradle-plugin" } kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "kotlin" } +github-release-plugin = { module = "com.github.breadmoirai:github-release", version.ref = "github-release-plugin" } [plugins] diff --git a/mppProjectWithSerialization.gradle b/mppProjectWithSerialization.gradle index eba900f32b..b5b1d0585b 100644 --- a/mppProjectWithSerialization.gradle +++ b/mppProjectWithSerialization.gradle @@ -1,8 +1,6 @@ project.version = "$library_version" project.group = "$library_group" -apply from: "$publishGradlePath" - kotlin { jvm { compilations.main { diff --git a/tgbotapi.api/build.gradle b/tgbotapi.api/build.gradle index a8733e81fb..e9ad056888 100644 --- a/tgbotapi.api/build.gradle +++ b/tgbotapi.api/build.gradle @@ -6,6 +6,7 @@ plugins { project.description = "API extensions with \"Telegram Bot API\"-like extensions for TelegramBot and RequestsExecutor" apply from: "$mppProjectWithSerializationPresetPath" +apply from: "$publishGradlePath" kotlin { sourceSets { diff --git a/tgbotapi.behaviour_builder.fsm/build.gradle b/tgbotapi.behaviour_builder.fsm/build.gradle index 271970635b..6664a9bd85 100644 --- a/tgbotapi.behaviour_builder.fsm/build.gradle +++ b/tgbotapi.behaviour_builder.fsm/build.gradle @@ -6,13 +6,14 @@ plugins { project.description = "Behaviour Builder DSL" apply from: "$mppProjectWithSerializationPresetPath" +apply from: "$publishGradlePath" kotlin { sourceSets { commonMain { dependencies { api project(":tgbotapi.behaviour_builder") - api "dev.inmo:micro_utils.fsm.common:$micro_utils_version" + api libs.microutils.fsm.common } } } diff --git a/tgbotapi.behaviour_builder/build.gradle b/tgbotapi.behaviour_builder/build.gradle index 9f6ea76c57..69c4664b6e 100644 --- a/tgbotapi.behaviour_builder/build.gradle +++ b/tgbotapi.behaviour_builder/build.gradle @@ -6,6 +6,7 @@ plugins { project.description = "Behaviour Builder DSL" apply from: "$mppProjectWithSerializationPresetPath" +apply from: "$publishGradlePath" kotlin { sourceSets { diff --git a/tgbotapi.core/build.gradle b/tgbotapi.core/build.gradle index a9ba153e57..00c88b6d62 100644 --- a/tgbotapi.core/build.gradle +++ b/tgbotapi.core/build.gradle @@ -6,27 +6,28 @@ plugins { project.description = "Core part of tgbotapi with all (and only) required functionality for working with Telegram Bot API" apply from: "$mppProjectWithSerializationPresetPath" +apply from: "$publishGradlePath" kotlin { sourceSets { commonMain { dependencies { - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_runtime_version" - api "org.jetbrains.kotlinx:kotlinx-serialization-properties:$kotlin_serialisation_runtime_version" + api libs.kotlin.coroutines + api libs.kotlin.serialization + api libs.kotlin.serialization.properties - api "com.soywiz.korlibs.klock:klock:$korlibs_version" - api "com.soywiz.korlibs.krypto:krypto:$korlibs_version" - api "com.benasher44:uuid:$uuid_version" + api libs.korlibs.klock + api libs.korlibs.krypto + api libs.uuid - api "dev.inmo:micro_utils.coroutines:$micro_utils_version" - api "dev.inmo:micro_utils.serialization.base64:$micro_utils_version" - api "dev.inmo:micro_utils.serialization.encapsulator:$micro_utils_version" - api "dev.inmo:micro_utils.serialization.typed_serializer:$micro_utils_version" - api "dev.inmo:micro_utils.ktor.common:$micro_utils_version" - api "dev.inmo:micro_utils.language_codes:$micro_utils_version" + api libs.microutils.coroutines + api libs.microutils.serialization.base64 + api libs.microutils.serialization.encapsulator + api libs.microutils.serialization.typedSerializer + api libs.microutils.ktor.common + api libs.microutils.languageCodes - api "io.ktor:ktor-client-core:$ktor_version" + api libs.ktor.client.core } } commonTest { @@ -36,12 +37,12 @@ kotlin { } jvmMain { dependencies { - api "io.ktor:ktor-server:$ktor_version" - api "io.ktor:ktor-server-host-common:$ktor_version" + api libs.ktor.server + api libs.ktor.server.host.common - api "io.ktor:ktor-client-cio:$ktor_version" + api libs.ktor.client.cio - api "javax.activation:activation:$javax_activation_version" + api libs.javax.activation } } } diff --git a/tgbotapi.utils/build.gradle b/tgbotapi.utils/build.gradle index a860a8e6e2..77798bade7 100644 --- a/tgbotapi.utils/build.gradle +++ b/tgbotapi.utils/build.gradle @@ -6,6 +6,7 @@ plugins { project.description = "Additional extensions for core part of tgbotapi" apply from: "$mppProjectWithSerializationPresetPath" +apply from: "$publishGradlePath" kotlin { sourceSets { diff --git a/tgbotapi.webapps/build.gradle b/tgbotapi.webapps/build.gradle index ca80bfe22b..120eccfb22 100644 --- a/tgbotapi.webapps/build.gradle +++ b/tgbotapi.webapps/build.gradle @@ -6,6 +6,7 @@ plugins { project.description = "Web App bindings for the Telegram Web Apps API" apply from: "$mppProjectWithSerializationPresetPath" +apply from: "$publishGradlePath" kotlin { sourceSets { diff --git a/tgbotapi/build.gradle b/tgbotapi/build.gradle index f5ee245a85..3316917cf3 100644 --- a/tgbotapi/build.gradle +++ b/tgbotapi/build.gradle @@ -1,48 +1,17 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - } -} - plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" } -project.version = "$library_version" -project.group = "$library_group" project.description = "Full collection of all built-in tgbotapi tools" -apply from: "../publish.gradle" - -repositories { - mavenLocal() - mavenCentral() -} +apply from: "$mppProjectWithSerializationPresetPath" +apply from: "$publishGradlePath" kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { commonMain { dependencies { - implementation kotlin('stdlib') api project(":tgbotapi.core") api project(":tgbotapi.api") api project(":tgbotapi.utils") @@ -52,9 +21,3 @@ kotlin { } } } - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - From 57cdc4ff2a7161f6d4985ff0e909e59acaf1838a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 29 Jun 2022 14:27:29 +0600 Subject: [PATCH 4/4] fill changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a97db4abb..d3adb3df99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## 2.1.2 +* `Versions`: + * `Coroutines`: `1.6.1` -> `1.6.3` + * `Ktor`: `2.0.2` -> `2.0.3` + * `MicroUtils`: `0.11.6` -> `0.11.9` + ## 2.1.1 * `API`: