Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright 2016 Google Inc. | 3 # Copyright 2016 Google Inc. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
| 7 | 7 |
| 8 | 8 |
| 9 """ | 9 """ |
| 10 Script to build the command buffer shared library and copy it to Skia tree | 10 Script to build the command buffer shared library and copy it to Skia tree |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 | 123 |
| 124 try: | 124 try: |
| 125 os.environ['GYP_GENERATORS'] = 'ninja' | 125 os.environ['GYP_GENERATORS'] = 'ninja' |
| 126 subprocess.check_call([gclient, 'sync', '--reset', '--force'], | 126 subprocess.check_call([gclient, 'sync', '--reset', '--force'], |
| 127 cwd=chrome_src_dir) | 127 cwd=chrome_src_dir) |
| 128 except subprocess.CalledProcessError as error: | 128 except subprocess.CalledProcessError as error: |
| 129 sys.exit('Error (ret code: %s) calling "%s" in %s' % (error.returncode, | 129 sys.exit('Error (ret code: %s) calling "%s" in %s' % (error.returncode, |
| 130 error.cmd, chrome_src_dir)) | 130 error.cmd, chrome_src_dir)) |
| 131 | 131 |
| 132 try: | 132 try: |
| 133 subprocess.check_call([gclient, 'runhooks'], cwd=chrome_src_dir) | |
| 134 except subprocess.CalledProcessError as error: | |
| 135 sys.exit('Error (ret code: %s) calling "%s" in %s' % ( | |
| 136 error.returncode, error.cmd, chrome_src_dir)) | |
| 137 | |
| 138 platform = 'linux64' | |
| 139 if sys.platform == 'darwin': | |
| 140 platform = 'mac' | |
| 141 elif sys.platform == 'win32': | |
| 142 platform = 'win' | |
| 143 gn = os.path.join(chrome_src_dir, 'buildtools', platform, 'gn') | |
|
jcgregorio
2016/08/02 14:47:49
Wouldn't that be gn.exe on Windows?
borenet
2016/08/02 15:11:56
Good catch. Fixed in https://codereview.chromium.o
| |
| 144 try: | |
| 145 subprocess.check_call([gn, 'gen', chrome_target_dir_rel], | |
| 146 cwd=chrome_src_dir) | |
| 147 except subprocess.CalledProcessError as error: | |
| 148 sys.exit('Error (ret code: %s) calling "%s" in %s' % ( | |
| 149 error.returncode, error.cmd, chrome_src_dir)) | |
| 150 | |
| 151 try: | |
| 133 subprocess.check_call(['ninja'] + shlex.split(args.extra_ninja_args) + | 152 subprocess.check_call(['ninja'] + shlex.split(args.extra_ninja_args) + |
| 134 ['-C', chrome_target_dir_rel, 'command_buffer_gles2'], | 153 ['-C', chrome_target_dir_rel, 'command_buffer_gles2'], |
| 135 cwd=chrome_src_dir) | 154 cwd=chrome_src_dir) |
| 136 except subprocess.CalledProcessError as error: | 155 except subprocess.CalledProcessError as error: |
| 137 sys.exit('Error (ret code: %s) calling "%s" in %s' % (error.returncode, | 156 sys.exit('Error (ret code: %s) calling "%s" in %s' % (error.returncode, |
| 138 error.cmd, chrome_src_dir)) | 157 error.cmd, chrome_src_dir)) |
| 139 | 158 |
| 140 shared_lib_src_dir = os.path.join(chrome_src_dir, chrome_target_dir_rel) | 159 shared_lib_src_dir = os.path.join(chrome_src_dir, chrome_target_dir_rel) |
| 141 shared_lib_dst_dir = os.path.join(args.output_dir, shared_lib_subdir) | 160 shared_lib_dst_dir = os.path.join(args.output_dir, shared_lib_subdir) |
| 142 # Make the subdir for the dst if does not exist | 161 # Make the subdir for the dst if does not exist |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 154 | 173 |
| 155 if not os.path.isfile(shared_lib_dst): | 174 if not os.path.isfile(shared_lib_dst): |
| 156 sys.exit('Command buffer library not copied to ' + shared_lib_dst) | 175 sys.exit('Command buffer library not copied to ' + shared_lib_dst) |
| 157 | 176 |
| 158 print('Command buffer library copied to ' + shared_lib_dst) | 177 print('Command buffer library copied to ' + shared_lib_dst) |
| 159 | 178 |
| 160 | 179 |
| 161 if __name__ == '__main__': | 180 if __name__ == '__main__': |
| 162 main() | 181 main() |
| 163 | 182 |
| OLD | NEW |