OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to generate Java source files from templates that are processed | 6 # to generate Java source files from templates that are processed |
7 # through the host C pre-processor. | 7 # through the host C pre-processor. |
8 # | 8 # |
9 # To use this, create a gyp target with the following form: | 9 # To use this, create a gyp target with the following form: |
10 # { | 10 # { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 'rule_name': 'generate_java_constants', | 49 'rule_name': 'generate_java_constants', |
50 'extension': 'template', | 50 'extension': 'template', |
51 # Set template_deps as additional dependencies. | 51 # Set template_deps as additional dependencies. |
52 'inputs': ['<@(template_deps)'], | 52 'inputs': ['<@(template_deps)'], |
53 'outputs': [ | 53 'outputs': [ |
54 '<(output_dir)/<(RULE_INPUT_ROOT).java' | 54 '<(output_dir)/<(RULE_INPUT_ROOT).java' |
55 ], | 55 ], |
56 'action': [ | 56 'action': [ |
57 'gcc', # invoke host gcc. | 57 'gcc', # invoke host gcc. |
58 '-E', # stop after preprocessing. | 58 '-E', # stop after preprocessing. |
| 59 '-D', 'ANDROID', # Specify ANDROID define for pre-processor. |
59 '-x', 'c-header', # treat sources as C header files | 60 '-x', 'c-header', # treat sources as C header files |
60 '-P', # disable line markers, i.e. '#line 309' | 61 '-P', # disable line markers, i.e. '#line 309' |
61 '-I', '<(DEPTH)', # Add project top-level to include path | 62 '-I', '<(DEPTH)', # Add project top-level to include path |
62 '-o', '<@(_outputs)', # Specify output file | 63 '-o', '<@(_outputs)', # Specify output file |
63 '<(RULE_INPUT_PATH)', # Specify input file | 64 '<(RULE_INPUT_PATH)', # Specify input file |
64 ], | 65 ], |
65 'message': 'Generating Java from cpp template <(RULE_INPUT_PATH)', | 66 'message': 'Generating Java from cpp template <(RULE_INPUT_PATH)', |
66 } | 67 } |
67 ], | 68 ], |
68 } | 69 } |
OLD | NEW |