gradle / gradle

Adaptable, fast automation for all
https://gradle.org
Apache License 2.0
16.68k stars 4.67k forks source link

Document Kotlin DSL generated FQ plugin accessors support #24684

Open EdricChan03 opened 1 year ago

EdricChan03 commented 1 year ago

Expected Behavior

Plugin accessors using a FQN syntax should be documented in the Kotlin DSL docs:

(example from Kord's precompiled script:)

plugins {
    org.jetbrains.kotlin.jvm // Ordinarily it would be id("org.jetbrains.kotlin.jvm"), or kotlin("jvm")
    org.jetbrains.kotlin.plugin.serialization
    org.jetbrains.dokka
    `kotlinx-atomicfu`
    org.jetbrains.kotlinx.`binary-compatibility-validator`
    com.google.devtools.ksp
    `maven-publish`
}

Current Behavior

Support for using such generated plugin accessors doesn't seem to be documented anywhere in the Kotlin DSL or the using plugins docs.

Context

I was not aware that this was a feature until recently when poking around in an existing repository's (Kord - Discord APIs for Kotlin) precompiled scripts to see how their Gradle modules are configured.

jbartok commented 1 year ago

Thank you for your interest in Gradle!

This is a valid documentation issue that we will address.

hfhbd commented 1 year ago

Please also add the current limitations of the new plugins block parser, which only supports a subset of the Kotlin DSL, mostly id(""). Using the generated FQ plugin accessors results in using the Kotlin compiler to compile the plugins block, which is slower than the custom parser.