Chromium Code Reviews| Index: tools-webrtc/ios/build_ios_libs.py |
| diff --git a/tools-webrtc/ios/build_ios_libs.py b/tools-webrtc/ios/build_ios_libs.py |
| index 4e2585cc8a7e05b0ee0075aa794d2194fe61af07..da02972a5b9c0bb356b8ba211fc8bf62016ddb00 100755 |
| --- a/tools-webrtc/ios/build_ios_libs.py |
| +++ b/tools-webrtc/ios/build_ios_libs.py |
| @@ -50,6 +50,8 @@ def _ParseArgs(): |
| help='Architectures to build. Defaults to %(default)s.') |
| parser.add_argument('-c', '--clean', action='store_true', default=False, |
| help='Removes the previously generated build output, if any.') |
| + parser.add_argument('-p', '--clean-temp', action='store_true', default=False, |
| + help='Removes the temporary build files from the output directory.') |
|
kjellander_webrtc
2017/03/13 13:15:02
It's not clear to me that the script will exit aft
|
| parser.add_argument('-o', '--output-dir', default=SDK_OUTPUT_DIR, |
| help='Specifies a directory to output the build artifacts to. ' |
| 'If specified together with -c, deletes the dir.') |
| @@ -78,6 +80,15 @@ def _CleanArtifacts(output_dir): |
| shutil.rmtree(output_dir) |
| +def _CleanTemporary(output_dir, architectures): |
| + if os.path.isdir(output_dir): |
| + logging.info('Removing temporary build files.') |
| + for arch in architectures: |
| + arch_lib_path = os.path.join(output_dir, arch + '_libs') |
| + if os.path.isdir(arch_lib_path): |
| + shutil.rmtree(arch_lib_path) |
| + |
| + |
| def BuildWebRTC(output_dir, target_arch, flavor, build_type, |
| ios_deployment_target, libvpx_build_vp9, use_bitcode, |
| use_goma, extra_gn_args): |
| @@ -146,6 +157,11 @@ def main(): |
| return 0 |
| architectures = list(args.arch) |
| + |
| + if args.clean_temp: |
| + _CleanTemporary(args.output_dir, architectures) |
| + return 0 |
| + |
| # Ignoring x86 except for static libraries for now because of a GN build issue |
| # where the generated dynamic framework has the wrong architectures. |
| if 'x86' in architectures and args.build_type != 'static_only': |
| @@ -219,6 +235,7 @@ def main(): |
| _RunCommand(cmd) |
| _RunCommand(['plutil', '-convert', 'binary1', infoplist_path]) |
| + |
|
kjellander_webrtc
2017/03/13 13:15:02
nit: Remove this blank line.
|
| logging.info('Done.') |
| return 0 |