AAPT2: Fix windows unicode path issues
Mingw64 was being difficult, so instead of defining a wmain entrypoint,
the command line parameters are parsed manually using built-in Windows
methods that support Unicode. The results are converted to UTF8 and
handled just like the rest of the linux/mac version of the code.
This also removes dependencies on std::istream in favour of a
FileInputStream which calls the appropriate unicode version of
open to read a file.
No speed regressions found on Linux or MacOS.
Bug: 62336414
Bug: 63830502
Test: manual
Change-Id: I597da51e33729ed1b98bf246e7e773337fd3fee8
diff --git a/tools/aapt2/Android.bp b/tools/aapt2/Android.bp
index 14d05fd..53794e6 100644
--- a/tools/aapt2/Android.bp
+++ b/tools/aapt2/Android.bp
@@ -92,7 +92,9 @@
"flatten/XmlFlattener.cpp",
"io/BigBufferStreams.cpp",
"io/File.cpp",
+ "io/FileInputStream.cpp",
"io/FileSystem.cpp",
+ "io/StringInputStream.cpp",
"io/Util.cpp",
"io/ZipArchive.cpp",
"link/AutoVersioner.cpp",
@@ -164,6 +166,7 @@
cc_test_host {
name: "aapt2_tests",
srcs: [
+ "test/Builders.cpp",
"test/Common.cpp",
"**/*_test.cpp",
],