I have Ant
project with many modules.
I'm trying to merge some modules into bigger ones and reduce their numbers.
Can I run android manifest merger
as a stand-alone application and merge manifests specified as arguments?
For example i have modules: A, B, C, D, E
I need to [A], [B] become [AB] module, and [C], [D], [E] to become [CDE]
I need this because I'm writing Python
script, which will help migrate to Gradle
. Script will scan directories, and create new project with all files, copied classes and resources. I would like it to be universal.
Ok, I would like to answer my own question.
manifest-merger
is java
library placed in ANDROID_HOME/tools/lib/manifest-merger.jar
To use jar
as stand-alone application, I cloned project from google platform tools
repository:
git clone --depth=1 https://android.googlesource.com/platform/tools/base
Manifst-Merger source code is place under base/build-system/manifest-merger
Also you can find code at grepcode.
I extracted code into maven
project, resolved all external dependencies and created project which can be cloned and use as stand-alone application:
https://github.com/Bresiu/android-manifest-merger
Usage:
git clone [email protected]:Bresiu/android-manifest-merger.git
mvn install
java -jar target/manifest-merger-jar-with-dependencies.jar --main mainAndroidManifest.xml
--log [VERBOSE, INFO, WARNING, ERROR]
--libs [path separated list of lib's manifests]
--overlays [path separated list of overlay's manifests]
--property [PACKAGE | VERSION_CODE | VERSION_NAME | MIN_SDK_VERSION | TARGET_SDK_VERSION | MAX_SDK_VERSION=value]
--placeholder [name=value]
--out [path of the output file]
I have used this library as follows:
java -jar target/manifest-merger-jar-with-dependencies.jar --main <path_to_main_manifest> --libs <path_to_libs_manifests_divided by ':'> --out <output_manifest> --log WARNING
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With