From 9f1ae5bd17111611cfe6f1f85860cbacf8a1efda Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 3 Mar 2022 12:12:02 +0600 Subject: [PATCH] migration onto toml versions keeper --- build.gradle | 12 ++++++------ gradle.properties | 3 --- gradle/libs.versions.toml | 19 +++++++++++++++++++ settings.gradle | 2 ++ 4 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/build.gradle b/build.gradle index 3fe306d..2e4e8d3 100644 --- a/build.gradle +++ b/build.gradle @@ -4,14 +4,14 @@ 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 } } plugins { - id 'org.jetbrains.kotlin.jvm' version "$kotlin_version" - id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" + alias libs.plugins.kotlin.jvm + alias libs.plugins.kotlin.serialization id 'application' } @@ -20,9 +20,9 @@ repositories { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation libs.kotlin - implementation "dev.inmo:tgbotapi:$tgbotapi_version" + implementation libs.tgbotapi } application { diff --git a/gradle.properties b/gradle.properties index b9d1b6b..dc6e13d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,3 @@ kotlin.code.style=official org.gradle.parallel=true kotlin.js.generate.externals=true kotlin.incremental=true - -kotlin_version=1.6.10 -tgbotapi_version=0.38.5 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..bb28526 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,19 @@ +[versions] + +kotlin = "1.6.10" +tgbotapi = "0.38.6" + +[libraries] + +kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +tgbotapi = { module = "dev.inmo:tgbotapi", version.ref = "tgbotapi" } + +# Libs for classpath +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" } + +[plugins] + +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } + diff --git a/settings.gradle b/settings.gradle index d3c1e54..7af84e2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ rootProject.name = 'telegram_bot' + +enableFeaturePreview("VERSION_CATALOGS")