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 Android APKs in a consistent manner. | 6 # to build Android APKs 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_apk', | 10 # 'target_name': 'my_package_apk', |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 'dex_path': '<(intermediate_dir)/classes.dex', | 99 'dex_path': '<(intermediate_dir)/classes.dex', |
100 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 100 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
101 'push_stamp': '<(intermediate_dir)/push.stamp', | 101 'push_stamp': '<(intermediate_dir)/push.stamp', |
102 'link_stamp': '<(intermediate_dir)/link.stamp', | 102 'link_stamp': '<(intermediate_dir)/link.stamp', |
103 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', | 103 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', |
104 'codegen_input_paths': [], | 104 'codegen_input_paths': [], |
105 'keystore_path': '<(DEPTH)/build/android/ant/chromium-debug.keystore', | 105 'keystore_path': '<(DEPTH)/build/android/ant/chromium-debug.keystore', |
106 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | 106 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
107 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 107 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
108 'source_dir': '<(java_in_dir)/src', | 108 'source_dir': '<(java_in_dir)/src', |
109 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', | 109 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', |
110 'strip_output_paths': [], | 110 'strip_output_paths': [], |
111 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', | 111 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', |
| 112 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', |
| 113 'symlink_script_device_path': '/data/local/tmp/chromium/<(_target_name)/crea
te_symlinks.sh', |
112 }, | 114 }, |
113 # Pass the jar path to the apk's "fake" jar target. This would be better as | 115 # Pass the jar path to the apk's "fake" jar target. This would be better as |
114 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 116 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
115 # cannot be lifted in a dependent to all_dependent_settings. | 117 # cannot be lifted in a dependent to all_dependent_settings. |
116 'all_dependent_settings': { | 118 'all_dependent_settings': { |
117 'variables': { | 119 'variables': { |
118 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 120 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
119 }, | 121 }, |
120 }, | 122 }, |
121 'conditions': [ | 123 'conditions': [ |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 ], | 264 ], |
263 'action': [ | 265 'action': [ |
264 'python', '<(DEPTH)/build/android/gyp/push_libraries.py', | 266 'python', '<(DEPTH)/build/android/gyp/push_libraries.py', |
265 '--libraries-dir=<(apk_libraries_dir)', | 267 '--libraries-dir=<(apk_libraries_dir)', |
266 '--device-dir=<(device_library_dir)', | 268 '--device-dir=<(device_library_dir)', |
267 '--libraries-json=<(ordered_libraries_file)', | 269 '--libraries-json=<(ordered_libraries_file)', |
268 '--stamp=<(push_stamp)', | 270 '--stamp=<(push_stamp)', |
269 ], | 271 ], |
270 }, | 272 }, |
271 { | 273 { |
272 'action_name': 'create_library_links', | 274 'action_name': 'create device library symlinks', |
273 'message': 'Creating links on device for <(_target_name).', | 275 'message': 'Creating links on device for <(_target_name).', |
274 'inputs': [ | 276 'inputs': [ |
| 277 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
275 '<(DEPTH)/build/android/gyp/create_device_library_links.py', | 278 '<(DEPTH)/build/android/gyp/create_device_library_links.py', |
276 '<(apk_install_stamp)', | 279 '<(apk_install_record)', |
277 '<(push_stamp)' | 280 '<(ordered_libraries_file)', |
278 ], | 281 ], |
279 'outputs': [ | 282 'outputs': [ |
280 '<(link_stamp)' | 283 '<(link_stamp)' |
281 ], | 284 ], |
282 'action': [ | 285 'action': [ |
283 'python', '<(DEPTH)/build/android/gyp/create_device_library_link
s.py', | 286 'python', '<(DEPTH)/build/android/gyp/create_device_library_link
s.py', |
| 287 '--libraries-json=<(ordered_libraries_file)', |
| 288 '--script-host-path=<(symlink_script_host_path)', |
| 289 '--script-device-path=<(symlink_script_device_path)', |
| 290 '--target-dir=<(device_library_dir)', |
284 '--apk=<(final_apk_path)', | 291 '--apk=<(final_apk_path)', |
285 '--libraries-json=<(ordered_libraries_file)', | |
286 '--libraries-dir=<(apk_libraries_dir)', | |
287 '--target-dir=<(device_library_dir)', | |
288 '--stamp=<(link_stamp)', | 292 '--stamp=<(link_stamp)', |
289 ], | 293 ], |
290 }, | 294 }, |
291 ], | 295 ], |
292 }, { | 296 }, { |
293 # gyp_managed_install != 1 | 297 # gyp_managed_install != 1 |
294 'variables': { | 298 'variables': { |
295 'apk_libraries_dir': '<(apk_package_native_libs_dir)/<(android_app_a
bi)', | 299 'apk_libraries_dir': '<(apk_package_native_libs_dir)/<(android_app_a
bi)', |
296 'package_input_paths': [ '<(strip_stamp)' ], | 300 'package_input_paths': [ '<(strip_stamp)' ], |
297 }, | 301 }, |
(...skipping 27 matching lines...) Expand all Loading... |
325 'actions': [ | 329 'actions': [ |
326 { | 330 { |
327 'action_name': 'apk_install_<(_target_name)', | 331 'action_name': 'apk_install_<(_target_name)', |
328 'message': 'Installing <(apk_name).apk', | 332 'message': 'Installing <(apk_name).apk', |
329 'inputs': [ | 333 'inputs': [ |
330 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 334 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
331 '<(DEPTH)/build/android/gyp/apk_install.py', | 335 '<(DEPTH)/build/android/gyp/apk_install.py', |
332 '<(final_apk_path)', | 336 '<(final_apk_path)', |
333 ], | 337 ], |
334 'outputs': [ | 338 'outputs': [ |
335 '<(apk_install_stamp)', | 339 '<(apk_install_record)', |
336 # If a user switches the connected device, the APK may need to be | 340 # If a user switches the connected device, the APK may need to be |
337 # installed even if there have been no changes. To ensure that the | 341 # installed even if there have been no changes. To ensure that the |
338 # APK on the device is always up-to-date, this step should always | 342 # APK on the device is always up-to-date, this step should always |
339 # be triggered. | 343 # be triggered. |
340 '<(apk_install_stamp).fake', | 344 '<(apk_install_record).fake', |
341 ], | 345 ], |
342 'action': [ | 346 'action': [ |
343 'python', '<(DEPTH)/build/android/gyp/apk_install.py', | 347 'python', '<(DEPTH)/build/android/gyp/apk_install.py', |
344 '--android-sdk-tools=<(android_sdk_tools)', | 348 '--android-sdk-tools=<(android_sdk_tools)', |
345 '--apk-path=<(final_apk_path)', | 349 '--apk-path=<(final_apk_path)', |
346 '--stamp=<(apk_install_stamp)' | 350 '--install-record=<(apk_install_record)' |
347 ], | 351 ], |
348 }, | 352 }, |
349 ], | 353 ], |
350 }], | 354 }], |
351 ], | 355 ], |
352 'actions': [ | 356 'actions': [ |
353 { | 357 { |
354 'action_name': 'ant_codegen_<(_target_name)', | 358 'action_name': 'ant_codegen_<(_target_name)', |
355 'message': 'Generating R.java for <(_target_name)', | 359 'message': 'Generating R.java for <(_target_name)', |
356 'conditions': [ | 360 'conditions': [ |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 '--unsigned-apk-path=<(unsigned_apk_path)', | 654 '--unsigned-apk-path=<(unsigned_apk_path)', |
651 '--final-apk-path=<(final_apk_path)', | 655 '--final-apk-path=<(final_apk_path)', |
652 '--keystore-path=<(keystore_path)', | 656 '--keystore-path=<(keystore_path)', |
653 | 657 |
654 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 658 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
655 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 659 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
656 ], | 660 ], |
657 }, | 661 }, |
658 ], | 662 ], |
659 } | 663 } |
OLD | NEW |