Support Gradle configuration cache
See original GitHub issueThe configuration cache is a feature that significantly improves build performance by caching the result of the configuration phase and reusing this for subsequent builds.
Implementing support for the configuration cache in this plugin would improve users experience.
See https://docs.gradle.org/nightly/userguide/configuration_cache.html
The configuration cache will be introduced in Gradle 6.6. But this can already be tested using 6.6-milestone-2.
Running the last Gradle Nightly + Kotlin 14-M2 + AGP 4.1.0-beta02 everything is working fine until we enable this plugin.
* What went wrong:
Configuration cache state could not be cached: field 'inputFileProperty' from type 'com.getkeepsafe.dexcount.DexCountTask': error writing value of type 'org.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultRegularFileVar'
> Configuration cache state could not be cached: field 'provider' from type 'org.gradle.api.internal.provider.MappingProvider': error writing value of type 'org.gradle.api.internal.provider.TransformBackedProvider'
> Configuration cache state could not be cached: field 'transformer' from type 'org.gradle.api.internal.provider.TransformBackedProvider': error writing value of type 'com.getkeepsafe.dexcount.ThreeThreeApplicator$applyToApkVariant$1$1$fileProvider$1'
> Configuration cache state could not be cached: field 'this$0' from type 'com.getkeepsafe.dexcount.ThreeThreeApplicator$applyToApkVariant$1$1$fileProvider$1': error writing value of type 'com.getkeepsafe.dexcount.ThreeThreeApplicator$applyToApkVariant$1$1'
> Configuration cache state could not be cached: field '$output' from type 'com.getkeepsafe.dexcount.ThreeThreeApplicator$applyToApkVariant$1$1': error writing value of type 'com.android.build.gradle.internal.api.ApkVariantOutputImpl'
> Configuration cache state could not be cached: field 'services' from type 'com.android.build.gradle.internal.api.ApkVariantOutputImpl': error writing value of type 'com.android.build.gradle.internal.services.BaseServicesImpl'
> Configuration cache state could not be cached: field 'projectServices' from type 'com.android.build.gradle.internal.services.BaseServicesImpl': error writing value of type 'com.android.build.gradle.internal.services.ProjectServices'
> Configuration cache state could not be cached: field 'buildServiceRegistry' from type 'com.android.build.gradle.internal.services.ProjectServices': error writing value of type 'org.gradle.api.services.internal.DefaultBuildServicesRegistry'
> Configuration cache state could not be cached: field 'isolatableFactory' from type 'org.gradle.api.services.internal.DefaultBuildServicesRegistry': error writing value of type 'org.gradle.internal.snapshot.impl.DefaultValueSnapshotter'
> Configuration cache state could not be cached: field 'isolatableValueVisitor' from type 'org.gradle.internal.snapshot.impl.DefaultValueSnapshotter': error writing value of type 'org.gradle.internal.snapshot.impl.DefaultValueSnapshotter$IsolatableVisitor'
> Configuration cache state could not be cached: field 'classLoaderHasher' from type 'org.gradle.internal.snapshot.impl.DefaultValueSnapshotter$IsolatableVisitor': error writing value of type 'org.gradle.groovy.scripts.internal.RegistryAwareClassLoaderHierarchyHasher'
> Configuration cache state could not be cached: field 'classLoaderFactory' from type 'org.gradle.groovy.scripts.internal.RegistryAwareClassLoaderHierarchyHasher': error writing value of type 'org.gradle.internal.classloader.DefaultHashingClassLoaderFactory'
> Configuration cache state could not be cached: field 'classpathHasher' from type 'org.gradle.internal.classloader.DefaultHashingClassLoaderFactory': error writing value of type 'org.gradle.api.internal.initialization.loadercache.DefaultClasspathHasher'
> Configuration cache state could not be cached: field 'fingerprinter' from type 'org.gradle.api.internal.initialization.loadercache.DefaultClasspathHasher': error writing value of type 'org.gradle.internal.fingerprint.classpath.impl.DefaultClasspathFingerprinter'
> Configuration cache state could not be cached: field 'fileCollectionSnapshotter' from type 'org.gradle.internal.fingerprint.classpath.impl.DefaultClasspathFingerprinter': error writing value of type 'org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter'
> Configuration cache state could not be cached: field 'genericFileTreeSnapshotter' from type 'org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter': error writing value of type 'org.gradle.internal.fingerprint.impl.DefaultGenericFileTreeSnapshotter'
> Configuration cache state could not be cached: field 'hasher' from type 'org.gradle.internal.fingerprint.impl.DefaultGenericFileTreeSnapshotter': error writing value of type 'org.gradle.api.internal.changedetection.state.CachingFileHasher'
> Configuration cache state could not be cached: field 'cache' from type 'org.gradle.api.internal.changedetection.state.CachingFileHasher': error writing value of type 'org.gradle.cache.internal.CrossProcessSynchronizingCache'
> Configuration cache state could not be cached: field 'cacheAccess' from type 'org.gradle.cache.internal.CrossProcessSynchronizingCache': error writing value of type 'org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess'
> Configuration cache state could not be cached: field 'fileLock' from type 'org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess': error writing value of type 'org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock'
> Configuration cache state could not be cached: field 'this$0' from type 'org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock': error writing value of type 'org.gradle.cache.internal.DefaultFileLockManager'
> Configuration cache state could not be cached: field 'fileLockContentionHandler' from type 'org.gradle.cache.internal.DefaultFileLockManager': error writing value of type 'org.gradle.cache.internal.locklistener.DefaultFileLockContentionHandler'
> Configuration cache state could not be cached: field 'addressFactory' from type 'org.gradle.cache.internal.locklistener.DefaultFileLockContentionHandler': error writing value of type 'org.gradle.internal.remote.internal.inet.InetAddressFactory'
> Configuration cache state could not be cached: field 'communicationAddresses' from type 'org.gradle.internal.remote.internal.inet.InetAddressFactory': error writing value of type 'java.util.ArrayList'
> 'ObjectOutputStream.putFields' is not supported by the Gradle configuration cache.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
Configuration cache - Gradle User Manual
The configuration cache takes care of caching the build configuration for a particular set of tasks. In other words, the configuration cache saves...
Read more >How to I enable Gradle configuration cache feature persistently?
The configuration cache takes care of caching the build configuration for a particular set of tasks. In other words, the configuration cache ......
Read more >Gradle Configuration Caching — Replacing ... - ProAndroidDev
Gradle recently rolled out a new feature called the “configuration cache” aimed at “significantly improving build performance by caching the result of the ......
Read more >Configuration caching deep dive - Medium
gradle /configuration-cache directory ). It is able to serialize all Gradle-managed types (e.g. FileCollection , Property , Provider ) and all ...
Read more >Incompatibility issue with Gradle configuration cache #7299
The configuration cache is a feature that significantly improves build performance by caching the result of the configuration phase and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s a great idea and I’m kind of shocked that in five years it never occurred to me 😅 Thanks, I’ll consider that.
So, they loose the stdout only when is running on the same machine because up-to-date checks, but don’t if they change because it’s not FROM-CACHE.
I always though that this kind of tasks that need to do some heavy work + print should be split in 2 tasks. The first, and cacheable, do the heavy work and output the report. The second and not cacheable do read the report and print, so it’s fast and doesn’t even need to have up-to-date checks.
In any case, that’s a different discussion. 👍