Skip to content

Commit

Permalink
Prevent temporary intermediate files from being picked up by Android …
Browse files Browse the repository at this point in the history
…ResourceCompiler when running with workers.

When `--persistent_android_resource_processor` is used alongside databinding, ResourceCompiler reads `databinding-processed-resources` during resource merging and that folder can contain ``*.params` file for each processed layout resource. This causes resource compiler's file name validation to fail. This CL simply ignores staging the intermediate files for resource compilation.

Additionally this CL also excludes *.tmp files which were observed when using dynamic execution.

Fixes bazelbuild#13649
  • Loading branch information
arunkumar9t2 authored and arunsampathkumar-grabtaxi committed Oct 29, 2021
1 parent ac9353f commit 8736e09
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,12 @@ public CompilingVisitor(

@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
// Ignore directories and "hidden" files that start with .
if (!Files.isDirectory(file) && !file.getFileName().toString().startsWith(".")) {
// Ignore directories and "hidden" files that start with ., ends with .tmp or .params files.
final String fileName = file.getFileName().toString();
if (!Files.isDirectory(file)
&& !fileName.startsWith(".")
&& !fileName.endsWith(".tmp")
&& !fileName.endsWith(".params")) {
pathToProcessed.add(file);
}
return super.visitFile(file, attrs);
Expand Down

0 comments on commit 8736e09

Please sign in to comment.