| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 'jar_stamp': '<(intermediate_dir)/jar.stamp', | 77 'jar_stamp': '<(intermediate_dir)/jar.stamp', |
| 78 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', | 78 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', |
| 79 'classes_dir': '<(intermediate_dir)/classes', | 79 'classes_dir': '<(intermediate_dir)/classes', |
| 80 'javac_includes': [], | 80 'javac_includes': [], |
| 81 'jar_excluded_classes': [], | 81 'jar_excluded_classes': [], |
| 82 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 82 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| 83 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 83 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
| 84 'dex_path': '<(intermediate_dir)/classes.dex', | 84 'dex_path': '<(intermediate_dir)/classes.dex', |
| 85 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', | 85 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', |
| 86 'codegen_input_paths': [], | 86 'codegen_input_paths': [], |
| 87 'final_apk_path': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
| 88 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', |
| 87 }, | 89 }, |
| 88 'sources': [ | 90 'sources': [ |
| 89 '<@(native_libs_paths)', | 91 '<@(native_libs_paths)', |
| 90 ], | 92 ], |
| 91 # Pass the jar path to the apk's "fake" jar target. This would be better as | 93 # Pass the jar path to the apk's "fake" jar target. This would be better as |
| 92 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 94 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
| 93 # cannot be lifted in a dependent to all_dependent_settings. | 95 # cannot be lifted in a dependent to all_dependent_settings. |
| 94 'all_dependent_settings': { | 96 'all_dependent_settings': { |
| 95 'variables': { | 97 'variables': { |
| 96 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 98 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 'variables': { | 152 'variables': { |
| 151 'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'], | 153 'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'], |
| 152 'grit_out_dir': '<(res_grit_dir)', | 154 'grit_out_dir': '<(res_grit_dir)', |
| 153 # resource_ids is unneeded since we don't generate .h headers. | 155 # resource_ids is unneeded since we don't generate .h headers. |
| 154 'grit_resource_ids': '', | 156 'grit_resource_ids': '', |
| 155 }, | 157 }, |
| 156 'includes': ['../build/grit_action.gypi'], | 158 'includes': ['../build/grit_action.gypi'], |
| 157 }, | 159 }, |
| 158 ], | 160 ], |
| 159 }], | 161 }], |
| 162 ['android_managed_install == 1', { |
| 163 'actions': [ |
| 164 { |
| 165 'action_name': 'apk_install_<(_target_name)', |
| 166 'message': 'Installing <(apk_name).apk', |
| 167 'inputs': [ |
| 168 '<(DEPTH)/build/android/pylib/build_utils.py', |
| 169 '<(DEPTH)/build/android/apk_install.py', |
| 170 '<(final_apk_path)', |
| 171 ], |
| 172 'outputs': [ |
| 173 '<(apk_install_stamp)' |
| 174 ], |
| 175 'action': [ |
| 176 'python', '<(DEPTH)/build/android/apk_install.py', |
| 177 '--android-sdk-tools=<(android_sdk_tools)', |
| 178 '--apk-path=<(final_apk_path)', |
| 179 '--stamp=<(apk_install_stamp)' |
| 180 ], |
| 181 }, |
| 182 ], |
| 183 }], |
| 160 ], | 184 ], |
| 161 'actions': [ | 185 'actions': [ |
| 162 { | 186 { |
| 163 'action_name': 'ant_codegen_<(_target_name)', | 187 'action_name': 'ant_codegen_<(_target_name)', |
| 164 'message': 'Generating R.java for <(_target_name)', | 188 'message': 'Generating R.java for <(_target_name)', |
| 165 'conditions': [ | 189 'conditions': [ |
| 166 ['is_test_apk == 1', { | 190 ['is_test_apk == 1', { |
| 167 'variables': { | 191 'variables': { |
| 168 'additional_res_dirs=': [], | 192 'additional_res_dirs=': [], |
| 169 'additional_res_packages=': [], | 193 'additional_res_packages=': [], |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 ], | 379 ], |
| 356 'conditions': [ | 380 'conditions': [ |
| 357 ['is_test_apk == 1', { | 381 ['is_test_apk == 1', { |
| 358 'variables': { | 382 'variables': { |
| 359 'additional_res_dirs=': [], | 383 'additional_res_dirs=': [], |
| 360 'additional_res_packages=': [], | 384 'additional_res_packages=': [], |
| 361 } | 385 } |
| 362 }], | 386 }], |
| 363 ], | 387 ], |
| 364 'outputs': [ | 388 'outputs': [ |
| 365 '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 389 '<(final_apk_path)', |
| 366 ], | 390 ], |
| 367 'action': [ | 391 'action': [ |
| 368 'ant', '-quiet', | 392 'ant', '-quiet', |
| 369 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 393 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
| 370 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 394 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
| 371 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 395 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
| 372 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 396 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
| 373 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 397 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| 374 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 398 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
| 375 '-DAPKS_DIR=<(PRODUCT_DIR)/apks', | 399 '-DAPKS_DIR=<(PRODUCT_DIR)/apks', |
| (...skipping 13 matching lines...) Expand all Loading... |
| 389 | 413 |
| 390 # Add list of inputs to the command line, so if inputs change | 414 # Add list of inputs to the command line, so if inputs change |
| 391 # (e.g. if a Java file is removed), the command will be re-run. | 415 # (e.g. if a Java file is removed), the command will be re-run. |
| 392 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 416 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| 393 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 417 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| 394 | 418 |
| 395 ] | 419 ] |
| 396 }, | 420 }, |
| 397 ], | 421 ], |
| 398 } | 422 } |
| OLD | NEW |