OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import("//build/config/mac/base_rules.gni") | 5 import("//build/config/mac/base_rules.gni") |
6 | 6 |
7 # Generates Info.plist files for Mac apps and frameworks. | 7 # Generates Info.plist files for Mac apps and frameworks. |
8 # | 8 # |
9 # Arguments | 9 # Arguments |
10 # | 10 # |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 executable_name = _output_name | 236 executable_name = _output_name |
237 forward_variables_from(invoker, | 237 forward_variables_from(invoker, |
238 [ | 238 [ |
239 "extra_substitutions", | 239 "extra_substitutions", |
240 "info_plist", | 240 "info_plist", |
241 "info_plist_target", | 241 "info_plist_target", |
242 "testonly", | 242 "testonly", |
243 ]) | 243 ]) |
244 } | 244 } |
245 | 245 |
| 246 _pkg_info_target = target_name + "_pkg_info" |
| 247 |
| 248 action(_pkg_info_target) { |
| 249 forward_variables_from(invoker, [ "testonly" ]) |
| 250 script = "//build/config/mac/write_pkg_info.py" |
| 251 sources = get_target_outputs(":$_info_plist_target") |
| 252 outputs = [ |
| 253 "$target_gen_dir/$_pkg_info_target", |
| 254 ] |
| 255 args = [ "--plist" ] + rebase_path(sources, root_build_dir) + |
| 256 [ "--output" ] + rebase_path(outputs, root_build_dir) |
| 257 deps = [ |
| 258 ":$_info_plist_target", |
| 259 ] |
| 260 } |
| 261 |
246 executable(_executable_target) { | 262 executable(_executable_target) { |
247 visibility = [ ":$_executable_bundle_data" ] | 263 visibility = [ ":$_executable_bundle_data" ] |
248 forward_variables_from(invoker, | 264 forward_variables_from(invoker, |
249 "*", | 265 "*", |
250 [ | 266 [ |
251 "assert_no_deps", | 267 "assert_no_deps", |
252 "data_deps", | 268 "data_deps", |
253 "info_plist", | 269 "info_plist", |
254 "output_name", | 270 "output_name", |
255 "visibility", | 271 "visibility", |
(...skipping 29 matching lines...) Expand all Loading... |
285 visibility = [ ":$_target_name" ] | 301 visibility = [ ":$_target_name" ] |
286 sources = get_target_outputs(":$_info_plist_target") | 302 sources = get_target_outputs(":$_info_plist_target") |
287 outputs = [ | 303 outputs = [ |
288 "{{bundle_root_dir}}/Info.plist", | 304 "{{bundle_root_dir}}/Info.plist", |
289 ] | 305 ] |
290 public_deps = [ | 306 public_deps = [ |
291 ":$_info_plist_target", | 307 ":$_info_plist_target", |
292 ] | 308 ] |
293 } | 309 } |
294 | 310 |
| 311 _pkg_info_bundle_data = _pkg_info_target + "_bundle_data" |
| 312 |
| 313 bundle_data(_pkg_info_bundle_data) { |
| 314 forward_variables_from(invoker, [ "testonly" ]) |
| 315 visibility = [ ":$_target_name" ] |
| 316 sources = get_target_outputs(":$_pkg_info_target") |
| 317 outputs = [ |
| 318 "{{bundle_root_dir}}/PkgInfo", |
| 319 ] |
| 320 public_deps = [ |
| 321 ":$_pkg_info_target", |
| 322 ] |
| 323 } |
| 324 |
295 create_bundle(_target_name) { | 325 create_bundle(_target_name) { |
296 forward_variables_from(invoker, | 326 forward_variables_from(invoker, |
297 [ | 327 [ |
298 "data_deps", | 328 "data_deps", |
299 "deps", | 329 "deps", |
300 "public_deps", | 330 "public_deps", |
301 "testonly", | 331 "testonly", |
302 ]) | 332 ]) |
303 if (!defined(deps)) { | 333 if (!defined(deps)) { |
304 deps = [] | 334 deps = [] |
305 } | 335 } |
306 deps += [ | 336 deps += [ |
307 ":$_executable_bundle_data", | 337 ":$_executable_bundle_data", |
308 ":$_info_plist_bundle_data", | 338 ":$_info_plist_bundle_data", |
| 339 ":$_pkg_info_bundle_data", |
309 ] | 340 ] |
310 | 341 |
311 bundle_root_dir = "$root_out_dir/${_output_name}.app/Contents" | 342 bundle_root_dir = "$root_out_dir/${_output_name}.app/Contents" |
312 bundle_resources_dir = "$bundle_root_dir/Resources" | 343 bundle_resources_dir = "$bundle_root_dir/Resources" |
313 bundle_executable_dir = "$bundle_root_dir/MacOS" | 344 bundle_executable_dir = "$bundle_root_dir/MacOS" |
314 } | 345 } |
315 } | 346 } |
316 | 347 |
317 # Template to package a loadable_module into a .plugin bundle. | 348 # Template to package a loadable_module into a .plugin bundle. |
318 # | 349 # |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 ]) | 400 ]) |
370 if (!defined(deps)) { | 401 if (!defined(deps)) { |
371 deps = [] | 402 deps = [] |
372 } | 403 } |
373 deps += [ ":$_loadable_module_bundle_data" ] | 404 deps += [ ":$_loadable_module_bundle_data" ] |
374 | 405 |
375 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" | 406 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" |
376 bundle_executable_dir = "$bundle_root_dir/MacOS" | 407 bundle_executable_dir = "$bundle_root_dir/MacOS" |
377 } | 408 } |
378 } | 409 } |
OLD | NEW |