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 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', | 110 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', |
| 111 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', |
| 112 'symlink_script_device_path': '/data/local/tmp/chromium/<(_target_name)/crea
te_symlinks.sh', |
111 }, | 113 }, |
112 # Pass the jar path to the apk's "fake" jar target. This would be better as | 114 # Pass the jar path to the apk's "fake" jar target. This would be better as |
113 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 115 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
114 # cannot be lifted in a dependent to all_dependent_settings. | 116 # cannot be lifted in a dependent to all_dependent_settings. |
115 'all_dependent_settings': { | 117 'all_dependent_settings': { |
116 'variables': { | 118 'variables': { |
117 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 119 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
118 }, | 120 }, |
119 }, | 121 }, |
120 'conditions': [ | 122 'conditions': [ |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 'device_library_dir': '/data/local/tmp/chromium/lib.stripped/<(_targ
et_name)', | 205 'device_library_dir': '/data/local/tmp/chromium/lib.stripped/<(_targ
et_name)', |
204 }, | 206 }, |
205 'dependencies': [ | 207 'dependencies': [ |
206 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', | 208 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', |
207 ], | 209 ], |
208 'actions': [ | 210 'actions': [ |
209 { | 211 { |
210 'includes': ['../build/android/push_libraries.gypi'], | 212 'includes': ['../build/android/push_libraries.gypi'], |
211 }, | 213 }, |
212 { | 214 { |
213 'action_name': 'create_library_links', | 215 'action_name': 'create device library symlinks', |
214 'message': 'Creating links on device for <(_target_name).', | 216 'message': 'Creating links on device for <(_target_name).', |
215 'inputs': [ | 217 'inputs': [ |
| 218 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
216 '<(DEPTH)/build/android/gyp/create_device_library_links.py', | 219 '<(DEPTH)/build/android/gyp/create_device_library_links.py', |
217 '<(apk_install_stamp)', | 220 '<(apk_install_record)', |
218 '<(push_stamp)' | 221 '<(ordered_libraries_file)', |
219 ], | 222 ], |
220 'outputs': [ | 223 'outputs': [ |
221 '<(link_stamp)' | 224 '<(link_stamp)' |
222 ], | 225 ], |
223 'action': [ | 226 'action': [ |
224 'python', '<(DEPTH)/build/android/gyp/create_device_library_link
s.py', | 227 'python', '<(DEPTH)/build/android/gyp/create_device_library_link
s.py', |
| 228 '--libraries-json=<(ordered_libraries_file)', |
| 229 '--script-host-path=<(symlink_script_host_path)', |
| 230 '--script-device-path=<(symlink_script_device_path)', |
| 231 '--target-dir=<(device_library_dir)', |
225 '--apk=<(final_apk_path)', | 232 '--apk=<(final_apk_path)', |
226 '--libraries-json=<(ordered_libraries_file)', | |
227 '--libraries-dir=<(libraries_source_dir)', | |
228 '--target-dir=<(device_library_dir)', | |
229 '--stamp=<(link_stamp)', | 233 '--stamp=<(link_stamp)', |
230 ], | 234 ], |
231 }, | 235 }, |
232 ], | 236 ], |
233 }, { | 237 }, { |
234 # gyp_managed_install != 1 | 238 # gyp_managed_install != 1 |
235 'variables': { | 239 'variables': { |
236 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', | 240 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', |
237 'package_input_paths': [ '<(strip_stamp)' ], | 241 'package_input_paths': [ '<(strip_stamp)' ], |
238 }, | 242 }, |
(...skipping 27 matching lines...) Expand all Loading... |
266 'actions': [ | 270 'actions': [ |
267 { | 271 { |
268 'action_name': 'apk_install_<(_target_name)', | 272 'action_name': 'apk_install_<(_target_name)', |
269 'message': 'Installing <(apk_name).apk', | 273 'message': 'Installing <(apk_name).apk', |
270 'inputs': [ | 274 'inputs': [ |
271 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 275 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
272 '<(DEPTH)/build/android/gyp/apk_install.py', | 276 '<(DEPTH)/build/android/gyp/apk_install.py', |
273 '<(final_apk_path)', | 277 '<(final_apk_path)', |
274 ], | 278 ], |
275 'outputs': [ | 279 'outputs': [ |
276 '<(apk_install_stamp)', | 280 '<(apk_install_record)', |
277 # If a user switches the connected device, the APK may need to be | 281 # If a user switches the connected device, the APK may need to be |
278 # installed even if there have been no changes. To ensure that the | 282 # installed even if there have been no changes. To ensure that the |
279 # APK on the device is always up-to-date, this step should always | 283 # APK on the device is always up-to-date, this step should always |
280 # be triggered. | 284 # be triggered. |
281 '<(apk_install_stamp).fake', | 285 '<(apk_install_record).fake', |
282 ], | 286 ], |
283 'action': [ | 287 'action': [ |
284 'python', '<(DEPTH)/build/android/gyp/apk_install.py', | 288 'python', '<(DEPTH)/build/android/gyp/apk_install.py', |
285 '--android-sdk-tools=<(android_sdk_tools)', | 289 '--android-sdk-tools=<(android_sdk_tools)', |
286 '--apk-path=<(final_apk_path)', | 290 '--apk-path=<(final_apk_path)', |
287 '--stamp=<(apk_install_stamp)' | 291 '--install-record=<(apk_install_record)' |
288 ], | 292 ], |
289 }, | 293 }, |
290 ], | 294 ], |
291 }], | 295 }], |
292 ], | 296 ], |
293 'actions': [ | 297 'actions': [ |
294 { | 298 { |
295 'action_name': 'ant_codegen_<(_target_name)', | 299 'action_name': 'ant_codegen_<(_target_name)', |
296 'message': 'Generating R.java for <(_target_name)', | 300 'message': 'Generating R.java for <(_target_name)', |
297 'conditions': [ | 301 'conditions': [ |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 '--unsigned-apk-path=<(unsigned_apk_path)', | 595 '--unsigned-apk-path=<(unsigned_apk_path)', |
592 '--final-apk-path=<(final_apk_path)', | 596 '--final-apk-path=<(final_apk_path)', |
593 '--keystore-path=<(keystore_path)', | 597 '--keystore-path=<(keystore_path)', |
594 | 598 |
595 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 599 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
596 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 600 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
597 ], | 601 ], |
598 }, | 602 }, |
599 ], | 603 ], |
600 } | 604 } |
OLD | NEW |