[GN] New template convert_plist to convert a plist file to another format.

Add a new target convert_plist to invoke "plutil -convert" only on a
given plist file. This is used as iOS needs to convert all plist to
binary in bundle, including plist that are not Info.plist files.

Fix ios_info_plist and info_plist templates to also forward "visibility"
from the invoker.

BUG=459705

Review-Url: https://codereview.chromium.org/1964393002
Cr-Original-Commit-Position: refs/heads/master@{#392924}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7f441707e74fd96a04ecdd0c97f1f66d83e7bf5d
This commit is contained in:
sdefresne 2016-05-11 07:51:28 -07:00 коммит произвёл Commit bot
Родитель 059132b97e
Коммит ef80d791fd
2 изменённых файлов: 50 добавлений и 2 удалений

Просмотреть файл

@ -39,7 +39,11 @@ template("ios_info_plist") {
"//build/config/ios/BuildInfo.plist",
invoker.info_plist,
]
forward_variables_from(invoker, [ "executable_name" ])
forward_variables_from(invoker,
[
"executable_name",
"visibility",
])
}
}

Просмотреть файл

@ -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",
])
}
}