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/ios/ios_sdk.gni") | 5 import("//build/config/ios/ios_sdk.gni") |
6 import("//build/config/mac/base_rules.gni") | 6 import("//build/config/mac/base_rules.gni") |
7 | 7 |
8 # Generates Info.plist files for Mac apps and frameworks. | 8 # Generates Info.plist files for Mac apps and frameworks. |
9 # | 9 # |
10 # Arguments | 10 # Arguments |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 public_deps += [ ":$_compile_xib" ] | 370 public_deps += [ ":$_compile_xib" ] |
371 | 371 |
372 sources = get_target_outputs(":$_compile_xib") | 372 sources = get_target_outputs(":$_compile_xib") |
373 | 373 |
374 outputs = [ | 374 outputs = [ |
375 "{{bundle_resources_dir}}/{{source_file_part}}", | 375 "{{bundle_resources_dir}}/{{source_file_part}}", |
376 ] | 376 ] |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
| 380 # Compile a strings file and add it to a bundle_data so that it is available |
| 381 # at runtime in the bundle. |
| 382 # |
| 383 # Arguments |
| 384 # |
| 385 # source: |
| 386 # string, path of the strings file to compile. |
| 387 # |
| 388 # output: |
| 389 # string, path of the compiled file in the final bundle. |
| 390 # |
| 391 # Forwards all variables to the bundle_data target. |
| 392 template("bundle_data_strings") { |
| 393 assert(defined(invoker.source), "source needs to be defined for $target_name") |
| 394 assert(defined(invoker.output), "output needs to be defined for $target_name") |
| 395 |
| 396 _source_extension = get_path_info(invoker.source, "extension") |
| 397 assert(_source_extension == "strings", |
| 398 "source must be a .strings for $target_name") |
| 399 |
| 400 _target_name = target_name |
| 401 _convert_target = target_name + "_compile_strings" |
| 402 |
| 403 convert_plist(_convert_target) { |
| 404 visibility = [ ":$_target_name" ] |
| 405 source = invoker.source |
| 406 output = |
| 407 "$target_gen_dir/$_target_name/" + get_path_info(invoker.source, "file") |
| 408 format = "binary1" |
| 409 } |
| 410 |
| 411 bundle_data(_target_name) { |
| 412 forward_variables_from(invoker, |
| 413 "*", |
| 414 [ |
| 415 "source", |
| 416 "output", |
| 417 ]) |
| 418 |
| 419 if (!defined(public_deps)) { |
| 420 public_deps = [] |
| 421 } |
| 422 public_deps += [ ":$_convert_target" ] |
| 423 |
| 424 sources = get_target_outputs(":$_convert_target") |
| 425 |
| 426 outputs = [ |
| 427 invoker.output, |
| 428 ] |
| 429 } |
| 430 } |
| 431 |
380 # Template to package a shared library into an iOS framework bundle. | 432 # Template to package a shared library into an iOS framework bundle. |
381 # | 433 # |
382 # This template provides two targets to control whether the framework is | 434 # This template provides two targets to control whether the framework is |
383 # merely built when targets depend on it, or whether it is linked as well: | 435 # merely built when targets depend on it, or whether it is linked as well: |
384 # "$target_name" and "$target_name+link". | 436 # "$target_name" and "$target_name+link". |
385 # | 437 # |
386 # See the //build/config/mac/base_rules.gni:framework_bundle for a discussion | 438 # See the //build/config/mac/base_rules.gni:framework_bundle for a discussion |
387 # and examples. | 439 # and examples. |
388 # | 440 # |
389 # Arguments | 441 # Arguments |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 [ | 613 [ |
562 "testonly", | 614 "testonly", |
563 "visibility", | 615 "visibility", |
564 ]) | 616 ]) |
565 public_deps = [ | 617 public_deps = [ |
566 ":$_framework_target+link", | 618 ":$_framework_target+link", |
567 ] | 619 ] |
568 } | 620 } |
569 } | 621 } |
570 } | 622 } |
OLD | NEW |