Interface BuildCacheConfiguration
-
@Incubating public interface BuildCacheConfiguration
Configuration for the build cache for an entire Gradle build.- Since:
- 3.5
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BuildCache
getLocal()
Returns the local cache configuration.BuildCache
getRemote()
Returns the remote cache configuration.<T extends BuildCache>
Tlocal(Class<T> type)
Configures the local cache with the given type.<T extends BuildCache>
Tlocal(Class<T> type, Action<? super T> configuration)
Configures the local cache with the given type.void
local(Action<? super BuildCache> configuration)
Executes the given action against the local configuration.<T extends BuildCache>
voidregisterBuildCacheService(Class<T> configurationType, Class<? extends BuildCacheServiceFactory<? super T>> buildCacheServiceFactoryType)
Registers a custom build cache type.<T extends BuildCache>
Tremote(Class<T> type)
Configures a remote cache with the given type.<T extends BuildCache>
Tremote(Class<T> type, Action<? super T> configuration)
Configures a remote cache with the given type.void
remote(Action<? super BuildCache> configuration)
Executes the given action against the currently configured remote cache.
-
-
-
Method Detail
-
registerBuildCacheService
<T extends BuildCache> void registerBuildCacheService(Class<T> configurationType, Class<? extends BuildCacheServiceFactory<? super T>> buildCacheServiceFactoryType)
Registers a custom build cache type.- Parameters:
configurationType
- Configuration type used to provide parameters to aBuildCacheService
buildCacheServiceFactoryType
- Implementation type ofBuildCacheServiceFactory
that is used to create aBuildCacheService
-
getLocal
BuildCache getLocal()
Returns the local cache configuration.
-
local
<T extends BuildCache> T local(Class<T> type)
Configures the local cache with the given type.If a local build cache has already been configured with a different type, this method replaces it.
Push is enabled by default for the local cache.
- Parameters:
type
- the type of local cache to configure.
-
local
<T extends BuildCache> T local(Class<T> type, Action<? super T> configuration)
Configures the local cache with the given type.If a local build cache has already been configured with a different type, this method replaces it.
If a local build cache has already been configured with the same type, this method configures it.
Push is enabled by default for the local cache.
- Parameters:
type
- the type of local cache to configure.configuration
- the configuration to execute against the remote cache.
-
local
void local(Action<? super BuildCache> configuration)
Executes the given action against the local configuration.- Parameters:
configuration
- the action to execute against the local cache configuration.
-
getRemote
BuildCache getRemote()
Returns the remote cache configuration.
-
remote
<T extends BuildCache> T remote(Class<T> type)
Configures a remote cache with the given type.If a remote build cache has already been configured with a different type, this method replaces it.
Push is disabled by default for the remote cache.
- Parameters:
type
- the type of remote cache to configure.
-
remote
<T extends BuildCache> T remote(Class<T> type, Action<? super T> configuration)
Configures a remote cache with the given type.If a remote build cache has already been configured with a different type, this method replaces it.
If a remote build cache has already been configured with the same, this method configures it.
Push is disabled by default for the remote cache.
- Parameters:
type
- the type of remote cache to configure.configuration
- the configuration to execute against the remote cache.
-
remote
void remote(Action<? super BuildCache> configuration)
Executes the given action against the currently configured remote cache.- Parameters:
configuration
- the action to execute against the currently configured remote cache.- Throws:
IllegalStateException
- If no remote cache has been assigned yet
-
-