| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 """Generates an Android Studio project from a GN target.""" | 6 """Generates an Android Studio project from a GN target.""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import codecs | 9 import codecs |
| 10 import glob | 10 import glob |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 help='Split projects by their gn deps rather than ' | 707 help='Split projects by their gn deps rather than ' |
| 708 'combining all the dependencies of each target') | 708 'combining all the dependencies of each target') |
| 709 args = parser.parse_args() | 709 args = parser.parse_args() |
| 710 if args.output_directory: | 710 if args.output_directory: |
| 711 constants.SetOutputDirectory(args.output_directory) | 711 constants.SetOutputDirectory(args.output_directory) |
| 712 constants.CheckOutputDirectory() | 712 constants.CheckOutputDirectory() |
| 713 output_dir = constants.GetOutDirectory() | 713 output_dir = constants.GetOutDirectory() |
| 714 devil_chromium.Initialize(output_directory=output_dir) | 714 devil_chromium.Initialize(output_directory=output_dir) |
| 715 run_tests_helper.SetLogLevel(args.verbose_count) | 715 run_tests_helper.SetLogLevel(args.verbose_count) |
| 716 | 716 |
| 717 if args.split_projects: | 717 if args.use_gradle_process_resources: |
| 718 assert not args.use_gradle_process_resources, ( | 718 assert args.split_projects, ( |
| 719 'Gradle resources does not work without --split-projects.') | 719 'Gradle resources does not work without --split-projects.') |
| 720 | 720 |
| 721 _gradle_output_dir = os.path.abspath( | 721 _gradle_output_dir = os.path.abspath( |
| 722 args.project_dir.replace('$CHROMIUM_OUTPUT_DIR', output_dir)) | 722 args.project_dir.replace('$CHROMIUM_OUTPUT_DIR', output_dir)) |
| 723 jinja_processor = jinja_template.JinjaProcessor(_FILE_DIR) | 723 jinja_processor = jinja_template.JinjaProcessor(_FILE_DIR) |
| 724 build_vars = _ReadPropertiesFile(os.path.join(output_dir, 'build_vars.txt')) | 724 build_vars = _ReadPropertiesFile(os.path.join(output_dir, 'build_vars.txt')) |
| 725 source_properties = _ReadPropertiesFile( | 725 source_properties = _ReadPropertiesFile( |
| 726 _RebasePath(os.path.join(build_vars['android_sdk_build_tools'], | 726 _RebasePath(os.path.join(build_vars['android_sdk_build_tools'], |
| 727 'source.properties'))) | 727 'source.properties'))) |
| 728 generator = _ProjectContextGenerator(_gradle_output_dir, build_vars, | 728 generator = _ProjectContextGenerator(_gradle_output_dir, build_vars, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 _ExtractZips(generator.project_dir, zip_tuples) | 812 _ExtractZips(generator.project_dir, zip_tuples) |
| 813 | 813 |
| 814 logging.warning('Project created!') | 814 logging.warning('Project created!') |
| 815 logging.warning('Generated projects work with Android Studio 2.3') | 815 logging.warning('Generated projects work with Android Studio 2.3') |
| 816 logging.warning('For more tips: https://chromium.googlesource.com/chromium' | 816 logging.warning('For more tips: https://chromium.googlesource.com/chromium' |
| 817 '/src.git/+/master/docs/android_studio.md') | 817 '/src.git/+/master/docs/android_studio.md') |
| 818 | 818 |
| 819 | 819 |
| 820 if __name__ == '__main__': | 820 if __name__ == '__main__': |
| 821 main() | 821 main() |
| OLD | NEW |