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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 'variables': { | 104 'variables': { |
105 'input_jars_paths': ['<(jar_final_path)'], | 105 'input_jars_paths': ['<(jar_final_path)'], |
106 'library_dexed_jars_paths': ['<(dex_path)'], | 106 'library_dexed_jars_paths': ['<(dex_path)'], |
107 }, | 107 }, |
108 }, | 108 }, |
109 'conditions': [ | 109 'conditions': [ |
110 ['has_java_resources == 1', { | 110 ['has_java_resources == 1', { |
111 'variables': { | 111 'variables': { |
112 'res_dir': '<(java_in_dir)/res', | 112 'res_dir': '<(java_in_dir)/res', |
113 'res_crunched_dir': '<(intermediate_dir)/res_crunched', | 113 'res_crunched_dir': '<(intermediate_dir)/res_crunched', |
114 'res_v14_compatibility_stamp': '<(intermediate_dir)/res_v14_compatibilit
y.stamp', | |
115 'res_v14_compatibility_dir': '<(intermediate_dir)/res_v14_compatibility'
, | 114 'res_v14_compatibility_dir': '<(intermediate_dir)/res_v14_compatibility'
, |
116 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], | 115 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], |
117 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], | 116 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], |
118 'R_dir': '<(intermediate_dir)/java_R', | 117 'R_dir': '<(intermediate_dir)/java_R', |
119 'R_text_file': '<(R_dir)/R.txt', | 118 'R_text_file': '<(R_dir)/R.txt', |
120 'R_stamp': '<(intermediate_dir)/resources.stamp', | 119 'R_stamp': '<(intermediate_dir)/resources.stamp', |
121 'generated_src_dirs': ['<(R_dir)'], | 120 'generated_src_dirs': ['<(R_dir)'], |
122 'additional_input_paths': ['<(R_stamp)', | 121 'additional_input_paths': ['<(R_stamp)', ], |
123 '<(res_v14_compatibility_stamp)',], | |
124 'additional_res_dirs': [], | 122 'additional_res_dirs': [], |
125 'dependencies_res_input_dirs': [], | 123 'dependencies_res_input_dirs': [], |
126 'dependencies_res_files': [], | 124 'dependencies_res_files': [], |
127 }, | 125 }, |
128 'all_dependent_settings': { | 126 'all_dependent_settings': { |
129 'variables': { | 127 'variables': { |
130 # Dependent jars include this target's R.java file via | 128 # Dependent jars include this target's R.java file via |
131 # generated_R_dirs and include its resources via | 129 # generated_R_dirs and include its resources via |
132 # dependencies_res_files. | 130 # dependencies_res_files. |
133 'generated_R_dirs': ['<(R_dir)'], | 131 'generated_R_dirs': ['<(R_dir)'], |
134 'additional_input_paths': ['<(R_stamp)', | 132 'additional_input_paths': ['<(R_stamp)', ], |
135 '<(res_v14_compatibility_stamp)',], | |
136 'dependencies_res_files': ['<@(resource_input_paths)'], | 133 'dependencies_res_files': ['<@(resource_input_paths)'], |
137 | 134 |
138 'dependencies_res_input_dirs': ['<@(res_input_dirs)'], | 135 'dependencies_res_input_dirs': ['<@(res_input_dirs)'], |
139 | 136 |
140 # Dependent APKs include this target's resources via | 137 # Dependent APKs include this target's resources via |
141 # additional_res_dirs, additional_res_packages, and | 138 # additional_res_dirs, additional_res_packages, and |
142 # additional_R_text_files. | 139 # additional_R_text_files. |
143 'additional_res_dirs': [ | 140 'additional_res_dirs': [ |
144 # The order of these is important to ensure that the proper | 141 # The order of these is important to ensure that the proper |
145 # version (i.e. the crunched version) of resources takes | 142 # version (i.e. the crunched version) of resources takes |
(...skipping 12 matching lines...) Expand all Loading... |
158 'action_name': 'process_resources', | 155 'action_name': 'process_resources', |
159 'message': 'processing resources for <(_target_name)', | 156 'message': 'processing resources for <(_target_name)', |
160 'variables': { | 157 'variables': { |
161 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', | 158 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', |
162 # Include the dependencies' res dirs so that references to | 159 # Include the dependencies' res dirs so that references to |
163 # resources in dependencies can be resolved. | 160 # resources in dependencies can be resolved. |
164 'dependencies_res_dirs': ['<@(res_extra_dirs)', | 161 'dependencies_res_dirs': ['<@(res_extra_dirs)', |
165 '>@(dependencies_res_input_dirs)',], | 162 '>@(dependencies_res_input_dirs)',], |
166 # Write the inputs list to a file, so that its mtime is updated when | 163 # Write the inputs list to a file, so that its mtime is updated when |
167 # the list of inputs changes. | 164 # the list of inputs changes. |
168 'inputs_list_file': '>|(java_resources.<(_target_name).gypcmd >@(res
ource_input_paths) >@(dependencies_res_files))' | 165 'inputs_list_file': '>|(java_resources.<(_target_name).gypcmd >@(res
ource_input_paths) >@(dependencies_res_files))', |
| 166 'process_resources_options': [], |
| 167 'conditions': [ |
| 168 ['res_v14_verify_only == 1', { |
| 169 'process_resources_options': ['--v14-verify-only'] |
| 170 }], |
| 171 ], |
169 }, | 172 }, |
170 'inputs': [ | 173 'inputs': [ |
171 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 174 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
172 '<(DEPTH)/build/android/gyp/process_resources.py', | 175 '<(DEPTH)/build/android/gyp/process_resources.py', |
| 176 '<(DEPTH)/build/android/gyp/generate_v14_compatible_resources.py', |
173 '>@(resource_input_paths)', | 177 '>@(resource_input_paths)', |
174 '>@(dependencies_res_files)', | 178 '>@(dependencies_res_files)', |
175 '>(inputs_list_file)', | 179 '>(inputs_list_file)', |
176 ], | 180 ], |
177 'outputs': [ | 181 'outputs': [ |
178 '<(R_stamp)', | 182 '<(R_stamp)', |
179 ], | 183 ], |
180 'action': [ | 184 'action': [ |
181 'python', '<(DEPTH)/build/android/gyp/process_resources.py', | 185 'python', '<(DEPTH)/build/android/gyp/process_resources.py', |
182 '--android-sdk', '<(android_sdk)', | 186 '--android-sdk', '<(android_sdk)', |
183 '--android-sdk-tools', '<(android_sdk_tools)', | 187 '--android-sdk-tools', '<(android_sdk_tools)', |
184 '--R-dir', '<(R_dir)', | 188 '--R-dir', '<(R_dir)', |
185 '--dependencies-res-dirs', '>(dependencies_res_dirs)', | 189 '--dependencies-res-dirs', '>(dependencies_res_dirs)', |
186 '--resource-dir', '<(res_dir)', | 190 '--resource-dir', '<(res_dir)', |
| 191 '--res-v14-compatibility-dir', '<(res_v14_compatibility_dir)', |
187 '--crunch-output-dir', '<(res_crunched_dir)', | 192 '--crunch-output-dir', '<(res_crunched_dir)', |
188 '--android-manifest', '<(android_manifest)', | 193 '--android-manifest', '<(android_manifest)', |
189 '--non-constant-id', | 194 '--non-constant-id', |
190 '--custom-package', '<(R_package)', | 195 '--custom-package', '<(R_package)', |
191 '--stamp', '<(R_stamp)', | 196 '--stamp', '<(R_stamp)', |
| 197 '<@(process_resources_options)', |
192 ], | 198 ], |
193 }, | 199 }, |
194 # Generate API 14 resources. | |
195 { | |
196 'action_name': 'generate_api_14_resources_<(_target_name)', | |
197 'message': 'Generating Android API 14 resources <(_target_name)', | |
198 'variables' : { | |
199 'res_v14_additional_options': [], | |
200 }, | |
201 'conditions': [ | |
202 ['res_v14_verify_only == 1', { | |
203 'variables': { | |
204 'res_v14_additional_options': ['--verify-only'] | |
205 }, | |
206 }], | |
207 ], | |
208 'inputs': [ | |
209 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
210 '<(DEPTH)/build/android/gyp/generate_v14_compatible_resources.py', | |
211 '>@(resource_input_paths)', | |
212 ], | |
213 'outputs': [ | |
214 '<(res_v14_compatibility_stamp)', | |
215 ], | |
216 'action': [ | |
217 'python', '<(DEPTH)/build/android/gyp/generate_v14_compatible_resour
ces.py', | |
218 '--res-dir=<(res_dir)', | |
219 '--res-v14-compatibility-dir=<(res_v14_compatibility_dir)', | |
220 '--stamp', '<(res_v14_compatibility_stamp)', | |
221 '<@(res_v14_additional_options)', | |
222 ] | |
223 }, | |
224 ], | 200 ], |
225 }], | 201 }], |
226 ['proguard_preprocess == 1', { | 202 ['proguard_preprocess == 1', { |
227 'actions': [ | 203 'actions': [ |
228 { | 204 { |
229 'action_name': 'proguard_<(_target_name)', | 205 'action_name': 'proguard_<(_target_name)', |
230 'message': 'Proguard preprocessing <(_target_name) jar', | 206 'message': 'Proguard preprocessing <(_target_name) jar', |
231 'inputs': [ | 207 'inputs': [ |
232 '<(android_sdk_root)/tools/proguard/bin/proguard.sh', | 208 '<(android_sdk_root)/tools/proguard/bin/proguard.sh', |
233 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 209 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 'dex_no_locals': 1, | 334 'dex_no_locals': 1, |
359 }], | 335 }], |
360 ], | 336 ], |
361 'dex_input_paths': [ '<(jar_final_path)' ], | 337 'dex_input_paths': [ '<(jar_final_path)' ], |
362 'output_path': '<(dex_path)', | 338 'output_path': '<(dex_path)', |
363 }, | 339 }, |
364 'includes': [ 'android/dex_action.gypi' ], | 340 'includes': [ 'android/dex_action.gypi' ], |
365 }, | 341 }, |
366 ], | 342 ], |
367 } | 343 } |
OLD | NEW |