Read all files through IoDelegate
This allows us to easily fake out file IO in tests.
Bug: 24703046
Change-Id: I33a59c8e43489b03f27f99fb2949e58cc0311eb1
Test: unittests still pass, clean build of android passes
diff --git a/main_java.cpp b/main_java.cpp
index 9bd6768..fc2d748 100644
--- a/main_java.cpp
+++ b/main_java.cpp
@@ -18,6 +18,7 @@
#include <memory>
#include "aidl.h"
+#include "io_delegate.h"
#include "logging.h"
#include "options.h"
@@ -31,11 +32,12 @@
return 1;
}
+ android::aidl::IoDelegate io_delegate;
switch (options->task) {
case JavaOptions::COMPILE_AIDL_TO_JAVA:
- return android::aidl::compile_aidl_to_java(*options);
+ return android::aidl::compile_aidl_to_java(*options, io_delegate);
case JavaOptions::PREPROCESS_AIDL:
- return android::aidl::preprocess_aidl(*options);
+ return android::aidl::preprocess_aidl(*options, io_delegate);
}
std::cerr << "aidl: internal error" << std::endl;
return 1;