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

Kotlin DSL plugins block in precompiled script plugins should prevent declaring a plugin version #9240

Open
eskatos opened this issue Apr 25, 2019 · 0 comments

Comments

@eskatos
Copy link
Member

eskatos commented Apr 25, 2019

When using precompiled script plugins, the dependencies to plugins must be declared as regular dependencies in the build building the precompiled script plugins. Precompiled script plugins cannot declare plugin versions in their plugins block.

But in practice, one can declare a version and it is simply ignored, this is confusing.

// buildSrc/src/main/kotlin/my-script-plugin.gradle.kts
plugins {
    id("some") version "1.0"
}

Expected Behavior

At best, the script plugin above can't be compiled and the author can see the compilation error directly in the IDE. At least, the script plugin above fails at runtime with an actionable help message.

Current Behavior

The script plugin above can be compiled successfully and nothing helps the author to know that the version won't be used and that they must declare the dependency in buildSrc/build.gradle.kts. At runtime, that plugin will then fail with Plugin with id 'some' not found.

Context

See gradle/kotlin-dsl-samples#1376

@eskatos eskatos transferred this issue from gradle/kotlin-dsl-samples Apr 25, 2019
@bamboo bamboo self-assigned this Apr 25, 2019
@bmuskalla bmuskalla added this to the Unscheduled milestone Jun 4, 2020
@bamboo bamboo removed their assignment Nov 13, 2020
@jjohannes jjohannes removed this from the Unscheduled milestone Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants