Gradle's central declaration for plugins block?

Viewed 106

Latest Gradle version, 7.0, introduced a feature of central declaration of dependencies. You can now declare your dependencies (versions, libraries or even sets of related libraries - bundles) in a separate file and use them across whole, even multi-module, project:

# libs.versions.toml

[versions]
kotlin = "1.4.32"
tgbotapi = "0.33.3"

[libraries]
tgbotapi-core = { group = "dev.inmo", name = "tgbotapi.core", version.ref = "tgbotapi" }

[bundles]
tgbotapi = ["tgbotapi-core"]
// And then in your build.gradle.kts
dependencies {
    implementation(libs.bundles.tgbotapi)
}

However, I cannot make this feature work with the plugins block:

plugins {
    kotlin("jvm").version(libs.versions.kotlin).apply(false) // Unresolved reference: libs
}

How do i use this central declaration for plugins?

0 Answers
Related