OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Extracts native methods from a Java file and generates the JNI bindings. | 6 """Extracts native methods from a Java file and generates the JNI bindings. |
7 If you change this, please run and update the tests.""" | 7 If you change this, please run and update the tests.""" |
8 | 8 |
9 import collections | 9 import collections |
10 import errno | 10 import errno |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 option_parser.print_help() | 1372 option_parser.print_help() |
1373 print '\nError: Must specify --jar_file or --input_file.' | 1373 print '\nError: Must specify --jar_file or --input_file.' |
1374 return 1 | 1374 return 1 |
1375 output_file = None | 1375 output_file = None |
1376 if options.output_dir: | 1376 if options.output_dir: |
1377 root_name = os.path.splitext(os.path.basename(input_file))[0] | 1377 root_name = os.path.splitext(os.path.basename(input_file))[0] |
1378 output_file = os.path.join(options.output_dir, root_name) + '_jni.h' | 1378 output_file = os.path.join(options.output_dir, root_name) + '_jni.h' |
1379 GenerateJNIHeader(input_file, output_file, options) | 1379 GenerateJNIHeader(input_file, output_file, options) |
1380 | 1380 |
1381 if options.depfile: | 1381 if options.depfile: |
1382 build_utils.WriteDepfile( | 1382 build_utils.WriteDepfile(options.depfile, output_file) |
1383 options.depfile, | |
1384 build_utils.GetPythonDependencies()) | |
1385 | 1383 |
1386 | 1384 |
1387 if __name__ == '__main__': | 1385 if __name__ == '__main__': |
1388 sys.exit(main(sys.argv)) | 1386 sys.exit(main(sys.argv)) |
OLD | NEW |