Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document applying the plugin when using Gradle's Kotlin DSL #1716

Open
d-noll opened this issue Oct 7, 2021 · 0 comments
Open

Document applying the plugin when using Gradle's Kotlin DSL #1716

d-noll opened this issue Oct 7, 2021 · 0 comments
Labels

Comments

@d-noll
Copy link

d-noll commented Oct 7, 2021

What is your use-case and why do you need this feature?

I was trying to use kotlinx.serialization from a Gradle build script which is not the main build script.

So far, I have verified that this is legal:

buildscript {
    dependencies {
        val kotlinVersion = "1.5.31"
        classpath(kotlin("gradle-plugin", version = kotlinVersion))
        classpath(kotlin("serialization", version = kotlinVersion))
    }
}

The documentation for applying it for Groovy in Kotlin syntax ends up as this:

apply(plugin = "gradle-plugin")
apply(plugin = "kotlinx-serialization")

But this fails the build with:

* What went wrong:
Plugin with id 'gradle-plugin' not found.

The documentation describes this as "the old way", but the new way documented doesn't work unless you're in the main build file, which I am not.

Describe the solution you'd like

  • Documentation gives a working example of how to apply the plugin for Gradle Kotlin DSL.
  • Documentation does not use the wording "the old way" unless it also describes a newer alternative which works in files which are not the main build script.
@d-noll d-noll added the feature label Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant