MiSikora / laboratory

Feature flags for multi-module Kotlin Android projects
https://mehow.io/laboratory/
Apache License 2.0
82 stars 3 forks source link

Support Gradle configuration cache #276

Closed AlexKrupa closed 2 years ago

AlexKrupa commented 2 years ago

Configuration cache is an incubating Gradle feature that, well, caches configuration.

Running a task with configuration caching (Gradle 7.4.2) reports the following problems:

> ./gradlew --configuration-cache --configuration-cache-problems=warn :app:assembleDebug

...

> Configure project :app
2 problems were found storing the configuration cache.
- Task `:app:generateFeatureFactory` of type `io.mehow.laboratory.gradle.FeatureFactoryTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:app:generateFeatureFlags` of type `io.mehow.laboratory.gradle.FeatureFlagsTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

...

The documentation specifies requirements for configuration cache to work.

MiSikora commented 2 years ago

Yeah, I've been meaning to migrate this project to use the proper injection and so on. Definitely something I should prioritize and just do.

AlexKrupa commented 2 years ago

Amazing, thanks for the fast reaction! I couldn't have wished for a better OSS-consumer experience. 😄