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

Side by Side Diff: pylib/gyp/generator/xcode.py

Issue 762673002: Add support for iOS WatchKit apps in GYP (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Specify code sign identity in extension test Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pylib/gyp/xcode_emulation.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 Google Inc. All rights reserved. 1 # Copyright (c) 2012 Google Inc. 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 filecmp 5 import filecmp
6 import gyp.common 6 import gyp.common
7 import gyp.xcodeproj_file 7 import gyp.xcodeproj_file
8 import gyp.xcode_ninja 8 import gyp.xcode_ninja
9 import errno 9 import errno
10 import os 10 import os
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 'mac_bundle_resources', 63 'mac_bundle_resources',
64 'mac_framework_headers', 64 'mac_framework_headers',
65 'mac_framework_private_headers', 65 'mac_framework_private_headers',
66 # 'mac_framework_dirs', input already handles _dirs endings. 66 # 'mac_framework_dirs', input already handles _dirs endings.
67 ] 67 ]
68 68
69 # The Xcode-specific keys that exist on targets and aren't moved down to 69 # The Xcode-specific keys that exist on targets and aren't moved down to
70 # configurations. 70 # configurations.
71 generator_additional_non_configuration_keys = [ 71 generator_additional_non_configuration_keys = [
72 'ios_app_extension', 72 'ios_app_extension',
73 'ios_watch_app',
74 'ios_watchkit_extension',
73 'mac_bundle', 75 'mac_bundle',
74 'mac_bundle_resources', 76 'mac_bundle_resources',
75 'mac_framework_headers', 77 'mac_framework_headers',
76 'mac_framework_private_headers', 78 'mac_framework_private_headers',
77 'mac_xctest_bundle', 79 'mac_xctest_bundle',
78 'xcode_create_dependents_test_runner', 80 'xcode_create_dependents_test_runner',
79 ] 81 ]
80 82
81 # We want to let any rules apply to files that are resources also. 83 # We want to let any rules apply to files that are resources also.
82 generator_extra_sources_for_rules = [ 84 generator_extra_sources_for_rules = [
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 _types = { 649 _types = {
648 'executable': 'com.apple.product-type.tool', 650 'executable': 'com.apple.product-type.tool',
649 'loadable_module': 'com.googlecode.gyp.xcode.bundle', 651 'loadable_module': 'com.googlecode.gyp.xcode.bundle',
650 'shared_library': 'com.apple.product-type.library.dynamic', 652 'shared_library': 'com.apple.product-type.library.dynamic',
651 'static_library': 'com.apple.product-type.library.static', 653 'static_library': 'com.apple.product-type.library.static',
652 'executable+bundle': 'com.apple.product-type.application', 654 'executable+bundle': 'com.apple.product-type.application',
653 'loadable_module+bundle': 'com.apple.product-type.bundle', 655 'loadable_module+bundle': 'com.apple.product-type.bundle',
654 'loadable_module+xctest': 'com.apple.product-type.bundle.unit-test', 656 'loadable_module+xctest': 'com.apple.product-type.bundle.unit-test',
655 'shared_library+bundle': 'com.apple.product-type.framework', 657 'shared_library+bundle': 'com.apple.product-type.framework',
656 'executable+extension+bundle': 'com.apple.product-type.app-extension', 658 'executable+extension+bundle': 'com.apple.product-type.app-extension',
659 'executable+watch+extension+bundle':
660 'com.apple.product-type.watchkit-extension',
661 'executable+watch+bundle': 'com.apple.product-type.application.watchapp',
657 } 662 }
658 663
659 target_properties = { 664 target_properties = {
660 'buildConfigurationList': xccl, 665 'buildConfigurationList': xccl,
661 'name': target_name, 666 'name': target_name,
662 } 667 }
663 668
664 type = spec['type'] 669 type = spec['type']
665 is_xctest = int(spec.get('mac_xctest_bundle', 0)) 670 is_xctest = int(spec.get('mac_xctest_bundle', 0))
666 is_bundle = int(spec.get('mac_bundle', 0)) or is_xctest 671 is_bundle = int(spec.get('mac_bundle', 0)) or is_xctest
667 is_extension = int(spec.get('ios_app_extension', 0)) 672 is_app_extension = int(spec.get('ios_app_extension', 0))
673 is_watchkit_extension = int(spec.get('ios_watchkit_extension', 0))
674 is_watch_app = int(spec.get('ios_watch_app', 0))
668 if type != 'none': 675 if type != 'none':
669 type_bundle_key = type 676 type_bundle_key = type
670 if is_xctest: 677 if is_xctest:
671 type_bundle_key += '+xctest' 678 type_bundle_key += '+xctest'
672 assert type == 'loadable_module', ( 679 assert type == 'loadable_module', (
673 'mac_xctest_bundle targets must have type loadable_module ' 680 'mac_xctest_bundle targets must have type loadable_module '
674 '(target %s)' % target_name) 681 '(target %s)' % target_name)
675 elif is_extension: 682 elif is_app_extension:
676 assert is_bundle, ('ios_app_extension flag requires mac_bundle ' 683 assert is_bundle, ('ios_app_extension flag requires mac_bundle '
677 '(target %s)' % target_name) 684 '(target %s)' % target_name)
678 type_bundle_key += '+extension+bundle' 685 type_bundle_key += '+extension+bundle'
686 elif is_watchkit_extension:
687 assert is_bundle, ('ios_watchkit_extension flag requires mac_bundle '
688 '(target %s)' % target_name)
689 type_bundle_key += '+watch+extension+bundle'
690 elif is_watch_app:
691 assert is_bundle, ('ios_watch_app flag requires mac_bundle '
692 '(target %s)' % target_name)
693 type_bundle_key += '+watch+bundle'
679 elif is_bundle: 694 elif is_bundle:
680 type_bundle_key += '+bundle' 695 type_bundle_key += '+bundle'
681 696
682 xctarget_type = gyp.xcodeproj_file.PBXNativeTarget 697 xctarget_type = gyp.xcodeproj_file.PBXNativeTarget
683 try: 698 try:
684 target_properties['productType'] = _types[type_bundle_key] 699 target_properties['productType'] = _types[type_bundle_key]
685 except KeyError, e: 700 except KeyError, e:
686 gyp.common.ExceptionAppend(e, "-- unknown product type while " 701 gyp.common.ExceptionAppend(e, "-- unknown product type while "
687 "writing target %s" % target_name) 702 "writing target %s" % target_name)
688 raise 703 raise
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 1249
1235 for build_file in build_files: 1250 for build_file in build_files:
1236 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) 1251 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests)
1237 1252
1238 for build_file in build_files: 1253 for build_file in build_files:
1239 xcode_projects[build_file].Finalize2(xcode_targets, 1254 xcode_projects[build_file].Finalize2(xcode_targets,
1240 xcode_target_to_target_dict) 1255 xcode_target_to_target_dict)
1241 1256
1242 for build_file in build_files: 1257 for build_file in build_files:
1243 xcode_projects[build_file].Write() 1258 xcode_projects[build_file].Write()
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/xcode_emulation.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698