-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Provide a way to use kotlin-dsl in precompiled script plugins #17016
Comments
Currently I use the following workaround to fetch val kotlinDslVersion = PluginDependenciesSpec { id ->
object : PluginDependencySpec {
var version: String? = null
override fun version(version: String?) = apply { this.version = version }
override fun apply(apply: Boolean) = this
override fun toString() = version ?: ""
}
}.`kotlin-dsl`.toString() |
This is definitely an issue. It should be addressed as part of #15219. |
this also happened for me in 6.8.3 |
This does not seem to have been tackled yet. @jjohannes , do you have any update here? |
@kikoso sorry I am no longer in the Gradle team and I don't know what the timeline for this is. I still think this should be addressed as it is a quite common issue that affects builds using a "modern" structuring approach for build logic. |
Thanks for the heads up @jjohannes ! |
I recently tried again, and I found import org.gradle.kotlin.dsl.support.expectedKotlinDslPluginsVersion
dependencies {
implementation("org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:$expectedKotlinDslPluginsVersion")
} It would still be nice to have something like dependencies {
implementation(kotlinDsl())
} |
Expected Behavior
There should be a way to use
kotlin-dsl
for precompiled script plugins inidiomatic-gradle
approach.Current Behavior
I try using precompiled script plugins to factor the build logic.
In the build itself, I need kotlin-dsl plugin (so I do not apply kotlin-dsl everywhere, and I want an uber-plugin to apply it along with other plugins)
Of course, precompiled script plugins forbid versions, so I have the following for Gradle 6.8.3:
Unfortunately, it breaks for Gradle 7 as follows:
Note: if I completely remove the version of
org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin
dependency, then Gradle can't find the version. If I leave an old version, Gradle complains that it wants a specific one.Context
I cannot use a project that uses Gradle 6.8 (e.g. Gradle plugin project) as an includedBuild in project that uses Gradle 7 since Gradle 7 wants every version to be "new and shiny", so it requests "removing any explicit
kotlin-dsl
version constraints", however it is not clear how it should be done.The text was updated successfully, but these errors were encountered: