Package org.gradle.caching
Schnittstelle BuildCacheService
- Alle Superschnittstellen:
AutoCloseable,Closeable
- Alle bekannten Implementierungsklassen:
MapBasedBuildCacheService
Protocol interface to be implemented by a client to a build cache backend.
Build cache implementations should report a non-fatal failure as a BuildCacheException.
Non-fatal failures could include failing to retrieve a cache entry or unsuccessfully completing an upload a new cache entry.
Gradle will not fail the build when catching a BuildCacheException, but it may disable caching for the build if too
many failures occur.
All other failures will be considered fatal and cause the Gradle build to fail. Fatal failures could include failing to read or write cache entries due to file permissions, authentication or corruption errors.
Every build cache implementation should define a org.gradle.caching.configuration.BuildCache configuration and BuildCacheServiceFactory factory.
- Seit:
- 3.5
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclose()Clean up any resources held by the cache once it's not used anymore.booleanload(BuildCacheKey key, BuildCacheEntryReader reader) Load the cached entry corresponding to the given cache key.voidstore(BuildCacheKey key, BuildCacheEntryWriter writer) Store the cache entry with the given cache key.
-
Methodendetails
-
load
Load the cached entry corresponding to the given cache key. Thereaderwill be called if an entry is found in the cache.- Parameter:
key- the cache key.reader- the reader to read the data corresponding to the cache key.- Gibt zurück:
trueif an entry was found,falseotherwise.- Löst aus:
BuildCacheException- if the cache fails to load a cache entry for the given key
-
store
Store the cache entry with the given cache key. Thewriterwill be called to actually write the data.- Parameter:
key- the cache key.writer- the writer to write the data corresponding to the cache key.- Löst aus:
BuildCacheException- if the cache fails to store a cache entry for the given key
-
close
Clean up any resources held by the cache once it's not used anymore.- Angegeben von:
closein SchnittstelleAutoCloseable- Angegeben von:
closein SchnittstelleCloseable- Löst aus:
IOException- if the cache fails to close cleanly.
-