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

Unified Diff: pylib/gyp/generator/xcode.py

Issue 51413002: Adds generator support for Xcode 5 xctest targets. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pylib/gyp/xcodeproj_file.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/xcode.py
diff --git a/pylib/gyp/generator/xcode.py b/pylib/gyp/generator/xcode.py
index 7e5f79f1704871eab663fd7c877ea838a3f8cab4..499308934baf0722e72046e0529d61859678baa4 100644
--- a/pylib/gyp/generator/xcode.py
+++ b/pylib/gyp/generator/xcode.py
@@ -73,6 +73,8 @@ generator_additional_non_configuration_keys = [
'mac_framework_headers',
'mac_framework_private_headers',
'xcode_create_dependents_test_runner',
+ 'xctest_bundle',
+ 'xctest_host',
]
# We want to let any rules apply to files that are resources also.
@@ -642,6 +644,7 @@ def GenerateOutput(target_list, target_dicts, data, params):
'static_library': 'com.apple.product-type.library.static',
'executable+bundle': 'com.apple.product-type.application',
'loadable_module+bundle': 'com.apple.product-type.bundle',
+ 'loadable_module+xctest': 'com.apple.product-type.bundle.unit-test',
'shared_library+bundle': 'com.apple.product-type.framework',
}
@@ -652,10 +655,17 @@ def GenerateOutput(target_list, target_dicts, data, params):
type = spec['type']
is_bundle = int(spec.get('mac_bundle', 0))
+ is_xctest = int(spec.get('xctest_bundle', 0))
if type != 'none':
type_bundle_key = type
if is_bundle:
type_bundle_key += '+bundle'
+ if is_xctest:
+ type_bundle_key += '+xctest'
Mark Mentovai 2013/10/30 16:40:27 This code snippet seems to say that loadable_modul
jonwall 2013/10/30 19:07:38 Done.
+ assert type == 'loadable_module', (
+ 'xctest_bundle targets must have type loadable_module (target %s)' %
+ target_name)
+
xctarget_type = gyp.xcodeproj_file.PBXNativeTarget
try:
target_properties['productType'] = _types[type_bundle_key]
@@ -668,6 +678,9 @@ def GenerateOutput(target_list, target_dicts, data, params):
assert not is_bundle, (
'mac_bundle targets cannot have type none (target "%s")' %
target_name)
+ assert not is_xctest, (
+ 'xctest_bundle targets cannot have type none (target "%s")' %
+ target_name)
target_product_name = spec.get('product_name')
if target_product_name is not None:
@@ -709,6 +722,20 @@ def GenerateOutput(target_list, target_dicts, data, params):
# by the generator during Finalize.
xct.support_target = support_xct
+ if is_xctest and 'xctest_host' in spec:
+ test_host = spec['xctest_host']
+ test_host_qualified_target = gyp.common.QualifiedTarget(
+ build_file, test_host, toolset)
+ assert test_host_qualified_target in spec['dependencies'], (
+ 'xctest_host (%s) must be listed as a dependency. (target %s)' %
Mark Mentovai 2013/10/30 16:40:27 Why? Can’t it be an indirect dependency?
jonwall 2013/10/30 19:07:38 It looks like spec['dependencies'] includes indire
Mark Mentovai 2013/10/30 19:57:31 jonwall wrote:
jonwall 2013/10/30 21:04:57 Yes.
+ (test_host, target_name))
+ test_host_target = target_dicts[test_host_qualified_target]
+ assert test_host_target['type'] == 'executable', (
+ 'xctest_host must have type executable (target %s)' % target_name)
+ # Prune any duplicated dependencies.
Mark Mentovai 2013/10/30 16:40:27 Why?
jonwall 2013/10/30 19:07:38 If you comment out this line, you'll see the test
Mark Mentovai 2013/10/30 19:57:31 This sounds like a generic problem with making any
jonwall 2013/10/30 21:04:57 Okay. It looks like I can get this to work by clon
+ spec['dependencies'] = [dep for dep in spec['dependencies']
+ if dep not in test_host_target['dependencies']]
+
prebuild_index = 0
# Add custom shell script phases for "actions" sections.
« no previous file with comments | « no previous file | pylib/gyp/xcodeproj_file.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698