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

Side by Side Diff: build/config/ios/rules.gni

Issue 2221773002: [iOS] Simplify bundle creation by always calling codesign.py script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@{.}
Patch Set: Created 4 years, 4 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/codesign.py ('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 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 import("//build/config/mac/symbols.gni") 7 import("//build/config/mac/symbols.gni")
8 8
9 _is_fat_build = additional_toolchains != [] 9 _is_fat_build = additional_toolchains != []
10 if (_is_fat_build) { 10 if (_is_fat_build) {
11 _is_fat_build_main_target = current_toolchain == default_toolchain 11 _is_fat_build_main_target = current_toolchain == default_toolchain
12 } 12 }
13 13
14 if (use_ios_simulator || ios_enable_code_signing) { 14 _code_signing_script_path = "//build/config/ios/codesign.py"
15 _default_entitlements_path = "//build/config/ios/entitlements.plist" 15 _default_entitlements_path = "//build/config/ios/entitlements.plist"
16 }
17 16
18 # Generates Info.plist files for Mac apps and frameworks. 17 # Generates Info.plist files for Mac apps and frameworks.
19 # 18 #
20 # Arguments 19 # Arguments
21 # 20 #
22 # info_plist: 21 # info_plist:
23 # (optional) string, path to the Info.plist file that will be used for 22 # (optional) string, path to the Info.plist file that will be used for
24 # the bundle. 23 # the bundle.
25 # 24 #
26 # info_plist_target: 25 # info_plist_target:
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 228 }
230 libs += [ "UIKit.framework" ] 229 libs += [ "UIKit.framework" ]
231 } 230 }
232 } else { 231 } else {
233 # This is either a thin build or the default toolchain of a fat-build. 232 # This is either a thin build or the default toolchain of a fat-build.
234 # The template will expand in many different target ($target_name is the 233 # The template will expand in many different target ($target_name is the
235 # create_bundle target) used as input to the create_bundle target. 234 # create_bundle target) used as input to the create_bundle target.
236 _generate_info_plist = target_name + "_generate_info_plist" 235 _generate_info_plist = target_name + "_generate_info_plist"
237 _bundle_data_info_plist = target_name + "_bundle_data_info_plist" 236 _bundle_data_info_plist = target_name + "_bundle_data_info_plist"
238 237
239 if (use_ios_simulator || ios_enable_code_signing) { 238 _entitlements_path = _default_entitlements_path
240 _entitlements_path = _default_entitlements_path 239 if (defined(invoker.entitlements_path)) {
241 if (defined(invoker.entitlements_path)) { 240 _entitlements_path = invoker.entitlements_path
242 _entitlements_path = invoker.entitlements_path
243 }
244 } 241 }
245 242
246 ios_info_plist(_generate_info_plist) { 243 ios_info_plist(_generate_info_plist) {
247 visibility = [ ":$_bundle_data_info_plist" ] 244 visibility = [ ":$_bundle_data_info_plist" ]
248 if (use_ios_simulator) { 245 if (use_ios_simulator) {
249 visibility += [ ":$_generate_entitlements_target" ] 246 visibility += [ ":$_generate_entitlements_target" ]
250 } 247 }
251 executable_name = _output_name 248 executable_name = _output_name
252 forward_variables_from(invoker, 249 forward_variables_from(invoker,
253 [ 250 [
(...skipping 14 matching lines...) Expand all
268 ":$_generate_info_plist", 265 ":$_generate_info_plist",
269 ] 266 ]
270 } 267 }
271 268
272 if (use_ios_simulator) { 269 if (use_ios_simulator) {
273 action(_generate_entitlements_target) { 270 action(_generate_entitlements_target) {
274 _gen_info_plist_target = ":$_generate_info_plist" 271 _gen_info_plist_target = ":$_generate_info_plist"
275 _gen_info_plist_outputs = get_target_outputs(_gen_info_plist_target) 272 _gen_info_plist_outputs = get_target_outputs(_gen_info_plist_target)
276 _info_plist_path = _gen_info_plist_outputs[0] 273 _info_plist_path = _gen_info_plist_outputs[0]
277 274
278 script = "//build/config/ios/codesign.py" 275 script = _code_signing_script_path
279 deps = [ 276 deps = [
280 _gen_info_plist_target, 277 _gen_info_plist_target,
281 ] 278 ]
282 sources = [ 279 sources = [
283 _entitlements_path, 280 _entitlements_path,
284 _info_plist_path, 281 _info_plist_path,
285 ] 282 ]
286 outputs = [ 283 outputs = [
287 _generate_entitlements_output, 284 _generate_entitlements_output,
288 ] 285 ]
289 args = [ 286 args = [
290 "generate-entitlements", 287 "generate-entitlements",
291 "-e=" + rebase_path(_entitlements_path, root_build_dir), 288 "-e=" + rebase_path(_entitlements_path, root_build_dir),
292 "-p=" + rebase_path(_info_plist_path, root_build_dir), 289 "-p=" + rebase_path(_info_plist_path, root_build_dir),
293 ] + rebase_path(outputs, root_build_dir) 290 ] + rebase_path(outputs, root_build_dir)
294 } 291 }
295 } 292 }
296 293
297 _link_executable = _target_name + "_executable" 294 _link_executable = _target_name + "_executable"
298 295 _link_executable_visibility = [ ":$_target_name" ]
299 if (ios_enable_code_signing) {
300 _link_executable_visibility = [ ":$_target_name" ]
301 } else {
302 _bundle_data_executable = target_name + "_bundle_data_executable"
303 _link_executable_visibility = [ ":$_bundle_data_executable" ]
304 }
305 296
306 # For a fat-build, the different "executable" outputs will be used to 297 # For a fat-build, the different "executable" outputs will be used to
307 # create the final binary using "lipo". As the corresponding target has 298 # create the final binary using "lipo". As the corresponding target has
308 # the same role as the "executable" target in a thin build, copy the 299 # the same role as the "executable" target in a thin build, copy the
309 # visibility and redefine some variables. 300 # visibility and redefine some variables.
310 if (_is_fat_build) { 301 if (_is_fat_build) {
311 _lipo_executable = _link_executable 302 _lipo_executable = _link_executable
312 _lipo_executable_visibility = _link_executable_visibility 303 _lipo_executable_visibility = _link_executable_visibility
313 304
314 _link_executable_visibility = [] 305 _link_executable_visibility = []
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 outputs += [ outputs[0] + ".unstripped" ] 421 outputs += [ outputs[0] + ".unstripped" ]
431 args += [ "-Wcrl,unstripped," + 422 args += [ "-Wcrl,unstripped," +
432 rebase_path(get_path_info(outputs[0], "dir"), 423 rebase_path(get_path_info(outputs[0], "dir"),
433 root_build_dir) ] 424 root_build_dir) ]
434 } 425 }
435 } 426 }
436 } 427 }
437 } 428 }
438 } 429 }
439 430
440 if (!ios_enable_code_signing) {
441 # If codesigning is enabled, the binary will be copied into the bundle
442 # by the codesigning script (as the binary is updated by the signature).
443 # Otherwise, this "bundle_data" declares the location of the binary in
444 # the .app bundle.
445 bundle_data(_bundle_data_executable) {
446 forward_variables_from(invoker, [ "testonly" ])
447 visibility = [ ":$_target_name" ]
448 outputs = [
449 "{{bundle_executable_dir}}/$_output_name",
450 ]
451 if (_is_fat_build) {
452 public_deps = [
453 ":$_lipo_executable",
454 ]
455 } else {
456 public_deps = [
457 ":$_link_executable",
458 ]
459 }
460 sources = [
461 "$target_out_dir/$_output_name",
462 ]
463 }
464 }
465
466 if (!ios_enable_code_signing && defined(invoker.extra_system_frameworks)) {
467 bundle_data(_target_name + "_extra_system_frameworks") {
468 visibility = [ ":$_target_name" ]
469 sources = invoker.extra_system_frameworks
470 outputs = [
471 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
472 ]
473 }
474 }
475
476 create_bundle(target_name) { 431 create_bundle(target_name) {
477 forward_variables_from(invoker, 432 forward_variables_from(invoker,
478 [ 433 [
479 "data_deps", 434 "data_deps",
480 "deps", 435 "deps",
481 "public_deps", 436 "public_deps",
482 "testonly", 437 "testonly",
483 "visibility", 438 "visibility",
484 ]) 439 ])
485 440
486 if (!defined(deps)) { 441 if (!defined(deps)) {
487 deps = [] 442 deps = []
488 } 443 }
489 deps += [ ":$_bundle_data_info_plist" ] 444 deps += [ ":$_bundle_data_info_plist" ]
490 if (!defined(public_deps)) { 445 if (!defined(public_deps)) {
491 public_deps = [] 446 public_deps = []
492 } 447 }
493 if (ios_enable_code_signing) { 448 if (_is_fat_build) {
494 if (_is_fat_build) { 449 public_deps += [ ":$_lipo_executable" ]
495 public_deps += [ ":$_lipo_executable" ]
496 } else {
497 public_deps += [ ":$_link_executable" ]
498 }
499 } else { 450 } else {
500 public_deps += [ ":$_bundle_data_executable" ] 451 public_deps += [ ":$_link_executable" ]
501 if (defined(invoker.extra_system_frameworks)) {
502 deps += [ ":${_target_name}_extra_system_frameworks" ]
503 }
504 } 452 }
505 if (defined(invoker.bundle_deps)) { 453 if (defined(invoker.bundle_deps)) {
506 deps += invoker.bundle_deps 454 deps += invoker.bundle_deps
507 } 455 }
508 456
509 if (use_ios_simulator) { 457 if (use_ios_simulator) {
510 if (!defined(data_deps)) { 458 if (!defined(data_deps)) {
511 data_deps = [] 459 data_deps = []
512 } 460 }
513 data_deps += [ "//testing/iossim" ] 461 data_deps += [ "//testing/iossim" ]
514 } 462 }
515 463
516 if (defined(invoker.product_type)) { 464 if (defined(invoker.product_type)) {
517 product_type = invoker.product_type 465 product_type = invoker.product_type
518 } else { 466 } else {
519 product_type = "com.apple.product-type.application" 467 product_type = "com.apple.product-type.application"
520 } 468 }
521 469
522 if (defined(invoker.bundle_extension)) { 470 if (defined(invoker.bundle_extension)) {
523 _bundle_extension = invoker.bundle_extension 471 _bundle_extension = invoker.bundle_extension
524 } else { 472 } else {
525 _bundle_extension = ".app" 473 _bundle_extension = ".app"
526 } 474 }
527 475
528 bundle_root_dir = "$root_out_dir/$_output_name$_bundle_extension" 476 bundle_root_dir = "$root_out_dir/$_output_name$_bundle_extension"
529 bundle_resources_dir = bundle_root_dir 477 bundle_resources_dir = bundle_root_dir
530 bundle_executable_dir = bundle_root_dir 478 bundle_executable_dir = bundle_root_dir
531 bundle_plugins_dir = "$bundle_root_dir/PlugIns" 479 bundle_plugins_dir = "$bundle_root_dir/PlugIns"
532 480
481 code_signing_script = _code_signing_script_path
482 code_signing_sources = [
483 _entitlements_path,
484 "$target_out_dir/$_output_name",
485 ]
486 code_signing_outputs = [ "$bundle_root_dir/$_output_name" ]
533 if (ios_enable_code_signing) { 487 if (ios_enable_code_signing) {
534 code_signing_script = "//build/config/ios/codesign.py" 488 code_signing_outputs +=
535 code_signing_sources = [ 489 [ "$bundle_root_dir/_CodeSignature/CodeResources" ]
536 _entitlements_path, 490 }
537 "$target_out_dir/$_output_name", 491 if (ios_code_signing_identity != "") {
538 ] 492 code_signing_outputs += [ "$bundle_root_dir/embedded.mobileprovision" ]
539 code_signing_outputs = [ 493 }
540 "$bundle_root_dir/$_output_name", 494 if (defined(invoker.extra_system_frameworks)) {
541 "$bundle_root_dir/_CodeSignature/CodeResources", 495 foreach(_framework, invoker.extra_system_frameworks) {
542 ] 496 code_signing_outputs += [ "$bundle_root_dir/Frameworks/" +
543 if (ios_code_signing_identity != "") { 497 get_path_info(_framework, "file") ]
544 code_signing_outputs +=
545 [ "$bundle_root_dir/embedded.mobileprovision" ]
546 } 498 }
547 if (defined(invoker.extra_system_frameworks)) { 499 }
548 foreach(_framework, invoker.extra_system_frameworks) { 500 code_signing_args = [
549 code_signing_outputs += [ "$bundle_root_dir/Frameworks/" + 501 "code-sign-bundle",
550 get_path_info(_framework, "file") ] 502 "-i=" + ios_code_signing_identity,
551 } 503 "-e=" + rebase_path(_entitlements_path, root_build_dir),
504 "-b=" + rebase_path("$target_out_dir/$_output_name", root_build_dir),
505 rebase_path(bundle_root_dir, root_build_dir),
506 ]
507 if (defined(invoker.extra_system_frameworks)) {
508 # All framework in extra_system_frameworks are expected to be
509 # system framework and the path to be already system absolute
510 # so do not use rebase_path here.
511 foreach(_framework, invoker.extra_system_frameworks) {
512 code_signing_args += [ "-F=" + _framework ]
552 } 513 }
553 code_signing_args = [ 514 }
554 "code-sign-bundle", 515 if (!ios_enable_code_signing) {
555 "-i=" + ios_code_signing_identity, 516 code_signing_args += [ "--disable-code-signature" ]
556 "-e=" + rebase_path(_entitlements_path, root_build_dir),
557 "-b=" + rebase_path("$target_out_dir/$_output_name", root_build_dir),
558 rebase_path(bundle_root_dir, root_build_dir),
559 ]
560 if (defined(invoker.extra_system_frameworks)) {
561 # All framework in extra_system_frameworks are expected to be
562 # system framework and the path to be already system absolute
563 # so do not use rebase_path here.
564 foreach(_framework, invoker.extra_system_frameworks) {
565 code_signing_args += [ "-F=" + _framework ]
566 }
567 }
568 } 517 }
569 } 518 }
570 } 519 }
571 520
572 # TODO(crbug.com/395883): ensure those variables are marked as used to 521 # TODO(crbug.com/395883): ensure those variables are marked as used to
573 # avoid errors while running "gn gen". 522 # avoid errors while running "gn gen".
574 if (defined(invoker.entitlements_path)) { 523 if (defined(invoker.entitlements_path)) {
575 assert(invoker.entitlements_path != "", 524 assert(invoker.entitlements_path != "",
576 "mark invoker.entitlements_path as used") 525 "mark invoker.entitlements_path as used")
577 } 526 }
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 # that defines the real framework bundle (it will support the current cpu 843 # that defines the real framework bundle (it will support the current cpu
895 # as it is a fat framework). 844 # as it is a fat framework).
896 845
897 if (_is_fat_build && !_is_fat_build_main_target) { 846 if (_is_fat_build && !_is_fat_build_main_target) {
898 shared_library(_target_name) { 847 shared_library(_target_name) {
899 forward_variables_from(invoker, 848 forward_variables_from(invoker,
900 "*", 849 "*",
901 [ 850 [
902 "assert_no_deps", 851 "assert_no_deps",
903 "bundle_deps", 852 "bundle_deps",
904 "code_signing_enabled",
905 "data_deps", 853 "data_deps",
906 "info_plist", 854 "info_plist",
907 "info_plist_target", 855 "info_plist_target",
908 "output_name", 856 "output_name",
909 ]) 857 ])
910 if (defined(visibility)) { 858 if (defined(visibility)) {
911 visibility += [ ":${_target_name}_shared_library($default_toolchain)" ] 859 visibility += [ ":${_target_name}_shared_library($default_toolchain)" ]
912 } 860 }
913 output_name = _output_name 861 output_name = _output_name
914 output_prefix_override = true 862 output_prefix_override = true
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 964
1017 config(_framework_headers_config) { 965 config(_framework_headers_config) {
1018 # The link settings are inherited from the framework_bundle config. 966 # The link settings are inherited from the framework_bundle config.
1019 cflags = [ 967 cflags = [
1020 "-F", 968 "-F",
1021 rebase_path("$root_out_dir/.", root_build_dir), 969 rebase_path("$root_out_dir/.", root_build_dir),
1022 ] 970 ]
1023 } 971 }
1024 } 972 }
1025 973
1026 _code_signing_enabled = ios_enable_code_signing
1027 if (defined(invoker.code_signing_enabled)) {
1028 _code_signing_enabled =
1029 invoker.code_signing_enabled && _code_signing_enabled
1030 }
1031
1032 # If the framework is unversioned, the final _target_name will be the 974 # If the framework is unversioned, the final _target_name will be the
1033 # create_bundle(_framework_target), otherwise an action with the name 975 # create_bundle(_framework_target), otherwise an action with the name
1034 # _target_name will depends on the the create_bundle() in order to prepare 976 # _target_name will depends on the the create_bundle() in order to prepare
1035 # the versioned directory structure. 977 # the versioned directory structure.
1036 _framework_target = _target_name 978 _framework_target = _target_name
1037 _framework_name = _output_name + ".framework" 979 _framework_name = _output_name + ".framework"
1038 _framework_root_dir = "$root_out_dir/$_framework_name" 980 _framework_root_dir = "$root_out_dir/$_framework_name"
1039 if (defined(invoker.framework_version) && invoker.framework_version != "") { 981 if (defined(invoker.framework_version) && invoker.framework_version != "") {
1040 _framework_version = invoker.framework_version 982 _framework_version = invoker.framework_version
1041 _framework_root_dir += "/Versions/$_framework_version" 983 _framework_root_dir += "/Versions/$_framework_version"
1042 _framework_target = _target_name + "_create_bundle" 984 _framework_target = _target_name + "_create_bundle"
1043 } 985 }
1044 986
1045 _link_shared_library_target = target_name + "_shared_library" 987 _link_shared_library_target = target_name + "_shared_library"
1046 _shared_library_dir = "$target_out_dir/$_link_shared_library_target" 988 _shared_library_dir = "$target_out_dir/$_link_shared_library_target"
1047 989 _link_shared_library_visibility = [ ":$_framework_target" ]
1048 if (_code_signing_enabled) {
1049 _link_shared_library_visibility = [ ":$_framework_target" ]
1050 } else {
1051 _shared_library_bundle_data = target_name + "_shared_library_bundle_data"
1052 _link_shared_library_visibility = [ ":$_shared_library_bundle_data" ]
1053 }
1054 990
1055 if (_is_fat_build) { 991 if (_is_fat_build) {
1056 _lipo_shared_library_target = _link_shared_library_target 992 _lipo_shared_library_target = _link_shared_library_target
1057 _lipo_shared_library_visibility = _link_shared_library_visibility 993 _lipo_shared_library_visibility = _link_shared_library_visibility
1058 994
1059 _link_shared_library_visibility = [] 995 _link_shared_library_visibility = []
1060 _link_shared_library_visibility = [ ":$_lipo_shared_library_target" ] 996 _link_shared_library_visibility = [ ":$_lipo_shared_library_target" ]
1061 _link_shared_library_target = target_name + "_arch_shared_library" 997 _link_shared_library_target = target_name + "_arch_shared_library"
1062 998
1063 _arch_shared_library_dir = "$target_out_dir/$_link_shared_library_target" 999 _arch_shared_library_dir = "$target_out_dir/$_link_shared_library_target"
1064 _shared_library_dir = "$target_out_dir/$_lipo_shared_library_target" 1000 _shared_library_dir = "$target_out_dir/$_lipo_shared_library_target"
1065 } 1001 }
1066 1002
1067 shared_library(_link_shared_library_target) { 1003 shared_library(_link_shared_library_target) {
1068 forward_variables_from(invoker, 1004 forward_variables_from(invoker,
1069 "*", 1005 "*",
1070 [ 1006 [
1071 "assert_no_deps", 1007 "assert_no_deps",
1072 "bundle_deps", 1008 "bundle_deps",
1073 "code_signing_enabled",
1074 "data_deps", 1009 "data_deps",
1075 "info_plist", 1010 "info_plist",
1076 "info_plist_target", 1011 "info_plist_target",
1077 "output_name", 1012 "output_name",
1078 "visibility", 1013 "visibility",
1079 ]) 1014 ])
1080 visibility = _link_shared_library_visibility 1015 visibility = _link_shared_library_visibility
1081 output_name = _output_name 1016 output_name = _output_name
1082 output_prefix_override = true 1017 output_prefix_override = true
1083 output_extension = "" 1018 output_extension = ""
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 outputs += [ outputs[0] + ".unstripped" ] 1092 outputs += [ outputs[0] + ".unstripped" ]
1158 args += [ "-Wcrl,unstripped," + 1093 args += [ "-Wcrl,unstripped," +
1159 rebase_path(get_path_info(outputs[0], "dir"), 1094 rebase_path(get_path_info(outputs[0], "dir"),
1160 root_build_dir) ] 1095 root_build_dir) ]
1161 } 1096 }
1162 } 1097 }
1163 } 1098 }
1164 } 1099 }
1165 } 1100 }
1166 1101
1167 if (!_code_signing_enabled) {
1168 bundle_data(_shared_library_bundle_data) {
1169 visibility = [ ":$_framework_target" ]
1170 forward_variables_from(invoker, [ "testonly" ])
1171 sources = [
1172 "$_shared_library_dir/$_output_name",
1173 ]
1174 outputs = [
1175 "{{bundle_executable_dir}}/$_output_name",
1176 ]
1177 if (_is_fat_build) {
1178 public_deps = [
1179 ":$_lipo_shared_library_target",
1180 ]
1181 } else {
1182 public_deps = [
1183 ":$_link_shared_library_target",
1184 ]
1185 }
1186 }
1187 }
1188
1189 _framework_public_config = _target_name + "_public_config" 1102 _framework_public_config = _target_name + "_public_config"
1190 config(_framework_public_config) { 1103 config(_framework_public_config) {
1191 # TODO(sdefresne): should we have a framework_dirs similar to lib_dirs 1104 # TODO(sdefresne): should we have a framework_dirs similar to lib_dirs
1192 # and include_dirs to avoid duplicate values on the command-line. 1105 # and include_dirs to avoid duplicate values on the command-line.
1193 visibility = [ ":$_framework_target" ] 1106 visibility = [ ":$_framework_target" ]
1194 ldflags = [ 1107 ldflags = [
1195 "-F", 1108 "-F",
1196 rebase_path("$root_out_dir/.", root_build_dir), 1109 rebase_path("$root_out_dir/.", root_build_dir),
1197 ] 1110 ]
1198 lib_dirs = [ root_out_dir ] 1111 lib_dirs = [ root_out_dir ]
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 } 1161 }
1249 deps += [ ":$_info_plist_bundle" ] 1162 deps += [ ":$_info_plist_bundle" ]
1250 1163
1251 if (defined(invoker.bundle_deps)) { 1164 if (defined(invoker.bundle_deps)) {
1252 if (!defined(deps)) { 1165 if (!defined(deps)) {
1253 deps = [] 1166 deps = []
1254 } 1167 }
1255 deps += invoker.bundle_deps 1168 deps += invoker.bundle_deps
1256 } 1169 }
1257 1170
1258 if (!_code_signing_enabled) {
1259 if (!defined(public_deps)) {
1260 public_deps = []
1261 }
1262 public_deps += [ ":$_shared_library_bundle_data" ]
1263 }
1264
1265 bundle_root_dir = _framework_root_dir 1171 bundle_root_dir = _framework_root_dir
1266 bundle_resources_dir = "$bundle_root_dir/Resources" 1172 bundle_resources_dir = "$bundle_root_dir/Resources"
1267 bundle_executable_dir = "$bundle_root_dir" 1173 bundle_executable_dir = "$bundle_root_dir"
1268 1174
1269 if (_code_signing_enabled) { 1175 if (!defined(deps)) {
1270 if (!defined(deps)) { 1176 deps = []
1271 deps = [] 1177 }
1272 }
1273 1178
1274 if (_is_fat_build) { 1179 if (_is_fat_build) {
1275 deps += [ ":$_lipo_shared_library_target" ] 1180 deps += [ ":$_lipo_shared_library_target" ]
1276 } else { 1181 } else {
1277 deps += [ ":$_link_shared_library_target" ] 1182 deps += [ ":$_link_shared_library_target" ]
1278 } 1183 }
1279 1184
1280 _entitlements_path = _default_entitlements_path 1185 _entitlements_path = _default_entitlements_path
1281 if (defined(invoker.entitlements_path)) { 1186 if (defined(invoker.entitlements_path)) {
1282 _entitlements_path = invoker.entitlements_path 1187 _entitlements_path = invoker.entitlements_path
1283 } 1188 }
1284 1189
1285 code_signing_script = "//build/config/ios/codesign.py" 1190 code_signing_script = _code_signing_script_path
1286 code_signing_sources = [ 1191 code_signing_sources = [
1287 _entitlements_path, 1192 _entitlements_path,
1288 "$_shared_library_dir/$_output_name", 1193 "$_shared_library_dir/$_output_name",
1289 ] 1194 ]
1290 code_signing_outputs = [ 1195 code_signing_outputs = [ "$bundle_root_dir/$_output_name" ]
1291 "$bundle_root_dir/$_output_name", 1196 if (ios_enable_code_signing) {
1292 "$bundle_root_dir/_CodeSignature/CodeResources", 1197 code_signing_outputs +=
1293 ] 1198 [ "$bundle_root_dir/_CodeSignature/CodeResources" ]
1294 if (ios_code_signing_identity != "") { 1199 }
1295 code_signing_outputs += 1200 if (ios_code_signing_identity != "") {
1296 [ "$bundle_root_dir/embedded.mobileprovision" ] 1201 code_signing_outputs += [ "$bundle_root_dir/embedded.mobileprovision" ]
1297 } 1202 }
1298 code_signing_args = [ 1203 code_signing_args = [
1299 "code-sign-bundle", 1204 "code-sign-bundle",
1300 "-i=" + ios_code_signing_identity, 1205 "-i=" + ios_code_signing_identity,
1301 "-e=" + rebase_path(_entitlements_path, root_build_dir), 1206 "-e=" + rebase_path(_entitlements_path, root_build_dir),
1302 "-b=" + 1207 "-b=" +
1303 rebase_path("$_shared_library_dir/$_output_name", root_build_dir), 1208 rebase_path("$_shared_library_dir/$_output_name", root_build_dir),
1304 rebase_path(bundle_root_dir, root_build_dir), 1209 rebase_path(bundle_root_dir, root_build_dir),
1305 ] 1210 ]
1211 if (!ios_enable_code_signing) {
1212 code_signing_args += [ "--disable-code-signature" ]
1306 } 1213 }
1307 } 1214 }
1308 1215
1309 if (defined(_framework_version)) { 1216 if (defined(_framework_version)) {
1310 action(_target_name) { 1217 action(_target_name) {
1311 forward_variables_from(invoker, [ "testonly" ]) 1218 forward_variables_from(invoker, [ "testonly" ])
1312 1219
1313 if (defined(invoker.visibility)) { 1220 if (defined(invoker.visibility)) {
1314 visibility = invoker.visibility 1221 visibility = invoker.visibility
1315 visibility += [ ":$_target_name+link" ] 1222 visibility += [ ":$_target_name+link" ]
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 public_deps = [ 1323 public_deps = [
1417 ":$_xctest_info_plist_target", 1324 ":$_xctest_info_plist_target",
1418 ] 1325 ]
1419 sources = get_target_outputs(":$_xctest_info_plist_target") 1326 sources = get_target_outputs(":$_xctest_info_plist_target")
1420 outputs = [ 1327 outputs = [
1421 "{{bundle_root_dir}}/Info.plist", 1328 "{{bundle_root_dir}}/Info.plist",
1422 ] 1329 ]
1423 } 1330 }
1424 1331
1425 _xctest_loadable_module_target = _xctest_target + "_loadable_module" 1332 _xctest_loadable_module_target = _xctest_target + "_loadable_module"
1426 1333 _xctest_loadable_module_visibility = [ ":$_xctest_target" ]
1427 if (!ios_enable_code_signing) {
1428 _xctest_loadable_module_bundle =
1429 _xctest_target + "_loadable_module_bundle"
1430 _xctest_loadable_module_visibility =
1431 [ ":$_xctest_loadable_module_bundle" ]
1432 } else {
1433 _xctest_loadable_module_visibility = [ ":$_xctest_target" ]
1434 }
1435 1334
1436 if (_is_fat_build) { 1335 if (_is_fat_build) {
1437 _xctest_lipo_loadable_module_target = _xctest_loadable_module_target 1336 _xctest_lipo_loadable_module_target = _xctest_loadable_module_target
1438 _xctest_lipo_loadable_module_visibility = 1337 _xctest_lipo_loadable_module_visibility =
1439 _xctest_loadable_module_visibility 1338 _xctest_loadable_module_visibility
1440 1339
1441 _xctest_loadable_module_visibility = [] 1340 _xctest_loadable_module_visibility = []
1442 _xctest_loadable_module_visibility = 1341 _xctest_loadable_module_visibility =
1443 [ ":$_xctest_lipo_loadable_module_target" ] 1342 [ ":$_xctest_lipo_loadable_module_target" ]
1444 _xctest_loadable_module_target = _xctest_target + "_arch_loadable_module" 1343 _xctest_loadable_module_target = _xctest_target + "_arch_loadable_module"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 outputs += [ outputs[0] + ".unstripped" ] 1419 outputs += [ outputs[0] + ".unstripped" ]
1521 args += [ "-Wcrl,unstripped," + 1420 args += [ "-Wcrl,unstripped," +
1522 rebase_path(get_path_info(outputs[0], "dir"), 1421 rebase_path(get_path_info(outputs[0], "dir"),
1523 root_build_dir) ] 1422 root_build_dir) ]
1524 } 1423 }
1525 } 1424 }
1526 } 1425 }
1527 } 1426 }
1528 } 1427 }
1529 1428
1530 if (!ios_enable_code_signing) {
1531 bundle_data(_xctest_loadable_module_bundle) {
1532 visibility = [ ":$_xctest_target" ]
1533 if (_is_fat_build) {
1534 public_deps = [
1535 ":$_xctest_lipo_loadable_module_target",
1536 ]
1537 } else {
1538 public_deps = [
1539 ":$_xctest_loadable_module_target",
1540 ]
1541 }
1542 sources = [
1543 "$target_out_dir/$_xctest_output",
1544 ]
1545 outputs = [
1546 "{{bundle_root_dir}}/$_xctest_output",
1547 ]
1548 }
1549 }
1550
1551 _xctest_bundle = _xctest_target + "_bundle" 1429 _xctest_bundle = _xctest_target + "_bundle"
1552 1430
1553 create_bundle(_xctest_target) { 1431 create_bundle(_xctest_target) {
1554 visibility = [ ":$_xctest_bundle" ] 1432 visibility = [ ":$_xctest_bundle" ]
1555 product_type = "com.apple.product-type.bundle.unit-test" 1433 product_type = "com.apple.product-type.bundle.unit-test"
1556 deps = [ 1434 deps = [
1557 ":$_xctest_info_plist_bundle", 1435 ":$_xctest_info_plist_bundle",
1558 ] 1436 ]
1559 bundle_root_dir = "$root_out_dir/$_xctest_output.xctest" 1437 bundle_root_dir = "$root_out_dir/$_xctest_output.xctest"
1560 1438
1439 if (_is_fat_build) {
1440 deps += [ ":$_xctest_lipo_loadable_module_target" ]
1441 } else {
1442 deps += [ ":$_xctest_loadable_module_target" ]
1443 }
1444
1445 _entitlements_path = _default_entitlements_path
1446 if (defined(invoker.entitlements_path)) {
1447 _entitlements_path = invoker.entitlements_path
1448 }
1449
1450 code_signing_script = _code_signing_script_path
1451 code_signing_sources = [
1452 _entitlements_path,
1453 "$target_out_dir/$_xctest_output",
1454 ]
1455 code_signing_outputs = [ "$bundle_root_dir/$_xctest_output" ]
1456 if (ios_enable_code_signing) {
1457 code_signing_outputs +=
1458 [ "$bundle_root_dir/_CodeSignature/CodeResources" ]
1459 }
1460 if (ios_code_signing_identity != "") {
1461 code_signing_outputs += [ "$bundle_root_dir/embedded.mobileprovision" ]
1462 }
1463 code_signing_args = [
1464 "code-sign-bundle",
1465 "-i=" + ios_code_signing_identity,
1466 "-e=" + rebase_path(_entitlements_path, root_build_dir),
1467 "-b=" + rebase_path("$target_out_dir/$_xctest_output", root_build_dir),
1468 rebase_path(bundle_root_dir, root_build_dir),
1469 ]
1561 if (!ios_enable_code_signing) { 1470 if (!ios_enable_code_signing) {
1562 deps += [ ":$_xctest_loadable_module_bundle" ] 1471 code_signing_args += [ "--disable-code-signature" ]
1563 } else {
1564 if (_is_fat_build) {
1565 deps += [ ":$_xctest_lipo_loadable_module_target" ]
1566 } else {
1567 deps += [ ":$_xctest_loadable_module_target" ]
1568 }
1569
1570 _entitlements_path = _default_entitlements_path
1571 if (defined(invoker.entitlements_path)) {
1572 _entitlements_path = invoker.entitlements_path
1573 }
1574
1575 code_signing_script = "//build/config/ios/codesign.py"
1576 code_signing_sources = [
1577 _entitlements_path,
1578 "$target_out_dir/$_xctest_output",
1579 ]
1580 code_signing_outputs = [
1581 "$bundle_root_dir/$_xctest_output",
1582 "$bundle_root_dir/_CodeSignature/CodeResources",
1583 ]
1584 if (ios_code_signing_identity != "") {
1585 code_signing_outputs +=
1586 [ "$bundle_root_dir/embedded.mobileprovision" ]
1587 }
1588 code_signing_args = [
1589 "code-sign-bundle",
1590 "-i=" + ios_code_signing_identity,
1591 "-e=" + rebase_path(_entitlements_path, root_build_dir),
1592 "-b=" +
1593 rebase_path("$target_out_dir/$_xctest_output", root_build_dir),
1594 rebase_path(bundle_root_dir, root_build_dir),
1595 ]
1596 } 1472 }
1597 } 1473 }
1598 1474
1599 bundle_data(_xctest_bundle) { 1475 bundle_data(_xctest_bundle) {
1600 visibility = [ ":$_host_target" ] 1476 visibility = [ ":$_host_target" ]
1601 public_deps = [ 1477 public_deps = [
1602 ":$_xctest_target", 1478 ":$_xctest_target",
1603 ] 1479 ]
1604 sources = [ 1480 sources = [
1605 "$root_out_dir/$_xctest_output.xctest", 1481 "$root_out_dir/$_xctest_output.xctest",
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 "-rpath", 1524 "-rpath",
1649 "-Xlinker", 1525 "-Xlinker",
1650 "@loader_path/Frameworks", 1526 "@loader_path/Frameworks",
1651 ] 1527 ]
1652 } 1528 }
1653 } 1529 }
1654 1530
1655 set_defaults("ios_xctest_test") { 1531 set_defaults("ios_xctest_test") {
1656 configs = default_executable_configs 1532 configs = default_executable_configs
1657 } 1533 }
OLDNEW
« no previous file with comments | « build/config/ios/codesign.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698