Open liutikas opened 1 year ago
Hi @liutikas. What would it take to make the plugin configuration-cache compatible?
Partial fix here https://github.com/GoogleCloudPlatform/app-gradle-plugin/pull/455
@diegomarquezp I'm keen to move this forward, we need maintainer involvement to help make decisions.
GoogleCloudPlatform/app-gradle-plugin#455 takes use ⅔ the way there. It fixes
- Task `:appengineStage` of type `StageAppYamlTask`: invocation of 'Task.project' at execution time is unsupported.
- Task `:downloadCloudSdk` of type `DownloadCloudSdkTask`: invocation of 'Task.project' at execution time is unsupported.
There is 1 bigger problem, which is the following from many sources:
cannot deserialize object of type 'Project' as these are not supported with the configuration cache.
Each Extension is referenced from Tasks, which means that those Extensions cannot have Project
typed fields. I changed all those Project
fields to FileOperations
, similar to #455, and I was able to do a GAE deployment while reusing configuration cache. 🎉
⚠ One thing I don't know how to make work with this is
projectAsService
. Sincethis.project
is essentially removed, there's no way to make the code execute.
To finalize the work we need to discuss what to do with the internal API usage:
See https://github.com/GoogleCloudPlatform/app-gradle-plugin/pull/455/files#r1148827989 for more.
To make the extension migration production ready, we'll have to add one reflective call to support < Gradle 5.3, because at that point they removed a method that we would use. (There's a replacement on the same interface with a different name from Gradle 4.10.)
I also found more usages of Task.getProject()
: https://github.com/TWiStErRob/gcp-gradle-plugin/commit/7dc366e565e13ce8b86efbea2907546dbec86e39
btw, the branch is https://github.com/TWiStErRob/gcp-gradle-plugin/commits/cc if you want to see all the commits at once.
In case someone is looking for a workaround:
org.gradle.configuration-cache=true
org.gradle.configuration-cache-problems=fail
+
or
=
3 problems were found storing the configuration cache
but no build failure.
This means we can use CC for running test and other checks, but CC is skipped for when these tasks are configured, which could slow down local development for example (DevAppServer*Task
).
Can we get some reply? @diegomarquezp cc @suztomo
Make app-gradle-plugin configuration cache compatible. Configuration cache is about to ship stable. Enabling it currently causes GCP gradle plugin to fail in multiple ways