OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """ | 6 """ |
7 package_ios.py - Build and Package Release and Rebug fat libraries for iOS. | 7 package_ios.py - Build and Package Release and Rebug fat libraries for iOS. |
8 """ | 8 """ |
9 | 9 |
10 import argparse | 10 import argparse |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 return gn_result | 110 return gn_result |
111 | 111 |
112 print 'Building ' + build_dir | 112 print 'Building ' + build_dir |
113 build_result = run('ninja -C %s cronet_package' % build_dir, | 113 build_result = run('ninja -C %s cronet_package' % build_dir, |
114 extra_options) | 114 extra_options) |
115 if build_result != 0: | 115 if build_result != 0: |
116 return build_result | 116 return build_result |
117 | 117 |
118 # Copy framework. | 118 # Copy framework. |
119 shutil.copytree(os.path.join(build_dir, 'Cronet.framework'), | 119 shutil.copytree(os.path.join(build_dir, 'Cronet.framework'), |
120 os.path.join(out_dir, 'Dynamic', target_dir, 'Cronet.framework')) | 120 os.path.join(out_dir, target_dir, 'Cronet.framework')) |
121 # Copy symbols. | 121 # Copy symbols. |
122 shutil.copytree(os.path.join(build_dir, 'Cronet.dSYM'), | 122 shutil.copytree(os.path.join(build_dir, 'Cronet.dSYM'), |
123 os.path.join(out_dir, 'Dynamic', target_dir, 'Cronet.framework.dSYM')) | 123 os.path.join(out_dir, target_dir, 'Cronet.framework.dSYM')) |
124 # Copy static framework. | |
125 shutil.copytree(os.path.join(build_dir, 'Static', 'Cronet.framework'), | |
126 os.path.join(out_dir, 'Static', target_dir, 'Cronet.framework')) | |
127 | 124 |
128 # Copy common files from last built package. | 125 # Copy common files from last built package. |
129 package_dir = os.path.join(build_dir, 'cronet') | 126 package_dir = os.path.join(build_dir, 'cronet') |
130 shutil.copy2(os.path.join(package_dir, 'AUTHORS'), out_dir) | 127 shutil.copy2(os.path.join(package_dir, 'AUTHORS'), out_dir) |
131 shutil.copy2(os.path.join(package_dir, 'LICENSE'), out_dir) | 128 shutil.copy2(os.path.join(package_dir, 'LICENSE'), out_dir) |
132 shutil.copy2(os.path.join(package_dir, 'VERSION'), out_dir) | 129 shutil.copy2(os.path.join(package_dir, 'VERSION'), out_dir) |
133 # Copy the headers. | 130 # Copy the headers. |
134 shutil.copytree(os.path.join(build_dir, | 131 shutil.copytree(os.path.join(build_dir, |
135 'Cronet.framework', 'Headers'), | 132 'Cronet.framework', 'Headers'), |
136 os.path.join(out_dir, 'Headers')) | 133 os.path.join(out_dir, 'Headers')) |
137 print 'Cronet framework is packaged into %s' % out_dir | 134 print 'Cronet dynamic framework is packaged into %s' % out_dir |
138 | 135 |
139 | 136 |
140 def main(): | 137 def main(): |
141 description = ( | 138 description = ( |
142 '1. To build Cronet.framework call:\n' | 139 '1. To build Cronet.framework call:\n' |
143 'package_ios.py --framework out/Frameworks\n' | 140 'package_ios.py --framework out/Frameworks\n' |
144 '2. To build CrNet.framework call:\n' | 141 '2. To build CrNet.framework call:\n' |
145 'package_ios.py --crnet out/crnet\n' | 142 'package_ios.py --crnet out/crnet\n' |
146 ) | 143 ) |
147 parser = argparse.ArgumentParser(description=description) | 144 parser = argparse.ArgumentParser(description=description) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 190 |
194 if options.gn: | 191 if options.gn: |
195 return package_ios_framework_using_gn(out_dir, extra_options_list) | 192 return package_ios_framework_using_gn(out_dir, extra_options_list) |
196 | 193 |
197 return package_ios(out_dir, "out/Release", "opt") or \ | 194 return package_ios(out_dir, "out/Release", "opt") or \ |
198 package_ios(out_dir, "out/Debug", "dbg") | 195 package_ios(out_dir, "out/Debug", "dbg") |
199 | 196 |
200 | 197 |
201 if __name__ == '__main__': | 198 if __name__ == '__main__': |
202 sys.exit(main()) | 199 sys.exit(main()) |
OLD | NEW |