| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can b | 2 # Use of this source code is governed by a BSD-style license that can b |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Enumerates the BoringSSL source in src/ and generates two gypi files: | 5 """Enumerates the BoringSSL source in src/ and generates two gypi files: |
| 6 boringssl.gypi and boringssl_tests.gypi.""" | 6 boringssl.gypi and boringssl_tests.gypi.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 with open('boringssl_tests.gypi', 'w+') as test_gypi: | 206 with open('boringssl_tests.gypi', 'w+') as test_gypi: |
| 207 test_gypi.write(FILE_HEADER + '{\n \'targets\': [\n') | 207 test_gypi.write(FILE_HEADER + '{\n \'targets\': [\n') |
| 208 | 208 |
| 209 test_names = [] | 209 test_names = [] |
| 210 for test in sorted(test_c_files): | 210 for test in sorted(test_c_files): |
| 211 test_name = 'boringssl_%s' % os.path.splitext(os.path.basename(test))[0] | 211 test_name = 'boringssl_%s' % os.path.splitext(os.path.basename(test))[0] |
| 212 test_gypi.write(""" { | 212 test_gypi.write(""" { |
| 213 'target_name': '%s', | 213 'target_name': '%s', |
| 214 'type': 'executable', | 214 'type': 'executable', |
| 215 'dependencies': [ | 215 'dependencies': [ |
| 216 'boringssl', | 216 'boringssl.gyp:boringssl', |
| 217 ], | 217 ], |
| 218 'sources': [ | 218 'sources': [ |
| 219 '%s', | 219 '%s', |
| 220 ], | 220 ], |
| 221 },\n""" % (test_name, test)) | 221 },\n""" % (test_name, test)) |
| 222 test_names.append(test_name) | 222 test_names.append(test_name) |
| 223 | 223 |
| 224 test_names.sort() | 224 test_names.sort() |
| 225 | 225 |
| 226 test_gypi.write(""" ], | 226 test_gypi.write(""" ], |
| 227 'variables': { | 227 'variables': { |
| 228 'boringssl_test_targets': [\n""") | 228 'boringssl_test_targets': [\n""") |
| 229 | 229 |
| 230 for test in test_names: | 230 for test in test_names: |
| 231 test_gypi.write(""" '%s',\n""" % test) | 231 test_gypi.write(""" '%s',\n""" % test) |
| 232 | 232 |
| 233 test_gypi.write(' ],\n }\n}\n') | 233 test_gypi.write(' ],\n }\n}\n') |
| 234 | 234 |
| 235 return 0 | 235 return 0 |
| 236 | 236 |
| 237 | 237 |
| 238 if __name__ == '__main__': | 238 if __name__ == '__main__': |
| 239 sys.exit(main()) | 239 sys.exit(main()) |
| OLD | NEW |