Lines Matching refs:el

33 static bool RequiredNameIsNotEmpty(xml::Element* el, SourcePathDiagnostics* diag) {  in RequiredNameIsNotEmpty()  argument
34 xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "name"); in RequiredNameIsNotEmpty()
36 diag->Error(DiagMessage(el->line_number) in RequiredNameIsNotEmpty()
37 << "<" << el->name << "> is missing attribute 'android:name'"); in RequiredNameIsNotEmpty()
42 diag->Error(DiagMessage(el->line_number) in RequiredNameIsNotEmpty()
43 << "attribute 'android:name' in <" << el->name << "> tag must not be empty"); in RequiredNameIsNotEmpty()
50 static bool NameIsJavaClassName(xml::Element* el, xml::Attribute* attr, in NameIsJavaClassName() argument
63 diag->Error(DiagMessage(el->line_number) in NameIsJavaClassName()
64 << "attribute 'android:name' in <" << el->name in NameIsJavaClassName()
71 static bool OptionalNameIsJavaClassName(xml::Element* el, SourcePathDiagnostics* diag) { in OptionalNameIsJavaClassName() argument
72 if (xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "name")) { in OptionalNameIsJavaClassName()
73 return NameIsJavaClassName(el, attr, diag); in OptionalNameIsJavaClassName()
78 static bool RequiredNameIsJavaClassName(xml::Element* el, SourcePathDiagnostics* diag) { in RequiredNameIsJavaClassName() argument
79 xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "name"); in RequiredNameIsJavaClassName()
81 diag->Error(DiagMessage(el->line_number) in RequiredNameIsJavaClassName()
82 << "<" << el->name << "> is missing attribute 'android:name'"); in RequiredNameIsJavaClassName()
85 return NameIsJavaClassName(el, attr, diag); in RequiredNameIsJavaClassName()
88 static bool RequiredNameIsJavaPackage(xml::Element* el, SourcePathDiagnostics* diag) { in RequiredNameIsJavaPackage() argument
89 xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "name"); in RequiredNameIsJavaPackage()
91 diag->Error(DiagMessage(el->line_number) in RequiredNameIsJavaPackage()
92 << "<" << el->name << "> is missing attribute 'android:name'"); in RequiredNameIsJavaPackage()
97 diag->Error(DiagMessage(el->line_number) << "attribute 'android:name' in <" << el->name in RequiredNameIsJavaPackage()
105 return [=](xml::Element* el, SourcePathDiagnostics* diag) -> bool { in RequiredAndroidAttribute() argument
106 if (el->FindAttribute(xml::kSchemaAndroid, attr) == nullptr) { in RequiredAndroidAttribute()
107 diag->Error(DiagMessage(el->line_number) in RequiredAndroidAttribute()
108 << "<" << el->name << "> is missing required attribute 'android:" << attr << "'"); in RequiredAndroidAttribute()
115 static bool AutoGenerateIsFeatureSplit(xml::Element* el, SourcePathDiagnostics* diag) { in AutoGenerateIsFeatureSplit() argument
119 xml::Attribute* attr = el->FindAttribute({}, kFeatureSplit); in AutoGenerateIsFeatureSplit()
126 xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, kIsFeatureSplit); in AutoGenerateIsFeatureSplit()
131 diag->Error(DiagMessage(el->line_number) in AutoGenerateIsFeatureSplit()
139 el->attributes.push_back(xml::Attribute{xml::kSchemaAndroid, kIsFeatureSplit, "true"}); in AutoGenerateIsFeatureSplit()
145 static bool VerifyManifest(xml::Element* el, SourcePathDiagnostics* diag) { in VerifyManifest() argument
146 xml::Attribute* attr = el->FindAttribute({}, "package"); in VerifyManifest()
148 diag->Error(DiagMessage(el->line_number) in VerifyManifest()
152 diag->Error(DiagMessage(el->line_number) in VerifyManifest()
156 diag->Error(DiagMessage(el->line_number) in VerifyManifest()
162 attr = el->FindAttribute({}, "split"); in VerifyManifest()
165 diag->Error(DiagMessage(el->line_number) << "attribute 'split' in <manifest> tag is not a " in VerifyManifest()
175 static bool FixCoreAppAttribute(xml::Element* el, SourcePathDiagnostics* diag) { in FixCoreAppAttribute() argument
176 if (xml::Attribute* attr = el->FindAttribute("", "coreApp")) { in FixCoreAppAttribute()
179 diag->Error(DiagMessage(el->line_number) << "attribute coreApp must be a boolean"); in FixCoreAppAttribute()
188 static bool VerifyUsesFeature(xml::Element* el, SourcePathDiagnostics* diag) { in VerifyUsesFeature() argument
190 if (xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "name")) { in VerifyUsesFeature()
192 diag->Error(DiagMessage(el->line_number) in VerifyUsesFeature()
200 if (xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "glEsVersion")) { in VerifyUsesFeature()
202 diag->Error(DiagMessage(el->line_number) in VerifyUsesFeature()
210 diag->Error(DiagMessage(el->line_number) in VerifyUsesFeature()
274 manifest_action.Action([&](xml::Element* el) -> bool { in BuildRules() argument
277 el->RemoveAttribute(xml::kSchemaAndroid, "versionName"); in BuildRules()
279 if (el->FindAttribute(xml::kSchemaAndroid, "versionName") == nullptr) { in BuildRules()
280 el->attributes.push_back( in BuildRules()
288 el->RemoveAttribute(xml::kSchemaAndroid, "versionCode"); in BuildRules()
290 if (el->FindAttribute(xml::kSchemaAndroid, "versionCode") == nullptr) { in BuildRules()
291 el->attributes.push_back( in BuildRules()
299 el->RemoveAttribute(xml::kSchemaAndroid, "versionCodeMajor"); in BuildRules()
301 if (el->FindAttribute(xml::kSchemaAndroid, "versionCodeMajor") == nullptr) { in BuildRules()
302 el->attributes.push_back( in BuildRules()
315 manifest_action["uses-sdk"].Action([&](xml::Element* el) -> bool { in BuildRules() argument
317 el->FindAttribute(xml::kSchemaAndroid, "minSdkVersion") == nullptr) { in BuildRules()
319 el->attributes.push_back( in BuildRules()
325 el->FindAttribute(xml::kSchemaAndroid, "targetSdkVersion") == nullptr) { in BuildRules()
327 el->attributes.push_back( in BuildRules()
336 manifest_action["instrumentation"].Action([&](xml::Element* el) -> bool { in BuildRules() argument
342 el->FindAttribute(xml::kSchemaAndroid, "targetPackage")) { in BuildRules()
350 manifest_action["overlay"].Action([&](xml::Element* el) -> bool { in BuildRules() argument
356 el->FindAttribute(xml::kSchemaAndroid, "targetPackage")) { in BuildRules()
407 application_action.Action([&](xml::Element* el) -> bool { in BuildRules() argument
408 xml::Attribute *attr = el->FindOrCreateAttribute(xml::kSchemaAndroid, "debuggable"); in BuildRules()
434 const StringPiece& attr_name, xml::Element* el) { in FullyQualifyClassName() argument
435 xml::Attribute* attr = el->FindAttribute(attr_ns, attr_name); in FullyQualifyClassName()