Skip to content

Commit

Permalink
Stop mergeDiagnosticJson having @CacheableTransform; speed up build (#…
Browse files Browse the repository at this point in the history
…1693)

Do not use the remote build cache for `mergeDiagnosticJson`; it takes far longer than just doing the operation locally. Avoids spamming output with "Requesting from remote build cache" too.
  • Loading branch information
CRogers authored Sep 12, 2024
1 parent eea1e0e commit 6bf6358
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions changelog/@unreleased/pr-1693.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: fix
fix:
description: Do not use the remote build cache for `mergeDiagnosticJson`; it takes
far longer than just doing the operation locally. Avoids spamming output with
"Requesting from remote build cache" too.
links:
- https://github.com/palantir/sls-packaging/pull/1693
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@
import java.nio.file.Files;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.gradle.api.artifacts.transform.CacheableTransform;
import org.gradle.api.artifacts.transform.InputArtifact;
import org.gradle.api.artifacts.transform.TransformAction;
import org.gradle.api.artifacts.transform.TransformOutputs;
import org.gradle.api.file.FileSystemLocation;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.work.DisableCachingByDefault;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@CacheableTransform
@DisableCachingByDefault(
because = "Extracting a single file from a zip is much faster than making network requests to the build cache")
public abstract class ExtractFileFromJar implements TransformAction<FileExtractParameter> {
private static final Logger log = LoggerFactory.getLogger(ExtractFileFromJar.class);

Expand Down

0 comments on commit 6bf6358

Please sign in to comment.