Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6aa6d14 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

AAPT2: Keep file enumeration consistent across platforms

Filesystem directory enumeration is platform dependent, so
sort the files lexicographically according to source path before
consuming them in the compile command.

Bug: 70680618
Test: manual
Change-Id: I6706dea2eb40cbaff8a586994dd1013976e4ced4
parent f3630cbe
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -186,6 +186,12 @@ static bool LoadInputFilesFromDir(IAaptContext* context, const CompileOptions& o
      out_path_data->push_back(std::move(path_data.value()));
    }
  }

  // File-system directory enumeration order is platform-dependent. Sort the result to remove any
  // inconsistencies between platforms.
  std::sort(
      out_path_data->begin(), out_path_data->end(),
      [](const ResourcePathData& a, const ResourcePathData& b) { return a.source < b.source; });
  return true;
}