| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # This file is meant to be included into an action to invoke grit in a | 5 # This file is meant to be included into an action to invoke grit in a |
| 6 # consistent manner. To use this the following variables need to be | 6 # consistent manner. To use this the following variables need to be |
| 7 # defined: | 7 # defined: |
| 8 # grit_grd_file: string: grd file path | 8 # grit_grd_file: string: grd file path |
| 9 # grit_out_dir: string: the output directory path | 9 # grit_out_dir: string: the output directory path |
| 10 | 10 |
| 11 # It would be really nice to do this with a rule instead of actions, but it | 11 # It would be really nice to do this with a rule instead of actions, but it |
| 12 # would need to determine inputs and outputs via grit_info on a per-file | 12 # would need to determine inputs and outputs via grit_info on a per-file |
| 13 # basis. GYP rules don’t currently support that. They could be extended to | 13 # basis. GYP rules don’t currently support that. They could be extended to |
| 14 # do this, but then every generator would need to be updated to handle this. | 14 # do this, but then every generator would need to be updated to handle this. |
| 15 | 15 |
| 16 { | 16 { |
| 17 'variables': { | 17 'variables': { |
| 18 'grit_cmd': ['python', '<(DEPTH)/tools/grit/grit.py'], | 18 'grit_cmd': ['python', '<(DEPTH)/tools/grit/grit.py'], |
| 19 'grit_resource_ids%': '<(DEPTH)/tools/gritsettings/resource_ids', | 19 'grit_resource_ids%': '<(DEPTH)/tools/gritsettings/resource_ids', |
| 20 # This makes it possible to add more defines in specific targets, |
| 21 # instead of build/common.gypi . |
| 22 'grit_additional_defines%': [], |
| 20 }, | 23 }, |
| 21 'inputs': [ | 24 'inputs': [ |
| 22 '<!@pymod_do_main(grit_info <@(grit_defines) --inputs <(grit_grd_file) ' | 25 '<!@pymod_do_main(grit_info <@(grit_defines) <@(grit_additional_defines) ' |
| 23 '-f "<(grit_resource_ids)")', | 26 '--inputs <(grit_grd_file) -f "<(grit_resource_ids)")', |
| 24 ], | 27 ], |
| 25 'outputs': [ | 28 'outputs': [ |
| 26 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs \'<(grit_out_dir)\' ' | 29 '<!@pymod_do_main(grit_info <@(grit_defines) <@(grit_additional_defines) ' |
| 30 '--outputs \'<(grit_out_dir)\' ' |
| 27 '<(grit_grd_file) -f "<(grit_resource_ids)")', | 31 '<(grit_grd_file) -f "<(grit_resource_ids)")', |
| 28 ], | 32 ], |
| 29 'action': ['<@(grit_cmd)', | 33 'action': ['<@(grit_cmd)', |
| 30 '-i', '<(grit_grd_file)', 'build', | 34 '-i', '<(grit_grd_file)', 'build', |
| 31 '-f', '<(grit_resource_ids)', | 35 '-f', '<(grit_resource_ids)', |
| 32 '-o', '<(grit_out_dir)', | 36 '-o', '<(grit_out_dir)', |
| 33 '<@(grit_defines)' ], | 37 '<@(grit_defines)', |
| 38 '<@(grit_additional_defines)' ], |
| 34 'msvs_cygwin_shell': 0, | 39 'msvs_cygwin_shell': 0, |
| 35 'message': 'Generating resources from <(grit_grd_file)', | 40 'message': 'Generating resources from <(grit_grd_file)', |
| 36 } | 41 } |
| OLD | NEW |