summaryrefslogtreecommitdiff
path: root/startop/view_compiler/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'startop/view_compiler/main.cc')
-rw-r--r--startop/view_compiler/main.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/startop/view_compiler/main.cc b/startop/view_compiler/main.cc
index 7d791c229a98..55bfdc78ec1b 100644
--- a/startop/view_compiler/main.cc
+++ b/startop/view_compiler/main.cc
@@ -18,6 +18,7 @@
#include "dex_builder.h"
#include "java_lang_builder.h"
+#include "tinyxml_layout_parser.h"
#include "util.h"
#include "tinyxml2.h"
@@ -41,7 +42,7 @@ DEFINE_string(package, "", "The package name for the generated class (required)"
class ViewCompilerXmlVisitor : public XMLVisitor {
public:
- ViewCompilerXmlVisitor(JavaLangViewBuilder* builder) : builder_(builder) {}
+ explicit ViewCompilerXmlVisitor(JavaLangViewBuilder* builder) : builder_(builder) {}
bool VisitEnter(const XMLDocument& /*doc*/) override {
builder_->Start();
@@ -100,6 +101,12 @@ int main(int argc, char** argv) {
XMLDocument xml;
xml.LoadFile(filename);
+ string message{};
+ if (!startop::CanCompileLayout(xml, &message)) {
+ LOG(ERROR) << "Layout not supported: " << message;
+ return 1;
+ }
+
std::ofstream outfile;
if (FLAGS_out != kStdoutFilename) {
outfile.open(FLAGS_out);