Skip to content

Commit

Permalink
Record min classpath length, as reported by strict deps
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 224608903
  • Loading branch information
cushon authored and Copybara-Service committed Dec 8, 2018
1 parent fcc839c commit 5b337cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ BlazeJavacResult compileSources(JavaLibraryBuildRequest build, JavacRunner javac
.toBuilder()
.transitiveClasspathLength(build.getClassPath().size())
.reducedClasspathLength(compressedClasspath.size())
.minClasspathLength(build.getDependencyModule().getUsedClasspath().size())
.transitiveClasspathFallback(fallback);
build.getProcessors().stream()
.map(p -> p.substring(p.lastIndexOf('.') + 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ public Path getOutputDepsProtoFile() {
return outputDepsProtoFile;
}

@VisibleForTesting
Set<Path> getUsedClasspath() {
/** Returns the classpath that was actually used during the compilation. */
public Set<Path> getUsedClasspath() {
return usedClasspath;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private static Builder newBuilder() {
return new AutoValue_BlazeJavacStatistics.Builder()
.transitiveClasspathLength(0)
.reducedClasspathLength(0)
.minClasspathLength(0)
.transitiveClasspathFallback(false);
}

Expand All @@ -81,6 +82,8 @@ private static Builder newBuilder() {

public abstract int reducedClasspathLength();

public abstract int minClasspathLength();

public abstract boolean transitiveClasspathFallback();

// TODO(glorioso): We really need to think out more about what data to collect/store here.
Expand Down Expand Up @@ -115,6 +118,8 @@ public abstract static class Builder {

public abstract Builder reducedClasspathLength(int length);

public abstract Builder minClasspathLength(int length);

public abstract Builder transitiveClasspathFallback(boolean fallback);

public Builder addErrorProneTiming(String key, Duration value) {
Expand Down

0 comments on commit 5b337cd

Please sign in to comment.