summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/ProguardRules.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-11-16 17:35:44 -0800
committerAdam Lesinski <adamlesinski@google.com>2015-11-19 14:46:53 -0800
commit467f171315f9c2037fcd3eb5edcfabc40671bf7b (patch)
tree3b14762e3d9e42a660479d0d5722883b391f835b /tools/aapt2/java/ProguardRules.cpp
parentabf83cbe4f63cd76043aab89cd0e08525560fea2 (diff)
AAPT2: Fail compiling when private symbols are referenced
Also moved some XML specific stuff into its own directory, and refactored ReferenceLinker a bit. Change-Id: I912247a82023c1bbf72dc191fbdaf62858cbec0c
Diffstat (limited to 'tools/aapt2/java/ProguardRules.cpp')
-rw-r--r--tools/aapt2/java/ProguardRules.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/aapt2/java/ProguardRules.cpp b/tools/aapt2/java/ProguardRules.cpp
index 44314772fbd4..c0968545ad81 100644
--- a/tools/aapt2/java/ProguardRules.cpp
+++ b/tools/aapt2/java/ProguardRules.cpp
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-#include "XmlDom.h"
-
#include "java/ProguardRules.h"
#include "util/Util.h"
+#include "xml/XmlDom.h"
#include <memory>
#include <string>
@@ -40,11 +39,11 @@ public:
virtual void visit(xml::Element* node) override {
if (!node->namespaceUri.empty()) {
- Maybe<std::u16string> maybePackage = util::extractPackageFromNamespace(
+ Maybe<xml::ExtractedPackage> maybePackage = xml::extractPackageFromNamespace(
node->namespaceUri);
if (maybePackage) {
// This is a custom view, let's figure out the class name from this.
- std::u16string package = maybePackage.value() + u"." + node->name;
+ std::u16string package = maybePackage.value().package + u"." + node->name;
if (util::isJavaClassName(package)) {
addClass(node->lineNumber, package);
}
@@ -185,7 +184,8 @@ struct ManifestVisitor : public BaseVisitor {
std::u16string mPackage;
};
-bool collectProguardRulesForManifest(const Source& source, XmlResource* res, KeepSet* keepSet) {
+bool collectProguardRulesForManifest(const Source& source, xml::XmlResource* res,
+ KeepSet* keepSet) {
ManifestVisitor visitor(source, keepSet);
if (res->root) {
res->root->accept(&visitor);
@@ -194,7 +194,7 @@ bool collectProguardRulesForManifest(const Source& source, XmlResource* res, Kee
return false;
}
-bool collectProguardRules(const Source& source, XmlResource* res, KeepSet* keepSet) {
+bool collectProguardRules(const Source& source, xml::XmlResource* res, KeepSet* keepSet) {
if (!res->root) {
return false;
}