diff options
Diffstat (limited to 'chromium/build/mac')
-rw-r--r-- | chromium/build/mac/OWNERS | 2 | ||||
-rwxr-xr-x | chromium/build/mac/find_sdk.py | 13 | ||||
-rwxr-xr-x | chromium/build/mac/should_use_hermetic_xcode.py | 15 | ||||
-rw-r--r-- | chromium/build/mac/tweak_info_plist.gni | 9 |
4 files changed, 27 insertions, 12 deletions
diff --git a/chromium/build/mac/OWNERS b/chromium/build/mac/OWNERS index a2d7cc837d7..163563f967d 100644 --- a/chromium/build/mac/OWNERS +++ b/chromium/build/mac/OWNERS @@ -1,4 +1,2 @@ mark@chromium.org rsesek@chromium.org - -# COMPONENT: Build diff --git a/chromium/build/mac/find_sdk.py b/chromium/build/mac/find_sdk.py index 78314e04dfe..58362bfa244 100755 --- a/chromium/build/mac/find_sdk.py +++ b/chromium/build/mac/find_sdk.py @@ -2,8 +2,7 @@ # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. - -"""Prints the lowest locally available SDK version greater than or equal to a +r"""Prints the lowest locally available SDK version greater than or equal to a given minimum sdk version to standard output. If --print_sdk_path is passed, then the script will also print the SDK path. @@ -11,8 +10,10 @@ If --print_bin_path is passed, then the script will also print the path to the toolchain bin dir. Usage: - python find_sdk.py [--print_sdk_path] \ - [--print_bin_path] 10.6 # Ignores SDKs < 10.6 + python find_sdk.py \ + [--print_sdk_path] \ + [--print_bin_path] \ + 10.6 # Ignores SDKs < 10.6 Sample Output: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk @@ -39,7 +40,7 @@ class SdkError(Exception): def parse_version(version_str): """'10.6' => [10, 6]""" - return map(int, re.findall(r'(\d+)', version_str)) + return [int(s) for s in re.findall(r'(\d+)', version_str)] def main(): @@ -72,7 +73,7 @@ def main(): raise SdkError('Install Xcode, launch it, accept the license ' + 'agreement, and run `sudo xcode-select -s /path/to/Xcode.app` ' + 'to continue.') - sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)] + sdks = [re.findall('^MacOSX(\d+\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)] sdks = [s[0] for s in sdks if s] # [['10.5'], ['10.6']] => ['10.5', '10.6'] sdks = [s for s in sdks # ['10.5', '10.6'] => ['10.6'] if parse_version(s) >= parse_version(min_sdk_version)] diff --git a/chromium/build/mac/should_use_hermetic_xcode.py b/chromium/build/mac/should_use_hermetic_xcode.py index 450c40383a1..a366eb8fabd 100755 --- a/chromium/build/mac/should_use_hermetic_xcode.py +++ b/chromium/build/mac/should_use_hermetic_xcode.py @@ -16,6 +16,7 @@ Usage: from __future__ import print_function +import argparse import os import sys @@ -31,12 +32,20 @@ def _IsCorpMachine(): def main(): + parser = argparse.ArgumentParser(description='Download hermetic Xcode.') + parser.add_argument('platform') + parser.add_argument('--xcode-version', + choices=('default', 'xcode_12_beta'), + default='default') + args = parser.parse_args() + force_toolchain = os.environ.get('FORCE_MAC_TOOLCHAIN') - if force_toolchain and sys.argv[1] == 'ios': + if force_toolchain and args.platform == 'ios': return "3" - allow_corp = sys.argv[1] == 'mac' and _IsCorpMachine() + allow_corp = args.platform == 'mac' and _IsCorpMachine() if force_toolchain or allow_corp: - if not mac_toolchain.PlatformMeetsHermeticXcodeRequirements(): + if not mac_toolchain.PlatformMeetsHermeticXcodeRequirements( + args.xcode_version): return "2" return "1" else: diff --git a/chromium/build/mac/tweak_info_plist.gni b/chromium/build/mac/tweak_info_plist.gni index 2a79b0d5e31..f1164c8746c 100644 --- a/chromium/build/mac/tweak_info_plist.gni +++ b/chromium/build/mac/tweak_info_plist.gni @@ -31,7 +31,11 @@ template("tweak_info_plist") { _deps = [ ":" + target_name + "_merge_plist" ] action(target_name + "_merge_plist") { - forward_variables_from(invoker, [ "testonly" ]) + forward_variables_from(invoker, + [ + "testonly", + "deps", + ]) script = "//build/config/mac/plist_util.py" sources = invoker.info_plists outputs = [ _source_name ] @@ -47,6 +51,9 @@ template("tweak_info_plist") { _source_name = invoker.info_plist _deps = [] + if (defined(invoker.deps)) { + _deps += invoker.deps + } } action(target_name) { |