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);
}
}
});
}
Aggregations