Commit 02033d53 authored by Misha Efimov's avatar Misha Efimov Committed by Commit Bot

[Cronet] Add ios_app_bundle_id_prefix gn arg to cr_cronet.py on iOS.

This is needed for proper dev signing of binaries executed on the device.
The alternative https://crrev.com/c/2232816 would use `setup-gn.py` script,
which is more invasive.

The default ios_app_bundle_id_prefix is "chromium.org" which is most
likely NOT going to work for anybody.

Pass the "bundle-id-prefix" argument with company-specific prefix value,
for example:

```
cr_cronet.py gn -i --bundle-id-prefix="com.google"
```

Bug: 1091876
Change-Id: Id8357be2eabf5fb51b9229694c5476cfbac1bf62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2241186Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Misha Efimov <mef@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781861}
parent 2c832efe
......@@ -99,13 +99,13 @@ def get_ninja_jobs_options():
def get_default_gn_args(target_os, is_release):
gn_args = 'target_os="' + target_os + '" enable_websockets=false '+ \
'disable_file_support=true disable_ftp_support=true '+ \
'disable_brotli_filter=false ' + \
'is_component_build=false ' + \
'use_crash_key_stubs=true ' + \
'ignore_elf32_limitations=true use_partition_alloc=false ' + \
'include_transport_security_state_preload_list=false ' + use_goma()
gn_args = 'target_os="' + target_os + ('" enable_websockets=false '
'disable_file_support=true disable_ftp_support=true '
'disable_brotli_filter=false '
'is_component_build=false '
'use_crash_key_stubs=true '
'ignore_elf32_limitations=true use_partition_alloc=false '
'include_transport_security_state_preload_list=false ') + use_goma()
if (is_release):
gn_args += 'is_debug=false is_official_build=true '
return gn_args
......@@ -116,14 +116,16 @@ def get_mobile_gn_args(target_os, is_release):
'use_platform_icu_alternatives=true '
def get_ios_gn_args(is_release, target_cpu):
def get_ios_gn_args(is_release, bundle_id_prefix, target_cpu):
print is_release, bundle_id_prefix, target_cpu
return get_mobile_gn_args('ios', is_release) + \
'is_cronet_build=true ' + \
'enable_remoting=false ' + \
'use_xcode_clang=false ' + \
'ios_deployment_target="9.0" ' + \
'enable_dsyms=true ' + \
'target_cpu="%s" ' % target_cpu
('is_cronet_build=true '
'enable_remoting=false '
'use_xcode_clang=false '
'ios_app_bundle_id_prefix="%s" '
'ios_deployment_target="9.0" '
'enable_dsyms=true '
'target_cpu="%s" ') % (bundle_id_prefix, target_cpu)
def get_mac_gn_args(is_release):
......@@ -133,6 +135,7 @@ def get_mac_gn_args(is_release):
def main():
is_ios = (sys.platform == 'darwin')
parser = argparse.ArgumentParser()
parser.add_argument('command',
choices=['gn',
......@@ -149,29 +152,34 @@ def main():
'build-debug'])
parser.add_argument('-d', '--out_dir', action='store',
help='name of the build directory')
parser.add_argument('-i', '--iphoneos', action='store_true',
help='build for physical iphone')
parser.add_argument('-x', '--x86', action='store_true',
help='build for Intel x86 architecture')
parser.add_argument('-r', '--release', action='store_true',
help='use release configuration')
parser.add_argument('-a', '--asan', action='store_true',
help='use address sanitizer')
if is_ios:
parser.add_argument('-i', '--iphoneos', action='store_true',
help='build for physical iphone')
parser.add_argument('-b', '--bundle-id-prefix', action='store',
dest='bundle_id_prefix', default='org.chromium',
help='configure bundle id prefix')
options, extra_options = parser.parse_known_args()
print options
print extra_options
is_ios = (sys.platform == 'darwin')
if is_ios:
test_target = 'cronet_test'
unit_target = 'cronet_unittests_ios'
gn_extra = ['--ide=xcode']
gn_extra = ['--ide=xcode', '--filters=//components/cronet/*']
if options.iphoneos:
gn_args = get_ios_gn_args(options.release, 'arm64')
gn_args = get_ios_gn_args(options.release, options.bundle_id_prefix,
'arm64')
out_dir_suffix = '-iphoneos'
else:
gn_args = get_ios_gn_args(options.release, 'x64')
gn_args = get_ios_gn_args(options.release, options.bundle_id_prefix,
'x64')
out_dir_suffix = '-iphonesimulator'
if options.asan:
gn_args += 'is_asan=true '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment