Package com.android.manifmerger
Class PostValidator
java.lang.Object
com.android.manifmerger.PostValidator
Validator that runs post merging activities and verifies that all "tools:" instructions
triggered an action by the merging tool.
This is primarily to catch situations like a user entered a tools:remove="foo" directory on one of its elements and that particular attribute was never removed during the merges possibly indicating an unforeseen change of configuration.
Most of the output from this validation should be warnings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidenforceToolsNamespaceDeclaration(XmlDocument xmlDocument) EnforcesSdkConstants.TOOLS_URIdeclaration in the top level element, if necessary.static voidvalidate(XmlDocument xmlDocument, MergingReport.Builder mergingReport) Post validation of the merged document.
-
Constructor Details
-
PostValidator
public PostValidator()
-
-
Method Details
-
validate
public static void validate(@NonNull XmlDocument xmlDocument, @NonNull MergingReport.Builder mergingReport) Post validation of the merged document. This will essentially check that all merging instructions were applied at least once.- Parameters:
xmlDocument- merged document to check.mergingReport- report for errors and warnings.
-
enforceToolsNamespaceDeclaration
EnforcesSdkConstants.TOOLS_URIdeclaration in the top level element, if necessary. It is possible that the original manifest file did not contain any attribute declaration, therefore not requiring a xmlns: declaration. Yet the implicit elements handling may have added attributes requiring the namespace declaration.
-