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, target_dir, 'Cronet.framework')) | 120 os.path.join(out_dir, 'Dynamic', 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, target_dir, 'Cronet.framework.dSYM')) | 123 os.path.join(out_dir, 'Dynamic', 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')) |
124 | 127 |
125 # Copy common files from last built package. | 128 # Copy common files from last built package. |
126 package_dir = os.path.join(build_dir, 'cronet') | 129 package_dir = os.path.join(build_dir, 'cronet') |
127 shutil.copy2(os.path.join(package_dir, 'AUTHORS'), out_dir) | 130 shutil.copy2(os.path.join(package_dir, 'AUTHORS'), out_dir) |
128 shutil.copy2(os.path.join(package_dir, 'LICENSE'), out_dir) | 131 shutil.copy2(os.path.join(package_dir, 'LICENSE'), out_dir) |
129 shutil.copy2(os.path.join(package_dir, 'VERSION'), out_dir) | 132 shutil.copy2(os.path.join(package_dir, 'VERSION'), out_dir) |
130 # Copy the headers. | 133 # Copy the headers. |
131 shutil.copytree(os.path.join(build_dir, | 134 shutil.copytree(os.path.join(build_dir, |
132 'Cronet.framework', 'Headers'), | 135 'Cronet.framework', 'Headers'), |
133 os.path.join(out_dir, 'Headers')) | 136 os.path.join(out_dir, 'Headers')) |
134 print 'Cronet dynamic framework is packaged into %s' % out_dir | 137 print 'Cronet framework is packaged into %s' % out_dir |
135 | 138 |
136 | 139 |
137 def main(): | 140 def main(): |
138 description = ( | 141 description = ( |
139 '1. To build Cronet.framework call:\n' | 142 '1. To build Cronet.framework call:\n' |
140 'package_ios.py --framework out/Frameworks\n' | 143 'package_ios.py --framework out/Frameworks\n' |
141 '2. To build CrNet.framework call:\n' | 144 '2. To build CrNet.framework call:\n' |
142 'package_ios.py --crnet out/crnet\n' | 145 'package_ios.py --crnet out/crnet\n' |
143 ) | 146 ) |
144 parser = argparse.ArgumentParser(description=description) | 147 parser = argparse.ArgumentParser(description=description) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 193 |
191 if options.gn: | 194 if options.gn: |
192 return package_ios_framework_using_gn(out_dir, extra_options_list) | 195 return package_ios_framework_using_gn(out_dir, extra_options_list) |
193 | 196 |
194 return package_ios(out_dir, "out/Release", "opt") or \ | 197 return package_ios(out_dir, "out/Release", "opt") or \ |
195 package_ios(out_dir, "out/Debug", "dbg") | 198 package_ios(out_dir, "out/Debug", "dbg") |
196 | 199 |
197 | 200 |
198 if __name__ == '__main__': | 201 if __name__ == '__main__': |
199 sys.exit(main()) | 202 sys.exit(main()) |
OLD | NEW |