This message was deleted.
# kotlin-dsl
s
This message was deleted.
c
Yes
m
Gradle disagrees:
Copy code
Could not find method gradleKotlinDsl() for arguments [] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Worth noting is I don't have the
kotlin-dsl
plugin applied
c
that extension is tied to the kotlin-dsl plugin.
m
I'd be ok with that but then how do I add the
kotlin-dsl
plugin from a
build.gradle
file?
PluginDependenciesSpec.
kotlin-dsl
is itself a Kotlin extension ♻️
c
m
Applying this requires a version
c
give it a try without the version
m
That fails
Gradle has access to
kotlinDslPluginsVersion
:
Copy code
val PluginDependenciesSpec.`kotlin-dsl`: PluginDependencySpec
    get() = id("org.gradle.kotlin.kotlin-dsl") version "$kotlinDslPluginsVersion"
c
possible to convert that build.gradle to build.gradle.kts?
m
That's what I wanted to avoid, it's a contribution to another project and I'm not sure they'd welcome the change
I'll ask
c
hopefully they’d welcome the build script being in Kotlin as the project is building a Gradle Kotlin DSL plugin 😉
m
🤞
I think they're mostly using
kotlin-dsl
for some helper functions
c
that’s sketchy. kotlin-dsl is a convention plugin, stating that the build is a Gradle plugin.
Copy code
override fun apply(project: Project): Unit = project.run {

        warnOnUnexpectedKotlinDslPluginVersion()

        apply<JavaGradlePluginPlugin>()
        apply<KotlinDslBasePlugin>()
        apply<PrecompiledScriptPlugins>()
    }
m
I agree 100% but wanted the minimal change to start with.
👍 1