Interface BuildCacheConfiguration


public interface BuildCacheConfiguration
Configuration for the build cache for an entire Gradle build.
Since:
3.5
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the local directory cache configuration.
    Returns the remote cache configuration.
    void
    local(ActionDirectoryBuildCache> configuration)
    Executes the given action against the local configuration.
    BuildCache>
    void
    registerBuildCacheService(Class configurationType, ClassBuildCacheServiceFactory> buildCacheServiceFactoryType)
    Registers a custom build cache type.
    BuildCache>
    T
    remote(Class type)
    Configures a remote cache with the given type.
    BuildCache>
    T
    remote(Class type, Action configuration)
    Configures a remote cache with the given type.
    void
    remote(ActionBuildCache> configuration)
    Executes the given action against the currently configured remote cache.
  • Method Details

    • registerBuildCacheService

      BuildCache> void registerBuildCacheService(Class configurationType, ClassBuildCacheServiceFactory> buildCacheServiceFactoryType)
      Registers a custom build cache type.
      Parameters:
      configurationType - Configuration type used to provide parameters to a BuildCacheService
      buildCacheServiceFactoryType - Implementation type of BuildCacheServiceFactory that is used to create a BuildCacheService
    • getLocal

      Returns the local directory cache configuration.
    • local

      void local(ActionDirectoryBuildCache> configuration)
      Executes the given action against the local configuration.
      Parameters:
      configuration - the action to execute against the local cache configuration.
    • getRemote

      @Nullable BuildCache getRemote()
      Returns the remote cache configuration.
    • remote

      BuildCache> T remote(Class 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.

      Storing ("push") in the remote build cache is disabled by default.

      Parameters:
      type - the type of remote cache to configure.
    • remote

      BuildCache> T remote(Class type, Action 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.

      Storing ("push") in the remote build cache is disabled by default.

      Parameters:
      type - the type of remote cache to configure.
      configuration - the configuration to execute against the remote cache.
    • remote

      void remote(ActionBuildCache> 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