org.gradle.caching.configuration.BuildCacheConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-api Show documentation
Show all versions of gradle-api Show documentation
Gradle 6.9.1 API redistribution.
/*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.caching.configuration;
import org.gradle.api.Action;
import org.gradle.caching.BuildCacheServiceFactory;
import org.gradle.caching.local.DirectoryBuildCache;
import org.gradle.internal.HasInternalProtocol;
import javax.annotation.Nullable;
/**
* Configuration for the build cache for an entire Gradle build.
*
* @since 3.5
*/
@HasInternalProtocol
@SuppressWarnings("deprecation")
public interface BuildCacheConfiguration extends CompatibilitySupportForBuildCacheConfiguration {
/**
* Registers a custom build cache type.
*
* @param configurationType Configuration type used to provide parameters to a {@link org.gradle.caching.BuildCacheService}
* @param buildCacheServiceFactoryType Implementation type of {@link BuildCacheServiceFactory} that is used to create a {@code BuildCacheService}
*/
void registerBuildCacheService(Class configurationType, Class extends BuildCacheServiceFactory super T>> buildCacheServiceFactoryType);
/**
* Returns the local directory cache configuration.
*/
DirectoryBuildCache getLocal();
/**
* Configures the local cache with the given type.
*
* Note: using any type except {@link org.gradle.caching.local.DirectoryBuildCache} is invalid.
*
* @param type the type of local cache to configure.
*
* @deprecated Use {@link #getLocal()} instead.
*/
@Deprecated
T local(Class type);
/**
* Configures the local cache with the given type.
*
* Note: using any type except {@link org.gradle.caching.local.DirectoryBuildCache} is invalid.
*
* @param type the type of local cache to configure.
* @param configuration the configuration to execute against the remote cache.
*
* @deprecated Use {@link #local(Action)} instead.
*/
@Deprecated
T local(Class type, Action super T> configuration);
/**
* Executes the given action against the local configuration.
*
* @param configuration the action to execute against the local cache configuration.
*/
void local(Action super DirectoryBuildCache> configuration);
/**
* Returns the remote cache configuration.
*/
@Nullable
BuildCache getRemote();
/**
* 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.
*
* @param type the type of remote cache to configure.
*
*/
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.
*
*
* 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.
*
* @param type the type of remote cache to configure.
* @param configuration the configuration to execute against the remote cache.
*
*/
T remote(Class type, Action super T> configuration);
/**
* Executes the given action against the currently configured remote cache.
*
* @param configuration the action to execute against the currently configured remote cache.
*
* @throws IllegalStateException If no remote cache has been assigned yet
*/
void remote(Action super BuildCache> configuration);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy