OLD | NEW |
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 import("//build/config/mac/symbols.gni") | 8 import("//build/config/mac/symbols.gni") |
9 | 9 |
10 if (is_mac) { | 10 if (is_mac) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 "The executable_name must be specified for $target_name") | 86 "The executable_name must be specified for $target_name") |
87 assert(defined(invoker.format), | 87 assert(defined(invoker.format), |
88 "The plist format must be specified for $target_name") | 88 "The plist format must be specified for $target_name") |
89 executable_name = invoker.executable_name | 89 executable_name = invoker.executable_name |
90 | 90 |
91 _output_name = "$target_gen_dir/$target_name.plist" | 91 _output_name = "$target_gen_dir/$target_name.plist" |
92 if (defined(invoker.output_name)) { | 92 if (defined(invoker.output_name)) { |
93 _output_name = invoker.output_name | 93 _output_name = invoker.output_name |
94 } | 94 } |
95 | 95 |
96 action(target_name) { | 96 _merged_name = get_path_info(_output_name, "dir") + "/" + |
97 script = "//build/config/mac/gen_plist.py" | 97 get_path_info(_output_name, "name") + "_merged" + |
98 sources = invoker.plist_templates | 98 get_path_info(_output_name, "extension") |
99 outputs = [ | 99 |
100 _output_name, | 100 action(target_name + "_merge_templates") { |
101 ] | |
102 extra_args = [] | |
103 if (defined(invoker.extra_substitutions)) { | |
104 foreach(substitution, invoker.extra_substitutions) { | |
105 extra_args += [ "-s=$substitution" ] | |
106 } | |
107 } | |
108 response_file_contents = | |
109 extra_args + [ | |
110 "-s=BUILD_MACHINE_OS_BUILD=$machine_os_build", | |
111 "-s=EXECUTABLE_NAME=$executable_name", | |
112 "-s=GCC_VERSION=com.apple.compilers.llvm.clang.1_0", | |
113 "-s=PRODUCT_NAME=$executable_name", | |
114 "-s=XCODE_BUILD=$xcode_build", | |
115 "-s=XCODE_VERSION=$xcode_version", | |
116 "-o=" + rebase_path(_output_name, root_build_dir), | |
117 "-f=" + invoker.format, | |
118 ] + rebase_path(sources, root_build_dir) | |
119 args = [ "@{{response_file_name}}" ] | |
120 forward_variables_from(invoker, | 101 forward_variables_from(invoker, |
121 [ | 102 [ |
122 "deps", | 103 "deps", |
123 "testonly", | 104 "testonly", |
| 105 ]) |
| 106 |
| 107 script = "//build/config/mac/plist_util.py" |
| 108 sources = invoker.plist_templates |
| 109 outputs = [ |
| 110 _merged_name, |
| 111 ] |
| 112 args = [ |
| 113 "merge", |
| 114 "-f=" + invoker.format, |
| 115 "-o=" + rebase_path(_merged_name, root_build_dir), |
| 116 ] + rebase_path(sources, root_build_dir) |
| 117 } |
| 118 |
| 119 action(target_name) { |
| 120 forward_variables_from(invoker, |
| 121 [ |
| 122 "testonly", |
124 "visibility", | 123 "visibility", |
125 ]) | 124 ]) |
| 125 script = "//build/config/mac/plist_util.py" |
| 126 sources = [ |
| 127 _merged_name, |
| 128 ] |
| 129 outputs = [ |
| 130 _output_name, |
| 131 ] |
| 132 args = [ "substitute" ] |
| 133 if (defined(invoker.extra_substitutions)) { |
| 134 foreach(substitution, invoker.extra_substitutions) { |
| 135 args += [ "-s=$substitution" ] |
| 136 } |
| 137 } |
| 138 args += [ |
| 139 "-s=BUILD_MACHINE_OS_BUILD=$machine_os_build", |
| 140 "-s=EXECUTABLE_NAME=$executable_name", |
| 141 "-s=GCC_VERSION=com.apple.compilers.llvm.clang.1_0", |
| 142 "-s=PRODUCT_NAME=$executable_name", |
| 143 "-s=XCODE_BUILD=$xcode_build", |
| 144 "-s=XCODE_VERSION=$xcode_version", |
| 145 "-o=" + rebase_path(_output_name, root_build_dir), |
| 146 "-t=" + rebase_path(_merged_name, root_build_dir), |
| 147 "-f=" + invoker.format, |
| 148 ] |
| 149 deps = [ |
| 150 ":" + target_name + "_merge_templates", |
| 151 ] |
126 } | 152 } |
127 } | 153 } |
128 | 154 |
129 # Template to combile .xib or .storyboard files. | 155 # Template to combile .xib or .storyboard files. |
130 # | 156 # |
131 # Arguments | 157 # Arguments |
132 # | 158 # |
133 # sources: | 159 # sources: |
134 # list of string, sources to compile | 160 # list of string, sources to compile |
135 # | 161 # |
(...skipping 27 matching lines...) Expand all Loading... |
163 ] | 189 ] |
164 if (!use_system_xcode) { | 190 if (!use_system_xcode) { |
165 args += [ | 191 args += [ |
166 "--developer_dir", | 192 "--developer_dir", |
167 hermetic_xcode_path, | 193 hermetic_xcode_path, |
168 ] | 194 ] |
169 } | 195 } |
170 args += ibtool_flags | 196 args += ibtool_flags |
171 } | 197 } |
172 } | 198 } |
OLD | NEW |