vojtechhabarta / typescript-generator

Generates TypeScript from Java - JSON declarations, REST service client
MIT License
1.15k stars 237 forks source link

Add support for Gradle configuration cache #828

Open sergeykad opened 2 years ago

sergeykad commented 2 years ago

Running build with Gradle configuration cache enabled ( --configuration-cache) results in the following messages:

* What went wrong:
Configuration cache problems found in this build.

7 problems were found storing the configuration cache, 3 of which seem unique.
- Task `:module2:generateTypeScript` of type `cz.habarta.typescript.generator.gradle.GenerateTask`: cannot serialize object of type 'org.gradle.api.tasks.compile.JavaCompile', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:module1:generateTypeScript` of type `cz.habarta.typescript.generator.gradle.GenerateTask`: cannot serialize object of type 'org.gradle.api.tasks.compile.JavaCompile', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:module1:generateTypeScript` of type `cz.habarta.typescript.generator.gradle.GenerateTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

Gradle 7.4.2 typescript-generator-gradle-plugin:2.36.1070

mkm-dt commented 2 years ago

This would help us a lot, is there a plan to support this? Moving initialization code from the gradle task to the gradle plugin (as is recommended practice, anyway) would already bring us most of the way there.

sergeykad commented 1 year ago

In the v3.2.1263 of the plugin, one of the issues was resolved. This is the updated report.