OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/python |
| 2 |
| 3 # Copyright 2016 The WebRTC project authors. All Rights Reserved. |
| 4 # |
| 5 # Use of this source code is governed by a BSD-style license |
| 6 # that can be found in the LICENSE file in the root of the source |
| 7 # tree. An additional intellectual property rights grant can be found |
| 8 # in the file PATENTS. All contributing project authors may |
| 9 # be found in the AUTHORS file in the root of the source tree. |
| 10 |
| 11 """Script for flattening iOS header structure.""" |
| 12 |
| 13 import os |
| 14 import shutil |
| 15 import sys |
| 16 |
| 17 def FlattenHeaders(): |
| 18 """Flattens iOS header file directory structure.""" |
| 19 lib_base_dir = 'out_ios_libs' |
| 20 framework_base_dir = 'out_ios_framework' |
| 21 include_dir = 'include' |
| 22 unflattened_include_dir_path = os.path.join(lib_base_dir, include_dir) |
| 23 flattened_include_dir_path = os.path.join(framework_base_dir, include_dir) |
| 24 |
| 25 # Create output directories. |
| 26 if not os.path.exists(framework_base_dir): |
| 27 os.mkdir(framework_base_dir) |
| 28 if not os.path.exists(flattened_include_dir_path): |
| 29 os.mkdir(flattened_include_dir_path) |
| 30 |
| 31 for dirpath, _, filenames in os.walk(unflattened_include_dir_path): |
| 32 for filename in filenames: |
| 33 current_path = os.path.join(dirpath, filename) |
| 34 new_path = os.path.join(flattened_include_dir_path, filename) |
| 35 shutil.copy(current_path, new_path) |
| 36 |
| 37 def Main(): |
| 38 FlattenHeaders() |
| 39 |
| 40 if __name__ == '__main__': |
| 41 sys.exit(Main()) |
OLD | NEW |