| 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 # NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum |
| 10 # rule instead. |
| 11 # |
| 9 # To use this, create a gyp target with the following form: | 12 # To use this, create a gyp target with the following form: |
| 10 # { | 13 # { |
| 11 # 'target_name': 'android_net_java_constants', | 14 # 'target_name': 'android_net_java_constants', |
| 12 # 'type': 'none', | 15 # 'type': 'none', |
| 13 # 'sources': [ | 16 # 'sources': [ |
| 14 # 'net/android/NetError.template', | 17 # 'net/android/NetError.template', |
| 15 # ], | 18 # ], |
| 16 # 'variables': { | 19 # 'variables': { |
| 17 # 'package_name': 'org/chromium/net', | 20 # 'package_name': 'org/chromium/net', |
| 18 # 'template_deps': ['net/base/certificate_mime_type_list.h'], | 21 # 'template_deps': ['base/net_error_list.h'], |
| 19 # }, | 22 # }, |
| 20 # 'includes': [ '../build/android/java_cpp_template.gypi' ], | 23 # 'includes': [ '../build/android/java_cpp_template.gypi' ], |
| 21 # }, | 24 # }, |
| 22 # | 25 # |
| 23 # The 'sources' entry should only list template file. The template file | 26 # The 'sources' entry should only list template file. The template file |
| 24 # itself should use the 'ClassName.template' format, and will generate | 27 # itself should use the 'ClassName.template' format, and will generate |
| 25 # 'gen/templates/<target-name>/<package-name>/ClassName.java. The files which | 28 # 'gen/templates/<target-name>/<package-name>/ClassName.java. The files which |
| 26 # template dependents on and typically included by the template should be listed | 29 # template dependents on and typically included by the template should be listed |
| 27 # in template_deps variables. Any change to them will force a rebuild of | 30 # in template_deps variables. Any change to them will force a rebuild of |
| 28 # the template, and hence of any source that depends on it. | 31 # the template, and hence of any source that depends on it. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 'action': [ | 72 'action': [ |
| 70 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', | 73 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', |
| 71 '--include-path=<(include_path)', | 74 '--include-path=<(include_path)', |
| 72 '--output=<(output_path)', | 75 '--output=<(output_path)', |
| 73 '--template=<(RULE_INPUT_PATH)', | 76 '--template=<(RULE_INPUT_PATH)', |
| 74 ], | 77 ], |
| 75 'message': 'Generating Java from cpp template <(RULE_INPUT_PATH)', | 78 'message': 'Generating Java from cpp template <(RULE_INPUT_PATH)', |
| 76 } | 79 } |
| 77 ], | 80 ], |
| 78 } | 81 } |
| OLD | NEW |