Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 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 | |
|
Yaron
2014/08/20 05:52:02
Could use a little more description as it's more s
mkosiba (inactive)
2014/09/02 16:00:57
Done.
| |
| 7 # through a Python script. | |
| 8 # | |
| 9 # To use this, create a gyp target with the following form: | |
| 10 # { | |
| 11 # 'target_name': 'android_net_java_constants', | |
|
Yaron
2014/08/20 05:52:02
The first example of this, isn't using this struct
mkosiba (inactive)
2014/09/02 16:00:57
Done.
| |
| 12 # 'type': 'none', | |
| 13 # 'sources': [ | |
| 14 # 'net/base/certificate_mime_type_list.h' | |
| 15 # ], | |
| 16 # 'variables': [ | |
| 17 # 'package_name': 'org/chromium/ui', | |
|
Yaron
2014/08/20 05:52:02
Maybe this is copied from elsewhere, but this shou
mkosiba (inactive)
2014/09/02 16:00:57
Done.
| |
| 18 # 'class_name': 'CertificateMimeTypeList', | |
| 19 # ], | |
| 20 # 'includes': [ '../build/android/java_cpp_enum.gypi' ], | |
| 21 # }, | |
| 22 # | |
| 23 | |
| 24 { | |
| 25 # Location where all generated Java sources will be placed. | |
| 26 'variables': { | |
| 27 'output_dir': '<(SHARED_INTERMEDIATE_DIR)/templates/<(package_name)', | |
| 28 }, | |
| 29 'direct_dependent_settings': { | |
| 30 'variables': { | |
| 31 # Ensure that the output directory is used in the class path | |
| 32 # when building targets that depend on this one. | |
| 33 'generated_src_dirs': [ | |
| 34 '<(output_dir)/', | |
| 35 ], | |
| 36 # Ensure dependents are rebuilt when sources for this rule change. | |
| 37 'additional_input_paths': [ | |
| 38 '<@(_sources)', | |
| 39 ], | |
| 40 }, | |
| 41 }, | |
| 42 # Define a single rule that will be apply to each file listed in 'sources'. | |
| 43 'rules': [ | |
| 44 { | |
| 45 'rule_name': 'generate_java_constants', | |
| 46 'extension': 'h', | |
| 47 'variables': { | |
| 48 'output_path': '<(output_dir)/<(class_name).java', | |
| 49 }, | |
| 50 'inputs': [ | |
| 51 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
| 52 '<(DEPTH)/build/android/gyp/enum_preprocess.py', | |
| 53 '<@(_sources)', | |
| 54 ], | |
| 55 'outputs': [ | |
| 56 '<(output_path)', | |
| 57 ], | |
| 58 'action': [ | |
| 59 'python', '<(DEPTH)/build/android/gyp/enum_preprocess.py', | |
| 60 '--output=<(output_path)', | |
| 61 '--package=<(package_name)', | |
| 62 '--class_name=<(class_name)', | |
| 63 '<(RULE_INPUT_PATH)', | |
| 64 ], | |
| 65 'message': 'Generating Java from cpp header <(RULE_INPUT_PATH)', | |
| 66 } | |
| 67 ], | |
| 68 } | |
| 69 | |
| OLD | NEW |