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

Unified Diff: build/config/mac/rules.gni

Issue 1925383003: [Mac/GN] Port tweak_info_plist.py and run it on //content targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra checks Created 4 years, 8 months 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/base_rules.gni ('k') | build/mac/tweak_info_plist.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/mac/rules.gni
diff --git a/build/config/mac/rules.gni b/build/config/mac/rules.gni
index 5e74a960ad21bde0df86b15f1fd0f11dbec76cb0..3c51905d42557e0516bdd08dc4dc8d7ce55cf703 100644
--- a/build/config/mac/rules.gni
+++ b/build/config/mac/rules.gni
@@ -20,6 +20,17 @@ import("//build/config/mac/base_rules.gni")
# (optional) string array, 'key=value' pairs for extra fields which are
# specified in a source Info.plist template.
template("mac_info_plist") {
+ assert(defined(invoker.info_plist) != defined(invoker.info_plist_target),
+ "Only one of info_plist or info_plist_target may be specified in " +
+ target_name)
+
+ if (defined(invoker.info_plist)) {
+ _info_plist = invoker.info_plist
+ } else {
+ _info_plist_target_output = get_target_outputs(invoker.info_plist_target)
+ _info_plist = _info_plist_target_output[0]
+ }
+
info_plist(target_name) {
format = "xml1"
extra_substitutions = []
@@ -32,9 +43,18 @@ template("mac_info_plist") {
]
plist_templates = [
"//build/config/mac/BuildInfo.plist",
- invoker.info_plist,
+ _info_plist,
]
- forward_variables_from(invoker, [ "executable_name" ])
+ if (defined(invoker.info_plist_target)) {
+ deps = [
+ invoker.info_plist_target,
+ ]
+ }
+ forward_variables_from(invoker,
+ [
+ "testonly",
+ "executable_name",
+ ])
}
}
@@ -101,7 +121,13 @@ template("mac_xib_bundle_data") {
# Arguments
#
# info_plist:
-# string, path to the Info.plist file that will be used for the bundle.
+# (optional) string, path to the Info.plist file that will be used for
+# the bundle.
+#
+# info_plist_target:
+# (optional) string, if the info_plist is generated from an action,
+# rather than a regular source file, specify the target name in lieu
+# of info_plist. The two arguments are mutually exclusive.
#
# output_name:
# (optional) string, name of the generated framework without the
@@ -118,8 +144,6 @@ template("mac_xib_bundle_data") {
template("mac_framework_bundle") {
assert(defined(invoker.deps),
"Dependencies must be specified for $target_name")
- assert(defined(invoker.info_plist),
- "The Info.plist file must be specified for $target_name")
_info_plist_target = target_name + "_info_plist"
@@ -128,7 +152,12 @@ template("mac_framework_bundle") {
if (defined(invoker.output_name)) {
executable_name = invoker.output_name
}
- forward_variables_from(invoker, [ "info_plist" ])
+ forward_variables_from(invoker,
+ [
+ "testonly",
+ "info_plist",
+ "info_plist_target",
+ ])
}
_info_plist_bundle_data = _info_plist_target + "_bundle_data"
@@ -159,7 +188,13 @@ template("mac_framework_bundle") {
# Arguments
#
# info_plist:
-# string, path to the Info.plist file that will be used for the bundle.
+# (optional) string, path to the Info.plist file that will be used for
+# the bundle.
+#
+# info_plist_target:
+# (optional) string, if the info_plist is generated from an action,
+# rather than a regular source file, specify the target name in lieu
+# of info_plist. The two arguments are mutually exclusive.
#
# output_name:
# (optional) string, name of the generated app without the
@@ -169,9 +204,6 @@ template("mac_framework_bundle") {
# (optional) list of label, additional configs to apply to the
# executable target.
template("mac_app_bundle") {
- assert(defined(invoker.info_plist),
- "The Info.plist file must be specified for $target_name")
-
_target_name = target_name
_output_name = target_name
if (defined(invoker.output_name)) {
@@ -181,6 +213,18 @@ template("mac_app_bundle") {
_executable_target = target_name + "_executable"
_executable_bundle_data = _executable_target + "_bundle_data"
+ _info_plist_target = target_name + "_info_plist"
+
+ mac_info_plist(_info_plist_target) {
+ executable_name = _output_name
+ forward_variables_from(invoker,
+ [
+ "testonly",
+ "info_plist",
+ "info_plist_target",
+ ])
+ }
+
executable(_executable_target) {
visibility = [ ":$_executable_bundle_data" ]
forward_variables_from(invoker,
@@ -213,13 +257,6 @@ template("mac_app_bundle") {
]
}
- _info_plist_target = target_name + "_info_plist"
-
- mac_info_plist(_info_plist_target) {
- executable_name = _output_name
- forward_variables_from(invoker, [ "info_plist" ])
- }
-
_info_plist_bundle_data = _info_plist_target + "_bundle_data"
bundle_data(_info_plist_bundle_data) {
« no previous file with comments | « build/config/mac/base_rules.gni ('k') | build/mac/tweak_info_plist.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698