Android Maven package bulk replacement of resource files (overlay for skin) & amp; AAR package dependency module overwrite Policy
1. AAR package and overwrite
The primary module (APK) overwrites resources of the same name in AAR:
The policy is as follows:
Resource file examples. layout overwrites resources. The values file, such as strings. xml, is merged.
Modules with dependencies can only be packaged using aar, such as the ui Library and other libraries. We recommend that you add the resources shared by all modules to the common module and create a naming mechanism to prevent duplication.
In the future, if there are business-independent modules that can be bundled into bundle, bundle can be seen as an independent apk with independent resource files
2. maven supports specifying the res directory during compilation (similar to Android overlay ). The details are as follows:
Android-maven-plugin
+
+
Res-overlay
+
Add the resourceOverlaytDirectioies node to the configuration node of android maven-plugin and set the overlay directory.
During packaging, res-overlay replaces resource files with the same name under res.
It can be used to change the skin and replace resource files of different versions.