Index: build/config/android/internal_rules.gni |
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni |
index 2a7a8921ed37fbd994a208877a58ec7ab52a0bca..07a05e15d6406f3853c6c1a87b3833e2c59f149b 100644 |
--- a/build/config/android/internal_rules.gni |
+++ b/build/config/android/internal_rules.gni |
@@ -1177,3 +1177,53 @@ template("deps_dex") { |
} |
} |
} |
+ |
+# Creates an AndroidManifest.xml for an APK split. |
+template("generate_split_manifest") { |
+ assert(defined(invoker.main_manifest)) |
+ assert(defined(invoker.out_manifest)) |
+ assert(defined(invoker.split_name)) |
+ |
+ action(target_name) { |
+ depfile = "$target_gen_dir/$target_name.d" |
+ args = [ |
+ "--main-manifest", |
+ rebase_path(invoker.main_manifest, root_build_dir), |
+ "--out-manifest", |
+ rebase_path(invoker.out_manifest, root_build_dir), |
+ "--split", |
+ invoker.split_name, |
+ ] |
+ if (defined(invoker.version_code)) { |
+ args += [ |
+ "--version-code", |
+ invoker.version_code, |
+ ] |
+ } |
+ if (defined(invoker.version_name)) { |
+ args += [ |
+ "--version-name", |
+ invoker.version_name, |
+ ] |
+ } |
+ if (defined(invoker.has_code)) { |
+ args += [ |
+ "--has-code", |
+ invoker.has_code, |
+ ] |
+ } |
+ args += [ |
+ "--depfile", |
+ rebase_path(depfile, root_build_dir), |
+ ] |
+ |
+ script = "//build/android/gyp/generate_split_manifest.py" |
+ outputs = [ |
+ depfile, |
+ invoker.out_manifest, |
+ ] |
+ inputs = [ |
+ invoker.main_manifest, |
+ ] |
+ } |
+} |