-
Notifications
You must be signed in to change notification settings - Fork 39
Applying plugin to Gradle KTS project fails #378
Comments
Adding to this, if I use the "old school" plugin syntax: buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath("com.google.cloud.tools:appengine-gradle-plugin:2.2.0")
}
}
apply(plugin = "com.google.cloud.tools.appengine") Then Gradle complains that it doesn't know what to do with the
Edit: this is solved by using |
does apply the plugin of choice directly work?
as described here: https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/master/USER_GUIDE.md#applying-the-plugin |
So there are some known issues with the new syntax, given plugin resolution order (we need to delay applying the task dependencies I think). However it has been low priority for us and I haven't really worked on it a while. Perhaps the team can put some cycles on it, or we could use external contributor help. This plugin could probably use some other updates as it is currently built against gradle 4.9. |
I finally got it to work in the "old way" as you said, collecting bits and pieces from various answers on issues, but maybe it looks like you should be using the configuration avoidance friendly, TaskProvider-based APIs to retrieve the |
Agree, there's some work to be done here to bring things up to date. |
For anyone else having issues with the plugin with the Kotlin DSL, and stumbling on this issue, here's the current workaround: plugins {
kotlin("jvm")
application
war
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("com.google.cloud.tools:appengine-gradle-plugin:2.2.0")
}
}
// Note: the AppEngine plugin currently does not work when applied using the
// plugins DSL, so we need to use the old-school way
apply(plugin = "com.google.cloud.tools.appengine")
configure<AppEngineStandardExtension> {
deploy {
projectId = "[TODO]"
version = "[TODO]"
}
}
tasks {
val run by registering {
dependsOn(named("appengineRun"))
}
} |
I am creating a project using Gradle 6.5 and the Kotlin DSL. When I add the appengine plugin to my
:api-server
module I get this error:It looks like the plugin is trying to access the
assemble
task before it's created. My plugins block looks like this:Changing the plugins order doesn't change the result.
PS: I am using a
resolutionStrategy
in mysettings.gradle.kts
to be able to reference the plugin — not that it has anything to do with the issue at hand:The text was updated successfully, but these errors were encountered: