Files
platform-external-webrtc/webrtc/build/ios/flatten_ios_headers.py
tkchin 5209d671f2 Fix WebRTC API framework build.
BUG=webrtc:5737

Review URL: https://codereview.webrtc.org/1875003004

Cr-Commit-Position: refs/heads/master@{#12391}
2016-04-16 19:06:40 +00:00

50 lines
1.5 KiB
Python
Executable File

#!/usr/bin/python
# Copyright 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
"""Script for flattening iOS header structure."""
import sys
import argparse
import os
import shutil
def FlattenHeaders(input_dir, output_dir):
"""Flattens iOS header file directory structure."""
# Create output directories.
if not os.path.exists(output_dir):
os.mkdir(output_dir)
for dirpath, _, filenames in os.walk(input_dir):
for filename in filenames:
current_path = os.path.join(dirpath, filename)
new_path = os.path.join(output_dir, filename)
shutil.copy(current_path, new_path)
def Main():
parser_description = 'Flatten WebRTC ObjC API headers.'
parser = argparse.ArgumentParser(description=parser_description)
parser.add_argument('input_dir',
help='Output directory to write headers to.',
type=str)
parser.add_argument('output_dir',
help='Input directory to read headers from.',
type=str)
args = parser.parse_args()
input_dir = args.input_dir
output_dir = args.output_dir
FlattenHeaders(input_dir, output_dir)
if __name__ == '__main__':
sys.exit(Main())