diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni index df6033b..7fdc931 100644 --- a/build/config/ios/rules.gni +++ b/build/config/ios/rules.gni @@ -1805,10 +1805,15 @@ # Xcode needs those two framework installed in the application (and signed) # for the XCTest to run, so install them using extra_system_frameworks. _ios_platform_library = "$ios_sdk_platform_path/Developer/Library" - extra_system_frameworks = [ - "$_ios_platform_library/Frameworks/XCTest.framework", - "$_ios_platform_library/PrivateFrameworks/IDEBundleInjection.framework", - ] + extra_system_frameworks = + [ "$_ios_platform_library/Frameworks/XCTest.framework" ] + + # TODO: Remove this once support for Xcode 9.x is dropped. + if (xcode_version_int < 1000) { + extra_system_frameworks += [ + "$_ios_platform_library/PrivateFrameworks/IDEBundleInjection.framework", + ] + } _xctest_bundle = _xctest_target + "_bundle" if (current_toolchain == default_toolchain) { diff --git a/build/config/mac/sdk_info.py b/build/config/mac/sdk_info.py index 8a9edc1..46dcec8 100644 --- a/build/config/mac/sdk_info.py +++ b/build/config/mac/sdk_info.py @@ -3,6 +3,8 @@ # found in the LICENSE file. import argparse +import doctest +import itertools import os import subprocess import sys @@ -10,16 +12,32 @@ # This script prints information about the build system, the operating # system and the iOS or Mac SDK (depending on the platform "iphonesimulator", # "iphoneos" or "macosx" generally). -# -# In the GYP build, this is done inside GYP itself based on the SDKROOT -# variable. + +def SplitVersion(version): + """Splits the Xcode version to 3 values. + + >>> list(SplitVersion('8.2.1.1')) + ['8', '2', '1'] + >>> list(SplitVersion('9.3')) + ['9', '3', '0'] + >>> list(SplitVersion('10.0')) + ['10', '0', '0'] + """ + version = version.split('.') + return itertools.islice(itertools.chain(version, itertools.repeat('0')), 0, 3) def FormatVersion(version): - """Converts Xcode version to a format required for Info.plist.""" - version = version.replace('.', '') - version = version + '0' * (3 - len(version)) - return version.zfill(4) + """Converts Xcode version to a format required for DTXcode in Info.plist + >>> FormatVersion('8.2.1') + '0821' + >>> FormatVersion('9.3') + '0930' + >>> FormatVersion('10.0') + '1000' + """ + major, minor, patch = SplitVersion(version) + return ('%2s%s%s' % (major, minor, patch)).replace(' ', '0') def FillXcodeVersion(settings): """Fills the Xcode version and build number into |settings|.""" @@ -53,6 +71,8 @@ if __name__ == '__main__': + doctest.testmod() + parser = argparse.ArgumentParser() parser.add_argument("--developer_dir", required=False) args, unknownargs = parser.parse_known_args()