How can I use version catalogs with Kotlin DSL?

48 views Asked by At

I am doing a multimodule project in which I am using version catalog and Kotlin DSL, the problem is that I can't get the buildSrc module files to recognize the toml file, is it possible?

plugins {
    `kotlin-dsl`
}

repositories {
    google()
    mavenCentral()
}

dependencies {
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
    implementation("com.android.tools.build:gradle:8.2.2")
}

gradlePlugin {
    plugins {
        register("base-configuration-plugin") {
            id = "base-configuration-plugin"
            implementationClass = "BaseConfigurationPlugin"
        }

        register("main-gradle-plugin") {
            id = "main-gradle-plugin"
            implementationClass = "MainGradlePlugin"
        }
    }
}

I would like that instead of using the written dependency I could use it from the catalogs version file.

0

There are 0 answers