Index: build/config/mac/base_rules.gni |
diff --git a/build/config/mac/base_rules.gni b/build/config/mac/base_rules.gni |
index 4da6ea28924212f1fd7f1bd4d2148718791cf8da..aa42ed65f1cfe515951cf033dfdd3e45b43c0ed5 100644 |
--- a/build/config/mac/base_rules.gni |
+++ b/build/config/mac/base_rules.gni |
@@ -12,6 +12,49 @@ if (is_mac) { |
import("//build/config/ios/ios_sdk.gni") |
} |
+# Convert plist file to given format. |
+# |
+# Arguments |
+# |
+# source: |
+# string, path to the plist file to convert |
+# |
+# output: |
+# string, path to the converted plist, must be under $root_build_dir |
+# |
+# format: |
+# string, the format to `plutil -convert` the plist to. |
+template("convert_plist") { |
+ assert(defined(invoker.source), "source must be defined for $target_name") |
+ assert(defined(invoker.output), "output must be defined for $target_name") |
+ assert(defined(invoker.format), "format must be defined for $target_name") |
+ |
+ action(target_name) { |
+ forward_variables_from(invoker, |
+ [ |
+ "visibility", |
+ "testonly", |
+ "deps", |
+ ]) |
+ |
+ script = "//build/config/mac/xcrun.py" |
+ sources = [ |
+ invoker.source, |
+ ] |
+ outputs = [ |
+ invoker.output, |
+ ] |
+ args = [ |
+ "plutil", |
+ "-convert", |
+ invoker.format, |
+ "-o", |
+ rebase_path(invoker.output, root_out_dir), |
+ rebase_path(invoker.source, root_out_dir), |
+ ] |
+ } |
+} |
+ |
# The base template used to generate Info.plist files for iOS and Mac apps and |
# frameworks. |
# |
@@ -66,8 +109,9 @@ template("info_plist") { |
args = [ "@{{response_file_name}}" ] |
forward_variables_from(invoker, |
[ |
- "testonly", |
"deps", |
+ "testonly", |
+ "visibility", |
]) |
} |
} |