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

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

Issue 10909158: Add support for building targets directly from gyp. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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 errno 8 import errno
9 import os 9 import os
10 import sys 10 import sys
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 580
581 581
582 def EscapeXCodeArgument(s): 582 def EscapeXCodeArgument(s):
583 """We must escape the arguments that we give to XCode so that it knows not to 583 """We must escape the arguments that we give to XCode so that it knows not to
584 split on spaces and to respect backslash and quote literals.""" 584 split on spaces and to respect backslash and quote literals."""
585 s = s.replace('\\', '\\\\') 585 s = s.replace('\\', '\\\\')
586 s = s.replace('"', '\\"') 586 s = s.replace('"', '\\"')
587 return '"' + s + '"' 587 return '"' + s + '"'
588 588
589 589
590
591 def PerformBuild(data, configurations, params):
592 options = params['options']
593
594 for build_file, build_file_dict in data.iteritems():
595 (build_file_root, build_file_ext) = os.path.splitext(build_file)
596 if build_file_ext != '.gyp':
597 continue
598 xcodeproj_path = build_file_root + options.suffix + '.xcodeproj'
599 if options.generator_output:
600 xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path)
601
602 for config in configurations:
603 arguments = ['xcodebuild', '-project', xcodeproj_path]
604 arguments += ['-configuration', config]
605 print "Building [%s]: %s" % (config, arguments)
bradn 2012/09/18 00:22:39 single
Sam Clegg 2012/09/18 00:47:17 Done.
606 subprocess.check_call(arguments)
607
608
590 def GenerateOutput(target_list, target_dicts, data, params): 609 def GenerateOutput(target_list, target_dicts, data, params):
591 options = params['options'] 610 options = params['options']
592 generator_flags = params.get('generator_flags', {}) 611 generator_flags = params.get('generator_flags', {})
593 parallel_builds = generator_flags.get('xcode_parallel_builds', True) 612 parallel_builds = generator_flags.get('xcode_parallel_builds', True)
594 serialize_all_tests = \ 613 serialize_all_tests = \
595 generator_flags.get('xcode_serialize_all_test_runs', True) 614 generator_flags.get('xcode_serialize_all_test_runs', True)
596 project_version = generator_flags.get('xcode_project_version', None) 615 project_version = generator_flags.get('xcode_project_version', None)
597 skip_excluded_files = \ 616 skip_excluded_files = \
598 not generator_flags.get('xcode_list_excluded_files', True) 617 not generator_flags.get('xcode_list_excluded_files', True)
599 xcode_projects = {} 618 xcode_projects = {}
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 1221
1203 for build_file in build_files: 1222 for build_file in build_files:
1204 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) 1223 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests)
1205 1224
1206 for build_file in build_files: 1225 for build_file in build_files:
1207 xcode_projects[build_file].Finalize2(xcode_targets, 1226 xcode_projects[build_file].Finalize2(xcode_targets,
1208 xcode_target_to_target_dict) 1227 xcode_target_to_target_dict)
1209 1228
1210 for build_file in build_files: 1229 for build_file in build_files:
1211 xcode_projects[build_file].Write() 1230 xcode_projects[build_file].Write()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698