Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: talk/build/export_headers

Issue 1673503002: Update build_ios_libs.sh script to build new Objective-C API (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changes based on feedback Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « talk/build/build_ios_libs.sh ('k') | talk/build/merge_ios_libs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 exporting iOS header files."""
12
13 import errno
14 import optparse
15 import os
16 import re
17 import shutil
18 import sys
19
20
21 def ExportHeaders(include_base_dir):
22 """Exports iOS header files.
23
24 Creates an include directory and recreates the hierarchy for the header files
25 within the include directory.
26
27 Args:
28 include_base_dir: directory where the include directory should be created
29 """
30 header_dirs = ['webrtc/api/objc/', 'webrtc/base/objc/']
31 # Individual header files that should also be exported.
32 include_headers = []
33 # Individual header files that should not be exported.
34 exclude_headers = ['webrtc/api/objc/RTCNSGLVideoView.h']
hjon_webrtc 2016/02/10 21:41:15 Should avfoundationvideocapturer.h be excluded?
35
36 include_dir_name = 'include'
37 include_path = os.path.join(include_base_dir, include_dir_name)
38
39 script_path = sys.path[0]
40 webrtc_base_path = os.path.join(script_path, '../..')
41
42 for directory in header_dirs:
43 full_dir_path = os.path.join(webrtc_base_path, directory)
44 filenames = os.listdir(full_dir_path)
45 for filename in filenames:
46 if filename.endswith('.h') and not filename.endswith('+Private.h'):
47 include_headers.append(os.path.join(directory, filename))
48
49 for header in exclude_headers:
50 include_headers.remove(header)
51
52 for header_path in include_headers:
53 output_dir = os.path.join(include_path, os.path.dirname(header_path))
54 # Create hierarchy for the header file within the include directory.
55 try:
56 os.makedirs(output_dir)
57 except OSError as exc:
58 if exc.errno != errno.EEXIST:
59 raise exc
60 current_path = os.path.join(webrtc_base_path, header_path)
61 new_path = os.path.join(include_path, header_path)
62 shutil.copy(current_path, new_path)
63
64 def Main():
65 parser = optparse.OptionParser()
66 _, args = parser.parse_args()
67 if len(args) != 1:
68 parser.error('Error: Exactly 1 argument required.')
69 include_base_dir = args[0]
70 ExportHeaders(include_base_dir)
71
72 if __name__ == '__main__':
73 sys.exit(Main())
OLDNEW
« no previous file with comments | « talk/build/build_ios_libs.sh ('k') | talk/build/merge_ios_libs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698