A custom implementation of a dependency cache when the one from Gradle might not be directly accessible.
Modifiers | Name | Description |
---|---|---|
static interface |
DependencyCache.CacheRefresh |
|
static interface |
DependencyCache.PostDownloadProcessor |
Constructor and description |
---|
DependencyCache
(Project project, String cacheName, String cacheRelativePath, DependencyCache.CacheRefresh requiresDownload, CheckSumVerification checksumVerification, DependencyCache.PostDownloadProcessor postprocessor)
|
Type Params | Return Type | Name and description |
---|---|---|
|
File |
getFromCache(URI downloadUri, String artifactPath, String artifactFileName) Extract an artifact from cache. |
|
void |
setDownloadRoot(File downloadRootDir) Sets a root directory for the cache. |
project
- Project context. The reference is not cached, so is safe when configuration cache is active.Extract an artifact from cache. If the artifact is not available it will be downloaded. The download process is aware of Gradle offline mode and might throw an exception if Gradle is offline and the artifact is not in the cache.
downloadUri
- URI for downloading thew artifactartifactPath
- Relative path below root to be used.artifactFileName
- filename of artifact as it should be stored.Sets a root directory for the cache. If not supplied the default is to use the Gradle User Home. This method is provided for convenience and is mostly only used for testing purposes. The folder will be created at download time if it does not exist. Setting this is not concurrent-safe, so should only set set when the cache is created and not when the cache is used for downloading items.
downloadRootDir
- Any writeable directory on the filesystem.