Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3139)

Unified Diff: build/mac/tweak_info_plist.gni

Issue 2480433002: Extend tweak_info_plist template to support multiple plist file as input. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/mac/plist_util.py ('k') | components/cronet/ios/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/mac/tweak_info_plist.gni
diff --git a/build/mac/tweak_info_plist.gni b/build/mac/tweak_info_plist.gni
index d24a95d2ef7163de0e5424670fc9aeae64dfa7ce..505f5e50ab75942e6504bb5fe377b17da51be9c9 100644
--- a/build/mac/tweak_info_plist.gni
+++ b/build/mac/tweak_info_plist.gni
@@ -7,21 +7,54 @@
# Arguments:
#
# info_plist:
-# string, the plist to tweak.
+# (optional), string, the plist to tweak.
+#
+# info_plists:
+# (optional), list of string, the plist files to merge and tweak.
#
# args:
-# list of string, the arguments to pass to the tweak_info_plist.py
-# script.
+# (optional), list of string, the arguments to pass to the
+# tweak_info_plist.py script.
#
-# Callers should use get_target_outputs() to get the output name.
+# Callers should use get_target_outputs() to get the output name. One of
+# info_plist or info_plists must be specified.
template("tweak_info_plist") {
- assert(defined(invoker.info_plist),
- "The info_plist must be specified in $target_name")
- assert(defined(invoker.args),
- "The args to tweak_info_plist.py must be specified in $target_name")
+ _output_name = "$target_gen_dir/${target_name}_tweaked.plist"
+
+ if (defined(invoker.info_plists)) {
+ assert(!defined(invoker.info_plist),
+ "Cannot have both info_plist and info_plists for $target_name")
+
+ _source_name = "$target_gen_dir/${target_name}_merged.plist"
+ _deps = [ ":" + target_name + "_merge_plist" ]
+
+ action(target_name + "_merge_plist") {
+ forward_variables_from(invoker, [ "testonly" ])
+ script = "//build/config/mac/plist_util.py"
+ sources = invoker.info_plists
+ outputs = [
+ _source_name,
+ ]
+ args = [
+ "merge",
+ "-f=xml1",
+ "-o=" + rebase_path(_source_name, root_build_dir),
+ ] + rebase_path(invoker.info_plists, root_build_dir)
+ }
+ } else {
+ assert(defined(invoker.info_plist),
+ "The info_plist must be specified in $target_name")
+
+ _source_name = invoker.info_plist
+ _deps = []
+ }
action(target_name) {
- forward_variables_from(invoker, [ "testonly" ])
+ forward_variables_from(invoker,
+ [
+ "args",
+ "testonly",
+ ])
script = "//build/mac/tweak_info_plist.py"
inputs = [
script,
@@ -30,17 +63,21 @@ template("tweak_info_plist") {
"//chrome/VERSION",
]
sources = [
- invoker.info_plist,
+ _source_name,
]
- _output_name = "$target_gen_dir/${target_name}_tweaked.plist"
outputs = [
_output_name,
]
- args = invoker.args + [
- "--plist",
- rebase_path(invoker.info_plist, root_build_dir),
- "--output",
- rebase_path(_output_name, root_build_dir),
- ]
+ if (!defined(args)) {
+ args = []
+ }
+ args += [
+ "--plist",
+ rebase_path(_source_name, root_build_dir),
+ "--output",
+ rebase_path(_output_name, root_build_dir),
+ "--platform=$current_os",
+ ]
+ deps = _deps
}
}
« no previous file with comments | « build/config/mac/plist_util.py ('k') | components/cronet/ios/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698