Updates shared apple toolchain scripts to support watchOS.
Bug: 331320406 Change-Id: I67872bb0e2eda39c3eebb5d1f3e718aad9ecd461 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6012318 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Rohit Rao <rohitrao@chromium.org> Cr-Commit-Position: refs/heads/main@{#1381471}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
84b3dc8857
commit
6665bedc2c
build
@ -307,7 +307,7 @@ def Main(argv):
|
||||
default=None,
|
||||
help='The bundle id of the binary')
|
||||
parser.add_option('--platform',
|
||||
choices=('ios', 'mac'),
|
||||
choices=('ios', 'mac', 'watchos'),
|
||||
default='mac',
|
||||
help='The target platform of the bundle')
|
||||
parser.add_option('--add-gtm-metadata',
|
||||
|
@ -89,12 +89,14 @@ class Bundle(object):
|
||||
|
||||
@staticmethod
|
||||
def Kind(platform, extension):
|
||||
if platform == 'iphonesimulator' or platform == 'iphoneos':
|
||||
if platform in ('iphoneos', 'iphonesimulator'):
|
||||
return 'ios'
|
||||
if platform == 'macosx':
|
||||
if extension == '.framework':
|
||||
return 'mac_framework'
|
||||
return 'mac'
|
||||
if platform in ('watchos', 'watchsimulator'):
|
||||
return 'watchos'
|
||||
raise ValueError('unknown bundle type %s for %s' % (extension, platform))
|
||||
|
||||
@property
|
||||
@ -568,7 +570,7 @@ class CodeSignBundleAction(Action):
|
||||
provisioning_profile = FindProvisioningProfile(
|
||||
args.mobileprovision_files, bundle.identifier,
|
||||
provisioning_profile_required)
|
||||
if provisioning_profile and args.platform != 'iphonesimulator':
|
||||
if provisioning_profile and not args.platform.endswith('simulator'):
|
||||
provisioning_profile.Install(embedded_provisioning_profile)
|
||||
|
||||
if args.entitlements_path is not None:
|
||||
|
@ -134,7 +134,10 @@ def main():
|
||||
default='.',
|
||||
help='Value of gn $root_build_dir')
|
||||
parser.add_argument('platform',
|
||||
choices=['iphoneos', 'iphonesimulator', 'macosx'])
|
||||
choices=[
|
||||
'iphoneos', 'iphonesimulator', 'macosx', 'watchos',
|
||||
'watchsimulator'
|
||||
])
|
||||
args = parser.parse_args()
|
||||
if args.developer_dir:
|
||||
os.environ['DEVELOPER_DIR'] = args.developer_dir
|
||||
|
@ -167,6 +167,28 @@ def CompileAssetCatalog(output, platform, target_environment, product_type,
|
||||
'--ui-framework-family',
|
||||
'uikit',
|
||||
])
|
||||
else:
|
||||
sys.stderr.write('Unsupported ios environment: %s' % target_environment)
|
||||
sys.exit(1)
|
||||
elif platform == 'watchos':
|
||||
if target_environment == 'simulator':
|
||||
command.extend([
|
||||
'--platform',
|
||||
'watchsimulator',
|
||||
'--target-device',
|
||||
'watch',
|
||||
])
|
||||
elif target_environment == 'device':
|
||||
command.extend([
|
||||
'--platform',
|
||||
'watchos',
|
||||
'--target-device',
|
||||
'watch',
|
||||
])
|
||||
else:
|
||||
sys.stderr.write(
|
||||
'Unsupported watchos environment: %s' % target_environment)
|
||||
sys.exit(1)
|
||||
|
||||
# Unzip any input zipfiles to a temporary directory.
|
||||
inputs = []
|
||||
@ -267,7 +289,7 @@ def Main():
|
||||
parser.add_argument('--platform',
|
||||
'-p',
|
||||
required=True,
|
||||
choices=('mac', 'ios'),
|
||||
choices=('mac', 'ios', 'watchos'),
|
||||
help='target platform for the compiled assets catalog')
|
||||
parser.add_argument('--target-environment',
|
||||
'-e',
|
||||
|
Reference in New Issue
Block a user