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

Side by Side Diff: build/config/mac/base_rules.gni

Issue 1964393002: [GN] New template convert_plist to convert a plist file to another format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « build/config/ios/rules.gni ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # This file contains rules that are shared between Mac and iOS. 5 # This file contains rules that are shared between Mac and iOS.
6 6
7 import("//build/toolchain/toolchain.gni") 7 import("//build/toolchain/toolchain.gni")
8 8
9 if (is_mac) { 9 if (is_mac) {
10 import("//build/config/mac/mac_sdk.gni") 10 import("//build/config/mac/mac_sdk.gni")
11 } else if (is_ios) { 11 } else if (is_ios) {
12 import("//build/config/ios/ios_sdk.gni") 12 import("//build/config/ios/ios_sdk.gni")
13 } 13 }
14 14
15 # Convert plist file to given format.
16 #
17 # Arguments
18 #
19 # source:
20 # string, path to the plist file to convert
21 #
22 # output:
23 # string, path to the converted plist, must be under $root_build_dir
24 #
25 # format:
26 # string, the format to `plutil -convert` the plist to.
27 template("convert_plist") {
28 assert(defined(invoker.source), "source must be defined for $target_name")
29 assert(defined(invoker.output), "output must be defined for $target_name")
30 assert(defined(invoker.format), "format must be defined for $target_name")
31
32 action(target_name) {
33 forward_variables_from(invoker,
34 [
35 "visibility",
36 "testonly",
37 "deps",
38 ])
39
40 script = "//build/config/mac/xcrun.py"
41 sources = [
42 invoker.source,
43 ]
44 outputs = [
45 invoker.output,
46 ]
47 args = [
48 "plutil",
49 "-convert",
50 invoker.format,
51 "-o",
52 rebase_path(invoker.output, root_out_dir),
53 rebase_path(invoker.source, root_out_dir),
54 ]
55 }
56 }
57
15 # The base template used to generate Info.plist files for iOS and Mac apps and 58 # The base template used to generate Info.plist files for iOS and Mac apps and
16 # frameworks. 59 # frameworks.
17 # 60 #
18 # Arguments 61 # Arguments
19 # 62 #
20 # plist_templates: 63 # plist_templates:
21 # string array, paths to plist files which will be used for the bundle. 64 # string array, paths to plist files which will be used for the bundle.
22 # 65 #
23 # executable_name: 66 # executable_name:
24 # string, name of the generated target used for the product 67 # string, name of the generated target used for the product
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 "-s=GCC_VERSION=com.apple.compilers.llvm.clang.1_0", 102 "-s=GCC_VERSION=com.apple.compilers.llvm.clang.1_0",
60 "-s=PRODUCT_NAME=$executable_name", 103 "-s=PRODUCT_NAME=$executable_name",
61 "-s=XCODE_BUILD=$xcode_build", 104 "-s=XCODE_BUILD=$xcode_build",
62 "-s=XCODE_VERSION=$xcode_version", 105 "-s=XCODE_VERSION=$xcode_version",
63 "-o=" + rebase_path(outputs[0], root_build_dir), 106 "-o=" + rebase_path(outputs[0], root_build_dir),
64 "-f=" + invoker.format, 107 "-f=" + invoker.format,
65 ] + rebase_path(sources, root_build_dir) 108 ] + rebase_path(sources, root_build_dir)
66 args = [ "@{{response_file_name}}" ] 109 args = [ "@{{response_file_name}}" ]
67 forward_variables_from(invoker, 110 forward_variables_from(invoker,
68 [ 111 [
112 "deps",
69 "testonly", 113 "testonly",
70 "deps", 114 "visibility",
71 ]) 115 ])
72 } 116 }
73 } 117 }
74 118
75 # This is used as the base template for both iOS and Mac frameworks. 119 # This is used as the base template for both iOS and Mac frameworks.
76 # 120 #
77 # By default, the bundle target this template generates does not link the 121 # By default, the bundle target this template generates does not link the
78 # resulting framework into anything that depends on it. If a dependency wants 122 # resulting framework into anything that depends on it. If a dependency wants
79 # a link-time (as well as build-time) dependency on the framework bundle, 123 # a link-time (as well as build-time) dependency on the framework bundle,
80 # depend against "$target_name+link". If only the build-time dependency is 124 # depend against "$target_name+link". If only the build-time dependency is
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 "$target_gen_dir/{{source_name_part}}.nib", 361 "$target_gen_dir/{{source_name_part}}.nib",
318 ] 362 ]
319 args = [ 363 args = [
320 "--input", 364 "--input",
321 "{{source}}", 365 "{{source}}",
322 "--output", 366 "--output",
323 rebase_path("$target_gen_dir/{{source_name_part}}.nib"), 367 rebase_path("$target_gen_dir/{{source_name_part}}.nib"),
324 ] + ibtool_flags 368 ] + ibtool_flags
325 } 369 }
326 } 370 }
OLDNEW
« no previous file with comments | « build/config/ios/rules.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698