| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Dart project authors. All rights reserved. | 2 # Copyright 2016 The Dart project 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 import argparse | 6 import argparse |
| 7 import os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import utils | 10 import utils |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 '-m', 'all', | 39 '-m', 'all', |
| 40 '-a', 'arm,arm64', | 40 '-a', 'arm,arm64', |
| 41 '--os', 'android', | 41 '--os', 'android', |
| 42 ] | 42 ] |
| 43 if options.verbose: | 43 if options.verbose: |
| 44 gn_command.append('-v') | 44 gn_command.append('-v') |
| 45 print ' '.join(gn_command) | 45 print ' '.join(gn_command) |
| 46 return Execute(gn_command) | 46 return Execute(gn_command) |
| 47 | 47 |
| 48 | 48 |
| 49 def RunCrossGn(options): |
| 50 if HOST_OS != 'linux': |
| 51 return 0 |
| 52 gn_command = [ |
| 53 'python', |
| 54 os.path.join(DART_ROOT, 'tools', 'gn.py'), |
| 55 '-m', 'all', |
| 56 '-a', 'arm,arm64', |
| 57 ] |
| 58 if options.verbose: |
| 59 gn_command.append('-v') |
| 60 print ' '.join(gn_command) |
| 61 return Execute(gn_command) |
| 62 |
| 63 |
| 49 def RunHostGn(options): | 64 def RunHostGn(options): |
| 50 gn_command = [ | 65 gn_command = [ |
| 51 'python', | 66 'python', |
| 52 os.path.join(DART_ROOT, 'tools', 'gn.py'), | 67 os.path.join(DART_ROOT, 'tools', 'gn.py'), |
| 53 '-m', 'all', | 68 '-m', 'all', |
| 54 '-a', 'all', | 69 '-a', 'all', |
| 55 ] | 70 ] |
| 56 if options.verbose: | 71 if options.verbose: |
| 57 gn_command.append('-v') | 72 gn_command.append('-v') |
| 58 print ' '.join(gn_command) | 73 print ' '.join(gn_command) |
| 59 return Execute(gn_command) | 74 return Execute(gn_command) |
| 60 | 75 |
| 61 | 76 |
| 62 def RunGn(options): | 77 def RunGn(options): |
| 63 status = RunHostGn(options) | 78 status = RunHostGn(options) |
| 64 if status != 0: | 79 if status != 0: |
| 65 return status | 80 return status |
| 81 status = RunCrossGn(options) |
| 82 if status != 0: |
| 83 return status |
| 66 return RunAndroidGn(options) | 84 return RunAndroidGn(options) |
| 67 | 85 |
| 68 | 86 |
| 69 def RunGyp(options): | 87 def RunGyp(options): |
| 70 gyp_command = [ | 88 gyp_command = [ |
| 71 'python', | 89 'python', |
| 72 os.path.join(DART_ROOT, 'tools', 'gyp_dart.py'), | 90 os.path.join(DART_ROOT, 'tools', 'gyp_dart.py'), |
| 73 ] | 91 ] |
| 74 if options.verbose: | 92 if options.verbose: |
| 75 print ' '.join(gyp_command) | 93 print ' '.join(gyp_command) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 return 0 | 125 return 0 |
| 108 options = ParseArgs(argv) | 126 options = ParseArgs(argv) |
| 109 if options.gn: | 127 if options.gn: |
| 110 return RunGn(options) | 128 return RunGn(options) |
| 111 else: | 129 else: |
| 112 return RunGyp(options) | 130 return RunGyp(options) |
| 113 | 131 |
| 114 | 132 |
| 115 if __name__ == '__main__': | 133 if __name__ == '__main__': |
| 116 sys.exit(main(sys.argv)) | 134 sys.exit(main(sys.argv)) |
| OLD | NEW |