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': [], |
| 92 'dependencies_res_files': [], |
91 }, | 93 }, |
92 'all_dependent_settings': { | 94 'all_dependent_settings': { |
93 'variables': { | 95 'variables': { |
94 # Dependent jars include this target's R.java file via | 96 # Dependent jars include this target's R.java file via |
95 # generated_R_dirs and additional_R_files. | 97 # generated_R_dirs and include its resources via |
| 98 # dependencies_res_files. |
96 'generated_R_dirs': ['<(R_dir)'], | 99 'generated_R_dirs': ['<(R_dir)'], |
97 'additional_input_paths': ['<(R_stamp)'], | 100 'additional_input_paths': ['<(R_stamp)'], |
| 101 'dependencies_res_files': ['<@(resource_input_paths)'], |
98 | 102 |
99 # Dependent APKs include this target's resources via | 103 # Dependent APKs include this target's resources via |
100 # additional_res_dirs, additional_res_packages, and | 104 # additional_res_dirs, additional_res_packages, and |
101 # additional_R_text_files. | 105 # additional_R_text_files. |
102 'additional_res_dirs': ['<(res_crunched_dir)', '<@(res_input_dirs)'], | 106 'additional_res_dirs': ['<(res_crunched_dir)', '<@(res_input_dirs)'], |
103 'additional_res_packages': ['<(R_package)'], | 107 'additional_res_packages': ['<(R_package)'], |
104 'additional_R_text_files': ['<(R_text_file)'], | 108 'additional_R_text_files': ['<(R_text_file)'], |
105 }, | 109 }, |
106 }, | 110 }, |
107 'conditions': [ | 111 'conditions': [ |
(...skipping 18 matching lines...) Expand all Loading... |
126 ], | 130 ], |
127 }], | 131 }], |
128 ], | 132 ], |
129 'actions': [ | 133 'actions': [ |
130 # Generate R.java and crunch image resources. | 134 # Generate R.java and crunch image resources. |
131 { | 135 { |
132 'action_name': 'process_resources', | 136 'action_name': 'process_resources', |
133 'message': 'processing resources for <(_target_name)', | 137 'message': 'processing resources for <(_target_name)', |
134 'variables': { | 138 'variables': { |
135 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', | 139 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', |
| 140 # Include the dependencies' res dirs so that references to |
| 141 # resources in dependencies can be resolved. |
| 142 'all_res_dirs': ['<@(res_input_dirs)', '>@(additional_res_dirs)'], |
136 }, | 143 }, |
137 'inputs': [ | 144 'inputs': [ |
138 '<(DEPTH)/build/android/pylib/build_utils.py', | 145 '<(DEPTH)/build/android/pylib/build_utils.py', |
139 '<(DEPTH)/build/android/process_resources.py', | 146 '<(DEPTH)/build/android/process_resources.py', |
140 '>@(resource_input_paths)', | 147 '>@(resource_input_paths)', |
| 148 '>@(dependencies_res_files)', |
141 ], | 149 ], |
142 'outputs': [ | 150 'outputs': [ |
143 '<(R_stamp)', | 151 '<(R_stamp)', |
144 ], | 152 ], |
145 'action': [ | 153 'action': [ |
146 '<(DEPTH)/build/android/process_resources.py', | 154 '<(DEPTH)/build/android/process_resources.py', |
147 '--android-sdk', '<(android_sdk)', | 155 '--android-sdk', '<(android_sdk)', |
148 '--android-sdk-tools', '<(android_sdk_tools)', | 156 '--android-sdk-tools', '<(android_sdk_tools)', |
149 '--R-dir', '<(R_dir)', | 157 '--R-dir', '<(R_dir)', |
150 '--res-dirs', '<(res_input_dirs)', | 158 '--res-dirs', '>(all_res_dirs)', |
151 '--crunch-input-dir', '>(res_dir)', | 159 '--crunch-input-dir', '>(res_dir)', |
152 '--crunch-output-dir', '<(res_crunched_dir)', | 160 '--crunch-output-dir', '<(res_crunched_dir)', |
153 '--android-manifest', '<(android_manifest)', | 161 '--android-manifest', '<(android_manifest)', |
154 '--non-constant-id', | 162 '--non-constant-id', |
155 '--custom-package', '<(R_package)', | 163 '--custom-package', '<(R_package)', |
156 '--stamp', '<(R_stamp)', | 164 '--stamp', '<(R_stamp)', |
157 | 165 |
158 # Add hash of inputs to the command line, so if inputs change | 166 # 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. | 167 # (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. | 168 # 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)', | 221 '--classes-dir=<(classes_dir)', |
214 '--jar-path=<(jar_path)', | 222 '--jar-path=<(jar_path)', |
215 '--excluded-classes=<(excluded_classes)', | 223 '--excluded-classes=<(excluded_classes)', |
216 | 224 |
217 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 225 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
218 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 226 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
219 ] | 227 ] |
220 }, | 228 }, |
221 ], | 229 ], |
222 } | 230 } |
OLD | NEW |