Search in sources :

Example 1 with StoreTarget

use of org.gradle.caching.internal.controller.service.StoreTarget in project gradle by gradle.

the class DefaultBuildCacheController method store.

@Override
public void store(final BuildCacheStoreCommand command) {
    boolean anyStore = local.canStore() || legacyLocal.canStore() || remote.canStore();
    if (!anyStore) {
        return;
    }
    final BuildCacheKey key = command.getKey();
    final Pack pack = new Pack(command);
    tmp.withTempFile(command.getKey(), new Action<File>() {

        @Override
        public void execute(File file) {
            pack.execute(file);
            if (legacyLocal.canStore()) {
                legacyLocal.store(key, new StoreTarget(file));
            }
            if (remote.canStore()) {
                remote.store(key, new StoreTarget(file));
            }
            if (local.canStore()) {
                local.store(key, file);
            }
        }
    });
}
Also used : StoreTarget(org.gradle.caching.internal.controller.service.StoreTarget) BuildCacheKey(org.gradle.caching.BuildCacheKey) File(java.io.File)

Aggregations

File (java.io.File)1 BuildCacheKey (org.gradle.caching.BuildCacheKey)1 StoreTarget (org.gradle.caching.internal.controller.service.StoreTarget)1