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

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

Issue 1416453003: Add support for Xcode LastUpgradeCheck project attributes, allowing (Closed) Base URL: https://chromium.googlesource.com/external/gyp@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 (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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 ninja_wrapper = params.get('flavor') == 'ninja' 583 ninja_wrapper = params.get('flavor') == 'ninja'
584 if ninja_wrapper: 584 if ninja_wrapper:
585 (target_list, target_dicts, data) = \ 585 (target_list, target_dicts, data) = \
586 gyp.xcode_ninja.CreateWrapper(target_list, target_dicts, data, params) 586 gyp.xcode_ninja.CreateWrapper(target_list, target_dicts, data, params)
587 587
588 options = params['options'] 588 options = params['options']
589 generator_flags = params.get('generator_flags', {}) 589 generator_flags = params.get('generator_flags', {})
590 parallel_builds = generator_flags.get('xcode_parallel_builds', True) 590 parallel_builds = generator_flags.get('xcode_parallel_builds', True)
591 serialize_all_tests = \ 591 serialize_all_tests = \
592 generator_flags.get('xcode_serialize_all_test_runs', True) 592 generator_flags.get('xcode_serialize_all_test_runs', True)
593 project_version = generator_flags.get('xcode_project_version', None)
594 upgrade_check_project_version = \
Mark Mentovai 2015/10/21 00:34:25 = int(generator_flags.get(…)) to make sure that i
aharper 2015/10/21 00:39:19 So the int conversion actually happens in gyp/__in
595 generator_flags.get('xcode_upgrade_check_project_version', None)
596
597 # Format upgrade_check_project_version with leading zeros as needed.
598 if upgrade_check_project_version:
599 upgrade_check_project_version = str(upgrade_check_project_version)
600 while len(upgrade_check_project_version) < 4:
601 upgrade_check_project_version = '0' + upgrade_check_project_version
602
593 skip_excluded_files = \ 603 skip_excluded_files = \
594 not generator_flags.get('xcode_list_excluded_files', True) 604 not generator_flags.get('xcode_list_excluded_files', True)
595 xcode_projects = {} 605 xcode_projects = {}
596 for build_file, build_file_dict in data.iteritems(): 606 for build_file, build_file_dict in data.iteritems():
597 (build_file_root, build_file_ext) = os.path.splitext(build_file) 607 (build_file_root, build_file_ext) = os.path.splitext(build_file)
598 if build_file_ext != '.gyp': 608 if build_file_ext != '.gyp':
599 continue 609 continue
600 xcodeproj_path = build_file_root + options.suffix + '.xcodeproj' 610 xcodeproj_path = build_file_root + options.suffix + '.xcodeproj'
601 if options.generator_output: 611 if options.generator_output:
602 xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) 612 xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path)
603 xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict) 613 xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict)
604 xcode_projects[build_file] = xcp 614 xcode_projects[build_file] = xcp
605 pbxp = xcp.project 615 pbxp = xcp.project
606 616
617 # Set project-level attributes from multiple options
618 project_attributes = {};
607 if parallel_builds: 619 if parallel_builds:
608 pbxp.SetProperty('attributes', 620 project_attributes['BuildIndependentTargetsInParallel'] = 'YES'
609 {'BuildIndependentTargetsInParallel': 'YES'}) 621 if upgrade_check_project_version:
622 project_attributes['LastUpgradeCheck'] = upgrade_check_project_version
623 project_attributes['LastTestingUpgradeCheck'] = \
624 upgrade_check_project_version
625 pbxp.SetProperty('attributes', project_attributes)
626
627 if project_version:
628 xcp.project_file.SetXcodeVersion(project_version)
610 629
611 # Add gyp/gypi files to project 630 # Add gyp/gypi files to project
612 if not generator_flags.get('standalone'): 631 if not generator_flags.get('standalone'):
613 main_group = pbxp.GetProperty('mainGroup') 632 main_group = pbxp.GetProperty('mainGroup')
614 build_group = gyp.xcodeproj_file.PBXGroup({'name': 'Build'}) 633 build_group = gyp.xcodeproj_file.PBXGroup({'name': 'Build'})
615 main_group.AppendChild(build_group) 634 main_group.AppendChild(build_group)
616 for included_file in build_file_dict['included_files']: 635 for included_file in build_file_dict['included_files']:
617 build_group.AddOrGetFileByPath(included_file, False) 636 build_group.AddOrGetFileByPath(included_file, False)
618 637
619 xcode_targets = {} 638 xcode_targets = {}
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 1268
1250 for build_file in build_files: 1269 for build_file in build_files:
1251 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) 1270 xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests)
1252 1271
1253 for build_file in build_files: 1272 for build_file in build_files:
1254 xcode_projects[build_file].Finalize2(xcode_targets, 1273 xcode_projects[build_file].Finalize2(xcode_targets,
1255 xcode_target_to_target_dict) 1274 xcode_target_to_target_dict)
1256 1275
1257 for build_file in build_files: 1276 for build_file in build_files:
1258 xcode_projects[build_file].Write() 1277 xcode_projects[build_file].Write()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698