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 building with workers.

When `--persistent_android_resource_processor` is used alongside databinding, `ResourceCompiler` reads `databinding-processed-resources` folder during resource merging and that folder can contain `*.params` file used for the `PROCESS_DATABINDING` action. 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 remote execution.

Fixes #13649

Closes #14198.

PiperOrigin-RevId: 434883392
  • Loading branch information
arunkumar9t2 authored and copybara-github committed Mar 15, 2022
1 parent 1312a8d commit 06f1e5c
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 06f1e5c

Please sign in to comment.