summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser.cpp
diff options
context:
space:
mode:
author Izabela Orlowska <imorlowska@google.com> 2019-01-17 12:09:59 +0000
committer Izabela Orlowska <imorlowska@google.com> 2019-01-17 12:12:25 +0000
commita3ab21f04ac976ced7933af04e8f8cb593571a03 (patch)
tree1830e2539e6e7cb7b0ef8c3b7428ec3714403f2e /tools/aapt2/ResourceParser.cpp
parent352ed665f5820e0088739c681289269794cce7d1 (diff)
AAPT2: always say which file failed to compile
Sometimes AAPT2 doesn't include the path of the file in the error message, or just outputs a warning where an error should be printed (but the overall build still fails without an error message). Let's always include the file path to make it easier for the users to find out the source of the failure. Fixes: 122856772 Test: manual Change-Id: Ibbbfd21b372792e5eaa40278186eb64cdfb0f60e
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r--tools/aapt2/ResourceParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index 58702dc465cc..133cc849a4e8 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -714,7 +714,8 @@ bool ResourceParser::ParseResource(xml::XmlPullParser* parser,
}
}
- diag_->Warn(DiagMessage(out_resource->source)
+ // If the resource type was not recognized, write the error and return false.
+ diag_->Error(DiagMessage(out_resource->source)
<< "unknown resource type '" << parser->element_name() << "'");
return false;
}