Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/@unreleased/pr-1568.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: fix
fix:
description: JavaCompile tasks should now get more build cache hits irrespective
of the location of your repo on disk, as `baseline-errorprone` no longer injects
an absolute path into `errorproneOptions.excludedPaths`.
links:
- https://github.com/palantir/gradle-baseline/pull/1568
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.palantir.baseline.extensions.BaselineErrorProneExtension;
import com.palantir.baseline.tasks.CompileRefasterTask;
import java.io.File;
import java.nio.file.Paths;
import java.util.AbstractList;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -202,13 +201,13 @@ private static void configureErrorProneOptions(
}

errorProneOptions.getDisableWarningsInGeneratedCode().set(true);
String projectPath = project.getProjectDir().getPath();
String separator = Pattern.quote(Paths.get(projectPath).getFileSystem().getSeparator());
// don't want backslashes on windows to break our regex
String separator = File.separatorChar == '\\' ? Pattern.quote("\\") : File.separator;
errorProneOptions
.getExcludedPaths()
.set(String.format(
"%s%s(build|src%sgenerated.*)%s.*",
Pattern.quote(projectPath), separator, separator, separator));
".*(build%sgenerated%ssources|src%sgenerated.*)%s.*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to handle cases that previously were excluded such as build/metricSchema/generated_src used by metric-schema which is causing the baseline bump excavator on tritium to fail compilation: https://app.circleci.com/pipelines/github/palantir/tritium/906/workflows/7c65b97b-b475-46fc-a1e1-b5a4bf7198a0/jobs/11565

Filed #1570

separator, separator, separator, separator));

// FallThrough does not currently work with switch expressions
// See https://github.com/google/error-prone/issues/1649
Expand Down