AAPT2: Follow symlinks when compiling
Bug: 62144459
Test: make AaptSymlinkTest
Change-Id: Idb3ab1ece17c52bb4fd174ec4c08a9e173289e55
diff --git a/tools/aapt2/cmd/Compile.cpp b/tools/aapt2/cmd/Compile.cpp
index 5adf04a..e09a3979 100644
--- a/tools/aapt2/cmd/Compile.cpp
+++ b/tools/aapt2/cmd/Compile.cpp
@@ -478,7 +478,8 @@
{
std::string content;
- if (!android::base::ReadFileToString(path_data.source.path, &content)) {
+ if (!android::base::ReadFileToString(path_data.source.path, &content,
+ true /*follow_symlinks*/)) {
context->GetDiagnostics()->Error(DiagMessage(path_data.source)
<< android::base::SystemErrorCodeToString(errno));
return false;