Chromium Code Reviews| 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 build Java in a consistent manner. | 6 # to build Java in a consistent manner. |
| 7 # | 7 # |
| 8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
| 9 # { | 9 # { |
| 10 # 'target_name': 'my-package_java', | 10 # 'target_name': 'my-package_java', |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 'variables': { | 81 'variables': { |
| 82 'res_dir': '<(java_in_dir)/res', | 82 'res_dir': '<(java_in_dir)/res', |
| 83 'res_crunched_dir': '<(intermediate_dir)/res_crunched', | 83 'res_crunched_dir': '<(intermediate_dir)/res_crunched', |
| 84 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], | 84 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], |
| 85 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], | 85 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], |
| 86 'R_dir': '<(intermediate_dir)/java_R', | 86 'R_dir': '<(intermediate_dir)/java_R', |
| 87 'R_text_file': '<(R_dir)/R.txt', | 87 'R_text_file': '<(R_dir)/R.txt', |
| 88 'R_stamp': '<(intermediate_dir)/resources.stamp', | 88 'R_stamp': '<(intermediate_dir)/resources.stamp', |
| 89 'generated_src_dirs': ['<(R_dir)'], | 89 'generated_src_dirs': ['<(R_dir)'], |
| 90 'additional_input_paths': ['<(R_stamp)'], | 90 'additional_input_paths': ['<(R_stamp)'], |
| 91 'additional_res_dirs': [], | |
| 91 }, | 92 }, |
| 92 'all_dependent_settings': { | 93 'all_dependent_settings': { |
| 93 'variables': { | 94 'variables': { |
| 94 # Dependent jars include this target's R.java file via | 95 # Dependent jars include this target's R.java file via |
| 95 # generated_R_dirs and additional_R_files. | 96 # generated_R_dirs and additional_R_files. |
| 96 'generated_R_dirs': ['<(R_dir)'], | 97 'generated_R_dirs': ['<(R_dir)'], |
| 97 'additional_input_paths': ['<(R_stamp)'], | 98 'additional_input_paths': ['<(R_stamp)'], |
| 98 | 99 |
| 99 # Dependent APKs include this target's resources via | 100 # Dependent APKs include this target's resources via |
| 100 # additional_res_dirs, additional_res_packages, and | 101 # additional_res_dirs, additional_res_packages, and |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 126 ], | 127 ], |
| 127 }], | 128 }], |
| 128 ], | 129 ], |
| 129 'actions': [ | 130 'actions': [ |
| 130 # Generate R.java and crunch image resources. | 131 # Generate R.java and crunch image resources. |
| 131 { | 132 { |
| 132 'action_name': 'process_resources', | 133 'action_name': 'process_resources', |
| 133 'message': 'processing resources for <(_target_name)', | 134 'message': 'processing resources for <(_target_name)', |
| 134 'variables': { | 135 'variables': { |
| 135 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', | 136 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', |
| 137 'all_res_dirs': ['<@(res_input_dirs)'], | |
| 138 # Work around a gyp bug where late-expanding an empty list results | |
| 139 # in one element -- an empty string -- instead of zero elements. | |
| 140 # TODO(newt): Remove this condition once | |
| 141 # https://code.google.com/p/gyp/issues/detail?id=328 is fixed. | |
|
cjhopman
2013/03/27 00:37:50
Could this bug be due to the fact that all_res_dir
| |
| 142 'conditions': [ | |
| 143 ['additional_res_dirs!=[]', { | |
| 144 # Include the depedencies' res dirs so that references to | |
| 145 # resources in dependencies can be resolved. | |
| 146 'all_res_dirs': ['>@(additional_res_dirs)'], | |
| 147 }], | |
| 148 ], | |
| 136 }, | 149 }, |
| 137 'inputs': [ | 150 'inputs': [ |
| 138 '<(DEPTH)/build/android/pylib/build_utils.py', | 151 '<(DEPTH)/build/android/pylib/build_utils.py', |
| 139 '<(DEPTH)/build/android/process_resources.py', | 152 '<(DEPTH)/build/android/process_resources.py', |
| 140 '>@(resource_input_paths)', | 153 '>@(resource_input_paths)', |
| 141 ], | 154 ], |
| 142 'outputs': [ | 155 'outputs': [ |
| 143 '<(R_stamp)', | 156 '<(R_stamp)', |
| 144 ], | 157 ], |
| 145 'action': [ | 158 'action': [ |
| 146 '<(DEPTH)/build/android/process_resources.py', | 159 '<(DEPTH)/build/android/process_resources.py', |
| 147 '--android-sdk', '<(android_sdk)', | 160 '--android-sdk', '<(android_sdk)', |
| 148 '--android-sdk-tools', '<(android_sdk_tools)', | 161 '--android-sdk-tools', '<(android_sdk_tools)', |
| 149 '--R-dir', '<(R_dir)', | 162 '--R-dir', '<(R_dir)', |
| 150 '--res-dirs', '<(res_input_dirs)', | 163 '--res-dirs', '<(all_res_dirs)', |
| 151 '--crunch-input-dir', '>(res_dir)', | 164 '--crunch-input-dir', '>(res_dir)', |
| 152 '--crunch-output-dir', '<(res_crunched_dir)', | 165 '--crunch-output-dir', '<(res_crunched_dir)', |
| 153 '--android-manifest', '<(android_manifest)', | 166 '--android-manifest', '<(android_manifest)', |
| 154 '--non-constant-id', | 167 '--non-constant-id', |
| 155 '--custom-package', '<(R_package)', | 168 '--custom-package', '<(R_package)', |
| 156 '--stamp', '<(R_stamp)', | 169 '--stamp', '<(R_stamp)', |
| 157 | 170 |
| 158 # Add hash of inputs to the command line, so if inputs change | 171 # Add hash of inputs to the command line, so if inputs change |
| 159 # (e.g. if a resource if removed), the command will be re-run. | 172 # (e.g. if a resource if removed), the command will be re-run. |
| 160 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 173 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 '--classes-dir=<(classes_dir)', | 226 '--classes-dir=<(classes_dir)', |
| 214 '--jar-path=<(jar_path)', | 227 '--jar-path=<(jar_path)', |
| 215 '--excluded-classes=<(excluded_classes)', | 228 '--excluded-classes=<(excluded_classes)', |
| 216 | 229 |
| 217 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja . | 230 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja . |
| 218 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 231 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 219 ] | 232 ] |
| 220 }, | 233 }, |
| 221 ], | 234 ], |
| 222 } | 235 } |
| OLD | NEW |