Include annotation processor names in JavaCompileAction progress messages
@@ -765,9 +765,28 @@ public final class JavaCompileAction extends SpawnAction {
first = appendCount(sb, first, sourceFiles.size(), "source file");
first = appendCount(sb, first, sourceJars.size(), "source jar");
sb.append(")");
+ addProcessorNames(sb);
return sb.toString();
}
+ private void addProcessorNames(StringBuilder sb) {
+ if (processorNames.isEmpty()) {
+ return;
+ }
+ List<String> shortNames = new ArrayList<>();
+ for (String name : processorNames) {
+ // Annotation processor names are qualified class names. Omit the package part for the
+ // progress message, e.g. `com.google.Foo` -> `Foo`.
+ int idx = name.lastIndexOf('.');
+ String shortName = idx != -1 ? name.substring(idx + 1) : name;
+ shortNames.add(shortName);
+ }
+ sb.append(" and running annotation processors (");
+ Joiner.on(", ").appendTo(sb, shortNames);
+ sb.append(")");
+ return;
+ }
+
/**
* Append an input count to the progress message, e.g. "2 source jars". If an input count has
* already been appended, prefix with ", ".
