OLD | NEW |
| (Empty) |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 # This file is meant to be included into a target to provide a rule | |
6 # to build Android APKs in a consistent manner. | |
7 # | |
8 # To use this, create a gyp target with the following form: | |
9 # { | |
10 # 'target_name': 'my_package_apk', | |
11 # 'type': 'none', | |
12 # 'variables': { | |
13 # 'apk_name': 'MyPackage', | |
14 # 'java_in_dir': 'path/to/package/root', | |
15 # 'resource_dir': 'path/to/package/root/res', | |
16 # }, | |
17 # 'includes': ['path/to/this/gypi/file'], | |
18 # } | |
19 # | |
20 # Required variables: | |
21 # apk_name - The final apk will be named <apk_name>.apk | |
22 # java_in_dir - The top-level java directory. The src should be in | |
23 # <(java_in_dir)/src. | |
24 # Optional/automatic variables: | |
25 # additional_input_paths - These paths will be included in the 'inputs' list to | |
26 # ensure that this target is rebuilt when one of these paths changes. | |
27 # additional_res_packages - Package names of R.java files generated in addition | |
28 # to the default package name defined in AndroidManifest.xml. | |
29 # additional_src_dirs - Additional directories with .java files to be compiled | |
30 # and included in the output of this target. | |
31 # additional_bundled_libs - Additional libraries what will be stripped and | |
32 # bundled in the apk. | |
33 # asset_location - The directory where assets are located. | |
34 # create_abi_split - Whether to create abi-based spilts. Splits | |
35 # are supported only for minSdkVersion >= 21. | |
36 # create_density_splits - Whether to create density-based apk splits. | |
37 # language_splits - List of languages to create apk splits for. | |
38 # generated_src_dirs - Same as additional_src_dirs except used for .java files | |
39 # that are generated at build time. This should be set automatically by a | |
40 # target's dependencies. The .java files in these directories are not | |
41 # included in the 'inputs' list (unlike additional_src_dirs). | |
42 # library_jars_paths - The path to library jars to be included in the classpath
. | |
43 # These will not be included into the final apk. | |
44 # input_jars_paths - The path to jars to be included in the classpath. This | |
45 # should be filled automatically by depending on the appropriate targets. | |
46 # is_test_apk - Set to 1 if building a test apk. This prevents resources from | |
47 # dependencies from being re-included. | |
48 # native_lib_target - The target_name of the target which generates the final | |
49 # shared library to be included in this apk. A stripped copy of the | |
50 # library will be included in the apk. | |
51 # resource_dir - The directory for resources. | |
52 # shared_resources - Make a resource package that can be loaded by a different | |
53 # application at runtime to access the package's resources. | |
54 # app_as_shared_library - Make a resource package that can be loaded as shared | |
55 # library. | |
56 # R_package - A custom Java package to generate the resource file R.java in. | |
57 # By default, the package given in AndroidManifest.xml will be used. | |
58 # include_all_resources - Set to 1 to include all resource IDs in all generated | |
59 # R.java files. | |
60 # use_chromium_linker - Enable the content dynamic linker that allows sharing t
he | |
61 # RELRO section of the native libraries between the different processes. | |
62 # load_library_from_zip - When using the dynamic linker, load the library | |
63 # directly out of the zip file. | |
64 # use_relocation_packer - Enable relocation packing. Relies on the chromium | |
65 # linker, so use_chromium_linker must also be enabled. | |
66 # enable_chromium_linker_tests - Enable the content dynamic linker test support | |
67 # code. This allows a test APK to inject a Linker.TestRunner instance at | |
68 # runtime. Should only be used by the chromium_linker_test_apk target!! | |
69 # never_lint - Set to 1 to not run lint on this target. | |
70 # java_in_dir_suffix - To override the /src suffix on java_in_dir. | |
71 # app_manifest_version_name - set the apps 'human readable' version number. | |
72 # app_manifest_version_code - set the apps version number. | |
73 # dependencies_locale_zip_alternative_paths - a list of paths that used to | |
74 # replace dependencies_locale_zip_paths of all_dependent_settings. | |
75 { | |
76 'variables': { | |
77 'tested_apk_obfuscated_jar_path%': '/', | |
78 'tested_apk_dex_path%': '/', | |
79 'tested_apk_is_multidex%': 0, | |
80 'tested_apk_generated_multidex_config%': 0, | |
81 'additional_input_paths': [], | |
82 'additional_locale_input_paths': [], | |
83 'create_density_splits%': 0, | |
84 'language_splits': [], | |
85 'library_jars_paths': [], | |
86 'input_jars_paths': [], | |
87 'library_dexed_jars_paths': [], | |
88 'additional_src_dirs': [], | |
89 'generated_src_dirs': [], | |
90 'app_manifest_version_name%': '<(android_app_version_name)', | |
91 'app_manifest_version_code%': '<(android_app_version_code)', | |
92 # aapt generates this proguard.txt. | |
93 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', | |
94 'proguard_enabled%': 'false', | |
95 'debug_build_proguard_enabled%': 'false', | |
96 'proguard_flags_paths': ['<(generated_proguard_file)'], | |
97 'jar_name': 'chromium_apk_<(_target_name).jar', | |
98 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', | |
99 'R_package%':'', | |
100 'include_all_resources%': 0, | |
101 'additional_R_text_files': [], | |
102 'dependencies_locale_zip_alternative_paths%': [], | |
103 'dependencies_locale_zip_paths': [], | |
104 'dependencies_res_zip_paths': [], | |
105 'additional_res_packages': [], | |
106 'additional_bundled_libs%': [], | |
107 'is_test_apk%': 0, | |
108 # Allow icu data, v8 snapshots, and pak files to be loaded directly from the
.apk. | |
109 # Note: These are actually suffix matches, not necessarily extensions. | |
110 'extensions_to_not_compress%': '.dat,.bin,.pak', | |
111 'resource_input_paths': [], | |
112 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | |
113 'asset_location%': '<(intermediate_dir)/assets', | |
114 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', | |
115 'package_input_paths': [], | |
116 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', | |
117 'additional_ordered_libraries_file': '<(intermediate_dir)/additional_native_
libraries.json', | |
118 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLib
raries.template', | |
119 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', | |
120 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.
java', | |
121 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.st
amp', | |
122 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/
', | |
123 'native_libraries_template_data_file': '<(native_libraries_template_data_dir
)/native_libraries_array.h', | |
124 'native_libraries_template_version_file': '<(native_libraries_template_data_
dir)/native_libraries_version.h', | |
125 'generate_build_config%': 0, | |
126 'build_config_template': '<(DEPTH)/base/android/java/templates/BuildConfig.t
emplate', | |
127 'build_config_java_dir': '<(intermediate_dir)/build_config/', | |
128 'build_config_java_file': '<(build_config_java_dir)/BuildConfig.java', | |
129 'build_config_java_stamp': '<(intermediate_dir)/build_config_java.stamp', | |
130 'compile_stamp': '<(intermediate_dir)/compile.stamp', | |
131 'lint_stamp': '<(intermediate_dir)/lint.stamp', | |
132 'lint_result': '<(intermediate_dir)/lint_result.xml', | |
133 'lint_config': '<(intermediate_dir)/lint_config.xml', | |
134 'never_lint%': 0, | |
135 'findbugs_stamp': '<(intermediate_dir)/findbugs.stamp', | |
136 'run_findbugs%': 0, | |
137 'java_in_dir_suffix%': '/src', | |
138 'emma_instr_stamp': '<(intermediate_dir)/emma_instr.stamp', | |
139 'jar_stamp': '<(intermediate_dir)/jar.stamp', | |
140 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', | |
141 'pack_relocations_stamp': '<(intermediate_dir)/pack_relocations.stamp', | |
142 'strip_stamp': '<(intermediate_dir)/strip.stamp', | |
143 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries', | |
144 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp', | |
145 'version_stamp': '<(intermediate_dir)/version.stamp', | |
146 'javac_includes': [], | |
147 'jar_excluded_classes': [], | |
148 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', | |
149 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | |
150 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | |
151 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | |
152 'enable_multidex%': 0, | |
153 'enable_multidex_configurations%': [], | |
154 'multidex_configuration_path': '<(intermediate_dir)/multidex_config.json', | |
155 'main_dex_list_path': '<(intermediate_dir)/main_dex_list.txt', | |
156 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | |
157 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | |
158 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi
d_app_abi)/AndroidManifest.xml', | |
159 'push_stamp': '<(intermediate_dir)/push.stamp', | |
160 'link_stamp': '<(intermediate_dir)/link.stamp', | |
161 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', | |
162 'shared_resources%': 0, | |
163 'app_as_shared_library%': 0, | |
164 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)', | |
165 'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)-abi-<(android_
app_abi).apk', | |
166 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', | |
167 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', | |
168 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', | |
169 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', | |
170 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', | |
171 'create_standalone_apk%': 1, | |
172 'res_v14_skip%': 0, | |
173 'variables': { | |
174 'variables': { | |
175 'native_lib_target%': '', | |
176 'native_lib_version_name%': '', | |
177 'use_chromium_linker%' : 0, | |
178 'use_relocation_packer%' : 0, | |
179 'enable_chromium_linker_tests%': 0, | |
180 'is_test_apk%': 0, | |
181 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | |
182 'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(an
droid_app_abi)-unsigned.apk', | |
183 'create_abi_split%': 0, | |
184 'enable_multidex%': 0, | |
185 }, | |
186 'unsigned_apk_path': '<(unsigned_apk_path)', | |
187 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', | |
188 'create_abi_split%': '<(create_abi_split)', | |
189 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | |
190 'conditions': [ | |
191 ['gyp_managed_install == 1 and native_lib_target != ""', { | |
192 'conditions': [ | |
193 ['create_abi_split == 0', { | |
194 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-s
tandalone-unsigned.apk', | |
195 }, { | |
196 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-a
bi-<(android_app_abi)-standalone-unsigned.apk', | |
197 }], | |
198 ], | |
199 }, { | |
200 'unsigned_standalone_apk_path': '<(unsigned_apk_path)', | |
201 }], | |
202 ['gyp_managed_install == 1', { | |
203 'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed', | |
204 }, { | |
205 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', | |
206 }], | |
207 ['is_test_apk == 0 and emma_coverage != 0', { | |
208 'emma_instrument%': 1, | |
209 },{ | |
210 'emma_instrument%': 0, | |
211 }], | |
212 # When using abi splits, the abi split is modified by | |
213 # gyp_managed_install rather than the main .apk | |
214 ['create_abi_split == 1', { | |
215 'managed_input_apk_path': '<(unsigned_abi_split_apk_path)', | |
216 }, { | |
217 'managed_input_apk_path': '<(unsigned_apk_path)', | |
218 }], | |
219 ['enable_multidex == 1', { | |
220 'dex_path': '<(intermediate_dir)/classes.dex.zip', | |
221 }, { | |
222 'dex_path': '<(intermediate_dir)/classes.dex', | |
223 }], | |
224 ], | |
225 }, | |
226 'native_lib_target%': '', | |
227 'native_lib_version_name%': '', | |
228 'use_chromium_linker%' : 0, | |
229 'load_library_from_zip%' : 0, | |
230 'use_relocation_packer%' : 0, | |
231 'enable_chromium_linker_tests%': 0, | |
232 'emma_instrument%': '<(emma_instrument)', | |
233 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', | |
234 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', | |
235 'unsigned_apk_path': '<(unsigned_apk_path)', | |
236 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', | |
237 'create_abi_split%': '<(create_abi_split)', | |
238 'managed_input_apk_path': '<(managed_input_apk_path)', | |
239 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_
extension)', | |
240 'extra_native_libs': [], | |
241 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)/native_lib_placeholder.stamp', | |
242 'native_lib_placeholders': [], | |
243 'main_apk_name': '<(apk_name)', | |
244 'dex_path': '<(dex_path)', | |
245 'conditions': [ | |
246 ['chromium_code == 0', { | |
247 'enable_errorprone': 0, | |
248 }], | |
249 ], | |
250 'enable_errorprone%': 0, | |
251 'errorprone_exe_path': '<(PRODUCT_DIR)/bin.java/chromium_errorprone', | |
252 'final_apk_path%': '<(final_apk_path)', | |
253 }, | |
254 # Pass the jar path to the apk's "fake" jar target. This would be better as | |
255 # direct_dependent_settings, but a variable set by a direct_dependent_settings | |
256 # cannot be lifted in a dependent to all_dependent_settings. | |
257 'all_dependent_settings': { | |
258 'conditions': [ | |
259 ['proguard_enabled == "true"', { | |
260 'variables': { | |
261 'proguard_enabled': 'true', | |
262 } | |
263 }], | |
264 ['debug_build_proguard_enabled == "true"', { | |
265 'variables': { | |
266 'debug_build_proguard_enabled': 'true', | |
267 } | |
268 }], | |
269 ['is_test_apk == 0', { | |
270 'variables': { | |
271 'tested_apk_path': '<(final_apk_path)', | |
272 'tested_apk_obfuscated_jar_path': '<(obfuscated_jar_path)', | |
273 'tested_apk_dex_path': '<(dex_path)', | |
274 'tested_apk_is_multidex': '<(enable_multidex)', | |
275 'tested_apk_generated_multidex_config': '>(generate_build_config)', | |
276 } | |
277 }] | |
278 ], | |
279 'variables': { | |
280 'apk_output_jar_path': '<(jar_path)', | |
281 }, | |
282 }, | |
283 'conditions': [ | |
284 ['resource_dir!=""', { | |
285 'variables': { | |
286 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ] | |
287 }, | |
288 }], | |
289 ['native_lib_target != "" and android_must_copy_system_libraries == 1', { | |
290 'dependencies': [ | |
291 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', | |
292 ], | |
293 }], | |
294 ['use_chromium_linker == 1', { | |
295 'dependencies': [ | |
296 '<(DEPTH)/base/base.gyp:chromium_android_linker', | |
297 ], | |
298 }], | |
299 ['enable_errorprone == 1', { | |
300 'dependencies': [ | |
301 '<(DEPTH)/third_party/errorprone/errorprone.gyp:require_errorprone', | |
302 ], | |
303 }], | |
304 ['native_lib_target != ""', { | |
305 'variables': { | |
306 'conditions': [ | |
307 ['use_chromium_linker == 1', { | |
308 'variables': { | |
309 'chromium_linker_path': [ | |
310 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)', | |
311 ], | |
312 } | |
313 }, { | |
314 'variables': { | |
315 'chromium_linker_path': [], | |
316 }, | |
317 }], | |
318 ], | |
319 'generated_src_dirs': [ '<(native_libraries_java_dir)' ], | |
320 'native_libs_paths': [ | |
321 '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)', | |
322 '<@(chromium_linker_path)' | |
323 ], | |
324 'package_input_paths': [ | |
325 '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver', | |
326 ], | |
327 }, | |
328 'copies': [ | |
329 { | |
330 # gdbserver is always copied into the APK's native libs dir. The ant | |
331 # build scripts (apkbuilder task) will only include it in a debug | |
332 # build. | |
333 'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)', | |
334 'files': [ | |
335 '<(android_gdbserver)', | |
336 ], | |
337 }, | |
338 ], | |
339 'actions': [ | |
340 { | |
341 'variables': { | |
342 'input_libraries': [ | |
343 '<@(native_libs_paths)', | |
344 '<@(extra_native_libs)', | |
345 ], | |
346 }, | |
347 'includes': ['../build/android/write_ordered_libraries.gypi'], | |
348 }, | |
349 { | |
350 'action_name': 'native_libraries_<(_target_name)', | |
351 'variables': { | |
352 'conditions': [ | |
353 ['use_chromium_linker == 1', { | |
354 'variables': { | |
355 'linker_gcc_preprocess_defines': [ | |
356 '--defines', 'ENABLE_CHROMIUM_LINKER', | |
357 ], | |
358 } | |
359 }, { | |
360 'variables': { | |
361 'linker_gcc_preprocess_defines': [], | |
362 }, | |
363 }], | |
364 ['load_library_from_zip == 1', { | |
365 'variables': { | |
366 'linker_load_from_zip_file_preprocess_defines': [ | |
367 '--defines', 'ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE', | |
368 ], | |
369 } | |
370 }, { | |
371 'variables': { | |
372 'linker_load_from_zip_file_preprocess_defines': [], | |
373 }, | |
374 }], | |
375 ['enable_chromium_linker_tests == 1', { | |
376 'variables': { | |
377 'linker_tests_gcc_preprocess_defines': [ | |
378 '--defines', 'ENABLE_CHROMIUM_LINKER_TESTS', | |
379 ], | |
380 } | |
381 }, { | |
382 'variables': { | |
383 'linker_tests_gcc_preprocess_defines': [], | |
384 }, | |
385 }], | |
386 ], | |
387 'gcc_preprocess_defines': [ | |
388 '<@(linker_load_from_zip_file_preprocess_defines)', | |
389 '<@(linker_gcc_preprocess_defines)', | |
390 '<@(linker_tests_gcc_preprocess_defines)', | |
391 ], | |
392 }, | |
393 'message': 'Creating NativeLibraries.java for <(_target_name)', | |
394 'inputs': [ | |
395 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
396 '<(DEPTH)/build/android/gyp/gcc_preprocess.py', | |
397 '<(ordered_libraries_file)', | |
398 '<(native_libraries_template)', | |
399 ], | |
400 'outputs': [ | |
401 '<(native_libraries_java_stamp)', | |
402 ], | |
403 'action': [ | |
404 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', | |
405 '--include-path=', | |
406 '--output=<(native_libraries_java_file)', | |
407 '--template=<(native_libraries_template)', | |
408 '--stamp=<(native_libraries_java_stamp)', | |
409 '--defines', 'NATIVE_LIBRARIES_LIST=@FileArg(<(ordered_libraries_fil
e):java_libraries_list)', | |
410 '--defines', 'NATIVE_LIBRARIES_VERSION_NUMBER="<(native_lib_version_
name)"', | |
411 '<@(gcc_preprocess_defines)', | |
412 ], | |
413 }, | |
414 { | |
415 'action_name': 'strip_native_libraries', | |
416 'variables': { | |
417 'ordered_libraries_file%': '<(ordered_libraries_file)', | |
418 'stripped_libraries_dir%': '<(stripped_libraries_dir)', | |
419 'input_paths': [ | |
420 '<@(native_libs_paths)', | |
421 '<@(extra_native_libs)', | |
422 ], | |
423 'stamp': '<(strip_stamp)' | |
424 }, | |
425 'includes': ['../build/android/strip_native_libraries.gypi'], | |
426 }, | |
427 { | |
428 'action_name': 'insert_chromium_version', | |
429 'variables': { | |
430 'ordered_libraries_file%': '<(ordered_libraries_file)', | |
431 'stripped_libraries_dir%': '<(stripped_libraries_dir)', | |
432 'version_string': '<(native_lib_version_name)', | |
433 'input_paths': [ | |
434 '<(strip_stamp)', | |
435 ], | |
436 'stamp': '<(version_stamp)' | |
437 }, | |
438 'includes': ['../build/android/insert_chromium_version.gypi'], | |
439 }, | |
440 { | |
441 'action_name': 'pack_relocations', | |
442 'variables': { | |
443 'conditions': [ | |
444 ['use_chromium_linker == 1 and use_relocation_packer == 1 and prof
iling != 1', { | |
445 'enable_packing': 1, | |
446 }, { | |
447 'enable_packing': 0, | |
448 }], | |
449 ], | |
450 'exclude_packing_list': [ | |
451 '<(libchromium_android_linker)', | |
452 ], | |
453 'ordered_libraries_file%': '<(ordered_libraries_file)', | |
454 'stripped_libraries_dir%': '<(stripped_libraries_dir)', | |
455 'packed_libraries_dir': '<(libraries_source_dir)', | |
456 'input_paths': [ | |
457 '<(version_stamp)' | |
458 ], | |
459 'stamp': '<(pack_relocations_stamp)', | |
460 }, | |
461 'includes': ['../build/android/pack_relocations.gypi'], | |
462 }, | |
463 { | |
464 'variables': { | |
465 'input_libraries': [ | |
466 '<@(additional_bundled_libs)', | |
467 ], | |
468 'ordered_libraries_file': '<(additional_ordered_libraries_file)', | |
469 'subtarget': '_additional_libraries', | |
470 }, | |
471 'includes': ['../build/android/write_ordered_libraries.gypi'], | |
472 }, | |
473 { | |
474 'action_name': 'strip_additional_libraries', | |
475 'variables': { | |
476 'ordered_libraries_file': '<(additional_ordered_libraries_file)', | |
477 'stripped_libraries_dir': '<(libraries_source_dir)', | |
478 'input_paths': [ | |
479 '<@(additional_bundled_libs)', | |
480 '<(strip_stamp)', | |
481 ], | |
482 'stamp': '<(strip_additional_stamp)' | |
483 }, | |
484 'includes': ['../build/android/strip_native_libraries.gypi'], | |
485 }, | |
486 { | |
487 'action_name': 'Create native lib placeholder files for previous relea
ses', | |
488 'variables': { | |
489 'placeholders': ['<@(native_lib_placeholders)'], | |
490 'conditions': [ | |
491 ['gyp_managed_install == 1', { | |
492 # This "library" just needs to be put in the .apk. It is not loa
ded | |
493 # at runtime. | |
494 'placeholders': ['libfix.crbug.384638.so'], | |
495 }] | |
496 ], | |
497 }, | |
498 'inputs': [ | |
499 '<(DEPTH)/build/android/gyp/create_placeholder_files.py', | |
500 ], | |
501 'outputs': [ | |
502 '<(native_lib_placeholder_stamp)', | |
503 ], | |
504 'action': [ | |
505 'python', '<(DEPTH)/build/android/gyp/create_placeholder_files.py', | |
506 '--dest-lib-dir=<(apk_package_native_libs_dir)/<(android_app_abi)/', | |
507 '--stamp=<(native_lib_placeholder_stamp)', | |
508 '<@(placeholders)', | |
509 ], | |
510 }, | |
511 ], | |
512 'conditions': [ | |
513 ['gyp_managed_install == 1', { | |
514 'variables': { | |
515 'libraries_top_dir': '<(intermediate_dir)/lib.stripped', | |
516 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)
', | |
517 'device_library_dir': '<(device_intermediate_dir)/lib.stripped', | |
518 }, | |
519 'dependencies': [ | |
520 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations', | |
521 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_
commands', | |
522 ], | |
523 'actions': [ | |
524 { | |
525 'includes': ['../build/android/push_libraries.gypi'], | |
526 }, | |
527 { | |
528 'action_name': 'create device library symlinks', | |
529 'message': 'Creating links on device for <(_target_name)', | |
530 'inputs': [ | |
531 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
532 '<(DEPTH)/build/android/gyp/create_device_library_links.py', | |
533 '<(apk_install_record)', | |
534 '<(build_device_config_path)', | |
535 '<(ordered_libraries_file)', | |
536 ], | |
537 'outputs': [ | |
538 '<(link_stamp)' | |
539 ], | |
540 'action': [ | |
541 'python', '<(DEPTH)/build/android/gyp/create_device_library_link
s.py', | |
542 '--build-device-configuration=<(build_device_config_path)', | |
543 '--libraries=@FileArg(<(ordered_libraries_file):libraries)', | |
544 '--script-host-path=<(symlink_script_host_path)', | |
545 '--script-device-path=<(symlink_script_device_path)', | |
546 '--target-dir=<(device_library_dir)', | |
547 '--apk=<(incomplete_apk_path)', | |
548 '--stamp=<(link_stamp)', | |
549 '--configuration-name=<(CONFIGURATION_NAME)', | |
550 '--output-directory=<(PRODUCT_DIR)', | |
551 ], | |
552 }, | |
553 ], | |
554 'conditions': [ | |
555 ['create_standalone_apk == 1', { | |
556 'actions': [ | |
557 { | |
558 'action_name': 'create standalone APK', | |
559 'variables': { | |
560 'inputs': [ | |
561 '<(ordered_libraries_file)', | |
562 '<(strip_additional_stamp)', | |
563 '<(pack_relocations_stamp)', | |
564 ], | |
565 'output_apk_path': '<(unsigned_standalone_apk_path)', | |
566 'libraries_top_dir%': '<(libraries_top_dir)', | |
567 'input_apk_path': '<(managed_input_apk_path)', | |
568 }, | |
569 'includes': [ 'android/create_standalone_apk_action.gypi' ], | |
570 }, | |
571 ], | |
572 }], | |
573 ], | |
574 }, { | |
575 # gyp_managed_install != 1 | |
576 'variables': { | |
577 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', | |
578 'package_input_paths': [ | |
579 '<(strip_additional_stamp)', | |
580 '<(pack_relocations_stamp)', | |
581 ], | |
582 }, | |
583 }], | |
584 ], | |
585 }], # native_lib_target != '' | |
586 ['gyp_managed_install == 0 or create_standalone_apk == 1 or create_abi_split
== 1', { | |
587 'dependencies': [ | |
588 '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', | |
589 ], | |
590 }], | |
591 ['create_abi_split == 1 or gyp_managed_install == 0 or create_standalone_apk
== 1', { | |
592 'actions': [ | |
593 { | |
594 'action_name': 'finalize_base', | |
595 'variables': { | |
596 'output_apk_path': '<(final_apk_path)', | |
597 'conditions': [ | |
598 ['create_abi_split == 0', { | |
599 'input_apk_path': '<(unsigned_standalone_apk_path)', | |
600 }, { | |
601 'input_apk_path': '<(unsigned_apk_path)', | |
602 'load_library_from_zip': 0, | |
603 }] | |
604 ], | |
605 }, | |
606 'includes': [ 'android/finalize_apk_action.gypi'] | |
607 }, | |
608 ], | |
609 }], | |
610 ['create_abi_split == 1', { | |
611 'actions': [ | |
612 { | |
613 'action_name': 'generate_split_manifest_<(_target_name)', | |
614 'inputs': [ | |
615 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
616 '<(DEPTH)/build/android/gyp/generate_split_manifest.py', | |
617 '<(android_manifest_path)', | |
618 ], | |
619 'outputs': [ | |
620 '<(split_android_manifest_path)', | |
621 ], | |
622 'action': [ | |
623 'python', '<(DEPTH)/build/android/gyp/generate_split_manifest.py', | |
624 '--main-manifest', '<(android_manifest_path)', | |
625 '--out-manifest', '<(split_android_manifest_path)', | |
626 '--split', 'abi_<(android_app_abi)', | |
627 ], | |
628 }, | |
629 { | |
630 'variables': { | |
631 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', | |
632 'asset_location': '', | |
633 'android_manifest_path': '<(split_android_manifest_path)', | |
634 'create_density_splits': 0, | |
635 'language_splits=': [], | |
636 }, | |
637 'includes': [ 'android/package_resources_action.gypi' ], | |
638 }, | |
639 { | |
640 'variables': { | |
641 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', | |
642 'apk_path': '<(unsigned_abi_split_apk_path)', | |
643 'has_code': 0, | |
644 'native_libs_dir': '<(apk_package_native_libs_dir)', | |
645 'extra_inputs': ['<(native_lib_placeholder_stamp)'], | |
646 }, | |
647 'includes': ['android/apkbuilder_action.gypi'], | |
648 }, | |
649 ], | |
650 }], | |
651 ['create_abi_split == 1 and (gyp_managed_install == 0 or create_standalone_a
pk == 1)', { | |
652 'actions': [ | |
653 { | |
654 'action_name': 'finalize_split', | |
655 'variables': { | |
656 'output_apk_path': '<(final_abi_split_apk_path)', | |
657 'conditions': [ | |
658 ['gyp_managed_install == 1', { | |
659 'input_apk_path': '<(unsigned_standalone_apk_path)', | |
660 }, { | |
661 'input_apk_path': '<(unsigned_abi_split_apk_path)', | |
662 }], | |
663 ], | |
664 }, | |
665 'includes': [ 'android/finalize_apk_action.gypi'] | |
666 }, | |
667 ], | |
668 }], | |
669 ['gyp_managed_install == 1', { | |
670 'actions': [ | |
671 { | |
672 'action_name': 'finalize incomplete apk', | |
673 'variables': { | |
674 'load_library_from_zip': 0, | |
675 'input_apk_path': '<(managed_input_apk_path)', | |
676 'output_apk_path': '<(incomplete_apk_path)', | |
677 }, | |
678 'includes': [ 'android/finalize_apk_action.gypi'] | |
679 }, | |
680 { | |
681 'action_name': 'apk_install_<(_target_name)', | |
682 'message': 'Installing <(apk_name).apk', | |
683 'inputs': [ | |
684 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
685 '<(DEPTH)/build/android/gyp/apk_install.py', | |
686 '<(build_device_config_path)', | |
687 '<(incomplete_apk_path)', | |
688 ], | |
689 'outputs': [ | |
690 '<(apk_install_record)', | |
691 ], | |
692 'action': [ | |
693 'python', '<(DEPTH)/build/android/gyp/apk_install.py', | |
694 '--build-device-configuration=<(build_device_config_path)', | |
695 '--install-record=<(apk_install_record)', | |
696 '--configuration-name=<(CONFIGURATION_NAME)', | |
697 '--android-sdk-tools', '<(android_sdk_tools)', | |
698 '--output-directory', '<(PRODUCT_DIR)', | |
699 ], | |
700 'conditions': [ | |
701 ['create_abi_split == 1', { | |
702 'inputs': [ | |
703 '<(final_apk_path)', | |
704 ], | |
705 'action': [ | |
706 '--apk-path=<(final_apk_path)', | |
707 '--split-apk-path=<(incomplete_apk_path)', | |
708 ], | |
709 }, { | |
710 'action': [ | |
711 '--apk-path=<(incomplete_apk_path)', | |
712 ], | |
713 }], | |
714 ['create_density_splits == 1', { | |
715 'inputs': [ | |
716 '<(final_apk_path_no_extension)-density-hdpi.apk', | |
717 '<(final_apk_path_no_extension)-density-xhdpi.apk', | |
718 '<(final_apk_path_no_extension)-density-xxhdpi.apk', | |
719 '<(final_apk_path_no_extension)-density-xxxhdpi.apk', | |
720 '<(final_apk_path_no_extension)-density-tvdpi.apk', | |
721 ], | |
722 'action': [ | |
723 '--split-apk-path=<(final_apk_path_no_extension)-density-hdpi.ap
k', | |
724 '--split-apk-path=<(final_apk_path_no_extension)-density-xhdpi.a
pk', | |
725 '--split-apk-path=<(final_apk_path_no_extension)-density-xxhdpi.
apk', | |
726 '--split-apk-path=<(final_apk_path_no_extension)-density-xxxhdpi
.apk', | |
727 '--split-apk-path=<(final_apk_path_no_extension)-density-tvdpi.a
pk', | |
728 ], | |
729 }], | |
730 ['language_splits != []', { | |
731 'inputs': [ | |
732 "<!@(python <(DEPTH)/build/apply_locales.py '<(final_apk_path_no
_extension)-lang-ZZLOCALE.apk' <(language_splits))", | |
733 ], | |
734 'action': [ | |
735 "<!@(python <(DEPTH)/build/apply_locales.py -- '--split-apk-path
=<(final_apk_path_no_extension)-lang-ZZLOCALE.apk' <(language_splits))", | |
736 ], | |
737 }], | |
738 ], | |
739 }, | |
740 ], | |
741 }], | |
742 ['create_density_splits == 1', { | |
743 'actions': [ | |
744 { | |
745 'action_name': 'finalize_density_splits', | |
746 'variables': { | |
747 'density_splits': 1, | |
748 }, | |
749 'includes': [ 'android/finalize_splits_action.gypi'] | |
750 }, | |
751 ], | |
752 }], | |
753 ['is_test_apk == 1', { | |
754 'dependencies': [ | |
755 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm
ands', | |
756 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', | |
757 ], | |
758 }], | |
759 ['run_findbugs == 1', { | |
760 'actions': [ | |
761 { | |
762 'action_name': 'findbugs_<(_target_name)', | |
763 'message': 'Running findbugs on <(_target_name)', | |
764 'variables': { | |
765 'additional_findbugs_args': [], | |
766 'findbugs_verbose%': 0, | |
767 }, | |
768 'conditions': [ | |
769 ['findbugs_verbose == 1', { | |
770 'variables': { | |
771 'additional_findbugs_args+': ['-vv'], | |
772 }, | |
773 }], | |
774 ], | |
775 'inputs': [ | |
776 '<(DEPTH)/build/android/findbugs_diff.py', | |
777 '<(DEPTH)/build/android/findbugs_filter/findbugs_exclude.xml', | |
778 '<(DEPTH)/build/android/pylib/utils/findbugs.py', | |
779 '>@(input_jars_paths)', | |
780 '<(jar_path)', | |
781 '<(compile_stamp)', | |
782 ], | |
783 'outputs': [ | |
784 '<(findbugs_stamp)', | |
785 ], | |
786 'action': [ | |
787 'python', '<(DEPTH)/build/android/findbugs_diff.py', | |
788 '--auxclasspath-gyp', '>(input_jars_paths)', | |
789 '--stamp', '<(findbugs_stamp)', | |
790 '<@(additional_findbugs_args)', | |
791 '<(jar_path)', | |
792 ], | |
793 }, | |
794 ], | |
795 }], | |
796 ], | |
797 'target_conditions': [ | |
798 ['generate_build_config == 1 and tested_apk_generated_multidex_config == 0',
{ | |
799 'variables': { | |
800 'generated_src_dirs': ['<(build_config_java_dir)'], | |
801 }, | |
802 'actions': [ | |
803 { | |
804 'action_name': 'configure_multidex_for_<(_target_name)', | |
805 'inputs': [ | |
806 '<(DEPTH)/build/android/gyp/configure_multidex.py', | |
807 '<(build_config_template)', | |
808 ], | |
809 'outputs': [ | |
810 '<(multidex_configuration_path)', | |
811 '<(build_config_java_stamp)', | |
812 ], | |
813 'variables': { | |
814 'additional_multidex_config_options': [], | |
815 'enabled_configurations': '>(enable_multidex_configurations)', | |
816 'conditions': [ | |
817 ['enable_multidex == 1', { | |
818 'additional_multidex_config_options': ['--enable-multidex'], | |
819 }], | |
820 ], | |
821 }, | |
822 'action': [ | |
823 'python', '<(DEPTH)/build/android/gyp/configure_multidex.py', | |
824 '--configuration-name', '<(CONFIGURATION_NAME)', | |
825 '--enabled-configurations', '<(enabled_configurations)', | |
826 '--multidex-configuration-path', '<(multidex_configuration_path)', | |
827 '--multidex-config-java-template', '<(build_config_template)', | |
828 '--multidex-config-java-file', '<(build_config_java_file)', | |
829 '--multidex-config-java-stamp', '<(build_config_java_stamp)', | |
830 '>@(additional_multidex_config_options)', | |
831 ], | |
832 }, | |
833 ], | |
834 'conditions': [ | |
835 ['enable_multidex == 1', { | |
836 'actions': [ | |
837 { | |
838 'action_name': 'main_dex_list_for_<(_target_name)', | |
839 'variables': { | |
840 'jar_paths': ['>@(input_jars_paths)', '<(javac_jar_path)'], | |
841 'output_path': '<(main_dex_list_path)', | |
842 }, | |
843 'includes': [ 'android/main_dex_action.gypi' ], | |
844 }, | |
845 ] | |
846 }] | |
847 ], | |
848 }], | |
849 ], | |
850 'dependencies': [ | |
851 '<(DEPTH)/build/android/android_lint_cache.gyp:android_lint_cache', | |
852 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', | |
853 ], | |
854 'actions': [ | |
855 { | |
856 'action_name': 'process_resources', | |
857 'message': 'processing resources for <(_target_name)', | |
858 'variables': { | |
859 'local_additional_input_paths': [ | |
860 '>@(additional_input_paths)', | |
861 ], | |
862 'local_dependencies_res_zip_paths': [ | |
863 '>@(dependencies_res_zip_paths)' | |
864 ], | |
865 # Write the inputs list to a file, so that its mtime is updated when | |
866 # the list of inputs changes. | |
867 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(local_addi
tional_input_paths) >@(resource_input_paths))', | |
868 | |
869 'process_resources_options': [], | |
870 'conditions': [ | |
871 ['dependencies_locale_zip_alternative_paths == []', { | |
872 'local_dependencies_res_zip_paths': ['>@(dependencies_locale_zip_pat
hs)'], | |
873 'local_additional_input_paths': ['>@(additional_locale_input_paths)'
] | |
874 }, { | |
875 'local_dependencies_res_zip_paths': ['<@(dependencies_locale_zip_alt
ernative_paths)'], | |
876 'local_additional_input_paths': ['>@(dependencies_locale_zip_alterna
tive_paths)'], | |
877 }], | |
878 ['is_test_apk == 1', { | |
879 'dependencies_locale_zip_paths=': [], | |
880 'dependencies_res_zip_paths=': [], | |
881 'additional_res_packages=': [], | |
882 }], | |
883 ['res_v14_skip == 1', { | |
884 'process_resources_options+': ['--v14-skip'] | |
885 }], | |
886 ['shared_resources == 1', { | |
887 'process_resources_options+': ['--shared-resources'] | |
888 }], | |
889 ['app_as_shared_library == 1', { | |
890 'process_resources_options+': ['--app-as-shared-lib'] | |
891 }], | |
892 ['R_package != ""', { | |
893 'process_resources_options+': ['--custom-package', '<(R_package)'] | |
894 }], | |
895 ['include_all_resources == 1', { | |
896 'process_resources_options+': ['--include-all-resources'] | |
897 }] | |
898 ], | |
899 }, | |
900 'inputs': [ | |
901 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
902 '<(DEPTH)/build/android/gyp/process_resources.py', | |
903 '<(android_manifest_path)', | |
904 '>@(local_additional_input_paths)', | |
905 '>@(resource_input_paths)', | |
906 '>@(local_dependencies_res_zip_paths)', | |
907 '>(inputs_list_file)', | |
908 ], | |
909 'outputs': [ | |
910 '<(resource_zip_path)', | |
911 '<(generated_proguard_file)', | |
912 '<(codegen_stamp)', | |
913 ], | |
914 'action': [ | |
915 'python', '<(DEPTH)/build/android/gyp/process_resources.py', | |
916 '--android-sdk-jar', '<(android_sdk_jar)', | |
917 '--aapt-path', '<(android_aapt_path)', | |
918 | |
919 '--android-manifest', '<(android_manifest_path)', | |
920 '--dependencies-res-zips', '>(local_dependencies_res_zip_paths)', | |
921 | |
922 '--extra-res-packages', '>(additional_res_packages)', | |
923 '--extra-r-text-files', '>(additional_R_text_files)', | |
924 | |
925 '--proguard-file', '<(generated_proguard_file)', | |
926 | |
927 '--resource-dirs', '<(resource_dir)', | |
928 '--resource-zip-out', '<(resource_zip_path)', | |
929 | |
930 '--R-dir', '<(intermediate_dir)/gen', | |
931 | |
932 '--stamp', '<(codegen_stamp)', | |
933 | |
934 '<@(process_resources_options)', | |
935 ], | |
936 }, | |
937 { | |
938 'action_name': 'javac_<(_target_name)', | |
939 'message': 'Compiling java for <(_target_name)', | |
940 'variables': { | |
941 'extra_args': [], | |
942 'extra_inputs': [], | |
943 'gen_src_dirs': [ | |
944 '<(intermediate_dir)/gen', | |
945 '>@(generated_src_dirs)', | |
946 ], | |
947 # If there is a separate find for additional_src_dirs, it will find the | |
948 # wrong .java files when additional_src_dirs is empty. | |
949 # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and | |
950 # java_apk.gypi evaluate the same command, and at the moment two targets | |
951 # set java_in_dir to "java". Add a dummy comment here to make sure | |
952 # that the two targets (one uses java.gypi, the other java_apk.gypi) | |
953 # get distinct source lists. Medium-term, make targets list all their | |
954 # Java files instead of using find. (As is, this will be broken if two | |
955 # targets use the same java_in_dir and both use java_apk.gypi or | |
956 # both use java.gypi.) | |
957 'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additio
nal_src_dirs) -name "*.java" # apk)'], | |
958 'conditions': [ | |
959 ['enable_errorprone == 1', { | |
960 'extra_inputs': [ | |
961 '<(errorprone_exe_path)', | |
962 ], | |
963 'extra_args': [ '--use-errorprone-path=<(errorprone_exe_path)' ], | |
964 }], | |
965 ], | |
966 }, | |
967 'inputs': [ | |
968 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
969 '<(DEPTH)/build/android/gyp/javac.py', | |
970 '>@(java_sources)', | |
971 '>@(input_jars_paths)', | |
972 '<(codegen_stamp)', | |
973 '<@(extra_inputs)', | |
974 ], | |
975 'conditions': [ | |
976 ['native_lib_target != ""', { | |
977 'inputs': [ '<(native_libraries_java_stamp)' ], | |
978 }], | |
979 ], | |
980 'target_conditions': [ | |
981 ['generate_build_config == 1 and tested_apk_generated_multidex_config ==
0', { | |
982 'inputs': [ '<(build_config_java_stamp)' ], | |
983 }], | |
984 ], | |
985 'outputs': [ | |
986 '<(compile_stamp)', | |
987 '<(javac_jar_path)', | |
988 ], | |
989 'action': [ | |
990 'python', '<(DEPTH)/build/android/gyp/javac.py', | |
991 '--bootclasspath=<(android_sdk_jar)', | |
992 '--classpath=>(input_jars_paths) <(android_sdk_jar) >(library_jars_paths
)', | |
993 '--src-gendirs=>(gen_src_dirs)', | |
994 '--javac-includes=<(javac_includes)', | |
995 '--chromium-code=<(chromium_code)', | |
996 '--jar-path=<(javac_jar_path)', | |
997 '--jar-excluded-classes=<(jar_excluded_classes)', | |
998 '--stamp=<(compile_stamp)', | |
999 '<@(extra_args)', | |
1000 '>@(java_sources)', | |
1001 ], | |
1002 }, | |
1003 { | |
1004 'action_name': 'emma_instr_jar_<(_target_name)', | |
1005 'message': 'Instrumenting <(_target_name) jar', | |
1006 'variables': { | |
1007 'input_path': '<(javac_jar_path)', | |
1008 'output_path': '<(jar_path)', | |
1009 'coverage_file': '<(PRODUCT_DIR)/lib.java/<(_target_name).em', | |
1010 'sources_list_file': '<(PRODUCT_DIR)/lib.java/<(_target_name)_sources.tx
t', | |
1011 'stamp_path': '<(emma_instr_stamp)', | |
1012 }, | |
1013 'outputs': [ | |
1014 '<(emma_instr_stamp)', | |
1015 '<(jar_path)', | |
1016 ], | |
1017 'inputs': [ | |
1018 '<(javac_jar_path)', | |
1019 ], | |
1020 'includes': [ 'android/emma_instr_action.gypi' ], | |
1021 }, | |
1022 { | |
1023 'variables': { | |
1024 'src_dirs': [ | |
1025 '<(java_in_dir)<(java_in_dir_suffix)', | |
1026 '>@(additional_src_dirs)', | |
1027 ], | |
1028 'lint_jar_path': '<(jar_path)', | |
1029 'stamp_path': '<(lint_stamp)', | |
1030 'result_path': '<(lint_result)', | |
1031 'config_path': '<(lint_config)', | |
1032 }, | |
1033 'outputs': [ | |
1034 '<(lint_stamp)', | |
1035 ], | |
1036 'includes': [ 'android/lint_action.gypi' ], | |
1037 }, | |
1038 { | |
1039 'action_name': 'obfuscate_<(_target_name)', | |
1040 'message': 'Obfuscating <(_target_name)', | |
1041 'variables': { | |
1042 'additional_obfuscate_options': [], | |
1043 'additional_obfuscate_input_paths': [], | |
1044 'proguard_out_dir': '<(intermediate_dir)/proguard', | |
1045 'proguard_input_jar_paths': [ | |
1046 '>@(input_jars_paths)', | |
1047 '<(jar_path)', | |
1048 ], | |
1049 'target_conditions': [ | |
1050 ['is_test_apk == 1', { | |
1051 'additional_obfuscate_options': [ | |
1052 '--testapp', | |
1053 ], | |
1054 }], | |
1055 ['is_test_apk == 1 and tested_apk_obfuscated_jar_path != "/"', { | |
1056 'additional_obfuscate_options': [ | |
1057 '--tested-apk-obfuscated-jar-path', '>(tested_apk_obfuscated_jar_p
ath)', | |
1058 ], | |
1059 'additional_obfuscate_input_paths': [ | |
1060 '>(tested_apk_obfuscated_jar_path).info', | |
1061 ], | |
1062 }], | |
1063 ['proguard_enabled == "true"', { | |
1064 'additional_obfuscate_options': [ | |
1065 '--proguard-enabled', | |
1066 ], | |
1067 }], | |
1068 ['debug_build_proguard_enabled == "true"', { | |
1069 'additional_obfuscate_options': [ | |
1070 '--debug-build-proguard-enabled', | |
1071 ], | |
1072 }], | |
1073 ], | |
1074 'obfuscate_input_jars_paths': [ | |
1075 '>@(input_jars_paths)', | |
1076 '<(jar_path)', | |
1077 ], | |
1078 }, | |
1079 'conditions': [ | |
1080 ['is_test_apk == 1', { | |
1081 'outputs': [ | |
1082 '<(test_jar_path)', | |
1083 ], | |
1084 }], | |
1085 ['enable_multidex == 1', { | |
1086 'inputs': [ | |
1087 '<(main_dex_list_path)', | |
1088 '<(multidex_configuration_path)', | |
1089 ], | |
1090 'variables': { | |
1091 'additional_obfuscate_options': [ | |
1092 '--main-dex-list-path', '<(main_dex_list_path)', | |
1093 '--multidex-configuration-path', '<(multidex_configuration_path)', | |
1094 ], | |
1095 }, | |
1096 }], | |
1097 ], | |
1098 'inputs': [ | |
1099 '<(DEPTH)/build/android/gyp/apk_obfuscate.py', | |
1100 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
1101 '>@(proguard_flags_paths)', | |
1102 '>@(obfuscate_input_jars_paths)', | |
1103 '>@(additional_obfuscate_input_paths)', | |
1104 '<(emma_instr_stamp)', | |
1105 ], | |
1106 'outputs': [ | |
1107 '<(obfuscate_stamp)', | |
1108 | |
1109 # In non-Release builds, these paths will all be empty files. | |
1110 '<(obfuscated_jar_path)', | |
1111 '<(obfuscated_jar_path).info', | |
1112 '<(obfuscated_jar_path).dump', | |
1113 '<(obfuscated_jar_path).seeds', | |
1114 '<(obfuscated_jar_path).mapping', | |
1115 '<(obfuscated_jar_path).usage', | |
1116 ], | |
1117 'action': [ | |
1118 'python', '<(DEPTH)/build/android/gyp/apk_obfuscate.py', | |
1119 | |
1120 '--configuration-name', '<(CONFIGURATION_NAME)', | |
1121 | |
1122 '--android-sdk', '<(android_sdk)', | |
1123 '--android-sdk-tools', '<(android_sdk_tools)', | |
1124 '--android-sdk-jar', '<(android_sdk_jar)', | |
1125 | |
1126 '--input-jars-paths=>(proguard_input_jar_paths)', | |
1127 '--proguard-configs=>(proguard_flags_paths)', | |
1128 | |
1129 '--test-jar-path', '<(test_jar_path)', | |
1130 '--obfuscated-jar-path', '<(obfuscated_jar_path)', | |
1131 | |
1132 '--proguard-jar-path', '<(DEPTH)/third_party/proguard/lib/proguard.jar', | |
1133 | |
1134 '--stamp', '<(obfuscate_stamp)', | |
1135 | |
1136 '>@(additional_obfuscate_options)', | |
1137 ], | |
1138 }, | |
1139 { | |
1140 'action_name': 'dex_<(_target_name)', | |
1141 'variables': { | |
1142 'dex_additional_options': [], | |
1143 'dex_input_paths': [ | |
1144 '<(jar_path)', | |
1145 ], | |
1146 'output_path': '<(dex_path)', | |
1147 'proguard_enabled_input_path': '<(obfuscated_jar_path)', | |
1148 }, | |
1149 'conditions': [ | |
1150 ['enable_multidex == 1', { | |
1151 'inputs': [ | |
1152 '<(main_dex_list_path)', | |
1153 '<(multidex_configuration_path)', | |
1154 ], | |
1155 'variables': { | |
1156 'dex_additional_options': [ | |
1157 '--main-dex-list-path', '<(main_dex_list_path)', | |
1158 '--multidex-configuration-path', '<(multidex_configuration_path)', | |
1159 ], | |
1160 }, | |
1161 }], | |
1162 ], | |
1163 'target_conditions': [ | |
1164 ['enable_multidex == 1 or tested_apk_is_multidex == 1', { | |
1165 'variables': { | |
1166 'dex_input_paths': [ | |
1167 '>@(input_jars_paths)', | |
1168 ], | |
1169 }, | |
1170 }, { | |
1171 'variables': { | |
1172 'dex_input_paths': [ | |
1173 '>@(library_dexed_jars_paths)', | |
1174 ], | |
1175 }, | |
1176 }], | |
1177 ['emma_instrument != 0', { | |
1178 'variables': { | |
1179 'dex_no_locals': 1, | |
1180 'dex_input_paths': [ | |
1181 '<(emma_device_jar)' | |
1182 ], | |
1183 }, | |
1184 }], | |
1185 ['is_test_apk == 1 and tested_apk_dex_path != "/"', { | |
1186 'variables': { | |
1187 'dex_additional_options': [ | |
1188 '--excluded-paths', '@FileArg(>(tested_apk_dex_path).inputs)' | |
1189 ], | |
1190 }, | |
1191 'inputs': [ | |
1192 '>(tested_apk_dex_path).inputs', | |
1193 ], | |
1194 }], | |
1195 ['proguard_enabled == "true" or debug_build_proguard_enabled == "true"',
{ | |
1196 'inputs': [ '<(obfuscate_stamp)' ] | |
1197 }, { | |
1198 'inputs': [ '<(emma_instr_stamp)' ] | |
1199 }], | |
1200 ], | |
1201 'includes': [ 'android/dex_action.gypi' ], | |
1202 }, | |
1203 { | |
1204 'variables': { | |
1205 'local_dependencies_res_zip_paths': ['>@(dependencies_res_zip_paths)'], | |
1206 'extra_inputs': ['<(codegen_stamp)'], | |
1207 'resource_zips': [ | |
1208 '<(resource_zip_path)', | |
1209 ], | |
1210 'conditions': [ | |
1211 ['dependencies_locale_zip_alternative_paths == []', { | |
1212 'local_dependencies_res_zip_paths': ['>@(dependencies_locale_zip_pat
hs)'], | |
1213 }, { | |
1214 'local_dependencies_res_zip_paths': ['<@(dependencies_locale_zip_alt
ernative_paths)'], | |
1215 }], | |
1216 ['is_test_apk == 0', { | |
1217 'resource_zips': [ | |
1218 '>@(local_dependencies_res_zip_paths)', | |
1219 ], | |
1220 }], | |
1221 ], | |
1222 }, | |
1223 'includes': [ 'android/package_resources_action.gypi' ], | |
1224 }, | |
1225 { | |
1226 'variables': { | |
1227 'apk_path': '<(unsigned_apk_path)', | |
1228 'conditions': [ | |
1229 ['native_lib_target != ""', { | |
1230 'extra_inputs': ['<(native_lib_placeholder_stamp)'], | |
1231 }], | |
1232 ['create_abi_split == 0', { | |
1233 'native_libs_dir': '<(apk_package_native_libs_dir)', | |
1234 }, { | |
1235 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', | |
1236 }], | |
1237 ], | |
1238 }, | |
1239 'includes': ['android/apkbuilder_action.gypi'], | |
1240 }, | |
1241 ], | |
1242 } | |
OLD | NEW |