| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 'conditions': [ | 326 'conditions': [ |
| 327 ['is_test_apk == 1', { | 327 ['is_test_apk == 1', { |
| 328 'variables': { | 328 'variables': { |
| 329 'additional_res_dirs=': [], | 329 'additional_res_dirs=': [], |
| 330 'additional_res_packages=': [], | 330 'additional_res_packages=': [], |
| 331 } | 331 } |
| 332 }], | 332 }], |
| 333 ], | 333 ], |
| 334 'inputs': [ | 334 'inputs': [ |
| 335 '<(DEPTH)/build/android/ant/apk-codegen.xml', | 335 '<(DEPTH)/build/android/ant/apk-codegen.xml', |
| 336 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 337 '<(DEPTH)/build/android/gyp/ant.py', |
| 336 '<(android_manifest)', | 338 '<(android_manifest)', |
| 337 '>@(library_manifest_paths)' | 339 '>@(library_manifest_paths)' |
| 338 '>@(codegen_input_paths)', | 340 '>@(codegen_input_paths)', |
| 339 '>@(additional_input_paths)', | 341 '>@(additional_input_paths)', |
| 340 ], | 342 ], |
| 341 'outputs': [ | 343 'outputs': [ |
| 342 '<(codegen_stamp)', | 344 '<(codegen_stamp)', |
| 343 ], | 345 ], |
| 344 'action': [ | 346 'action': [ |
| 345 'ant', '-quiet', | 347 'python', '<(DEPTH)/build/android/gyp/ant.py', |
| 348 '-quiet', |
| 346 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 349 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
| 347 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 350 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
| 348 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 351 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
| 349 '-DANDROID_MANIFEST=<(android_manifest)', | 352 '-DANDROID_MANIFEST=<(android_manifest)', |
| 350 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 353 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
| 351 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 354 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| 352 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 355 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
| 353 '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)', | 356 '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)', |
| 354 '-DOUT_DIR=<(intermediate_dir)', | 357 '-DOUT_DIR=<(intermediate_dir)', |
| 355 '-DRESOURCE_DIR=<(resource_dir)', | 358 '-DRESOURCE_DIR=<(resource_dir)', |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 427 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
| 425 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 428 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 426 ] | 429 ] |
| 427 }, | 430 }, |
| 428 { | 431 { |
| 429 'action_name': 'ant_obfuscate_<(_target_name)', | 432 'action_name': 'ant_obfuscate_<(_target_name)', |
| 430 'message': 'Obfuscating <(_target_name)', | 433 'message': 'Obfuscating <(_target_name)', |
| 431 'inputs': [ | 434 'inputs': [ |
| 432 '<(DEPTH)/build/android/ant/apk-obfuscate.xml', | 435 '<(DEPTH)/build/android/ant/apk-obfuscate.xml', |
| 433 '<(DEPTH)/build/android/ant/create-test-jar.js', | 436 '<(DEPTH)/build/android/ant/create-test-jar.js', |
| 437 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 438 '<(DEPTH)/build/android/gyp/ant.py', |
| 434 '<(compile_stamp)', | 439 '<(compile_stamp)', |
| 435 '>@(proguard_flags_paths)', | 440 '>@(proguard_flags_paths)', |
| 436 ], | 441 ], |
| 437 'outputs': [ | 442 'outputs': [ |
| 438 '<(obfuscate_stamp)', | 443 '<(obfuscate_stamp)', |
| 439 ], | 444 ], |
| 440 'action': [ | 445 'action': [ |
| 441 'ant', '-quiet', | 446 'python', '<(DEPTH)/build/android/gyp/ant.py', |
| 447 '-quiet', |
| 442 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', | 448 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', |
| 443 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 449 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
| 444 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 450 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| 445 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 451 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
| 446 '-DAPK_NAME=<(apk_name)', | 452 '-DAPK_NAME=<(apk_name)', |
| 447 '-DCREATE_TEST_JAR_PATH=<(DEPTH)/build/android/ant/create-test-jar.js', | 453 '-DCREATE_TEST_JAR_PATH=<(DEPTH)/build/android/ant/create-test-jar.js', |
| 448 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 454 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
| 449 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', | 455 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', |
| 450 '-DINPUT_JARS_PATHS=>(input_jars_paths)', | 456 '-DINPUT_JARS_PATHS=>(input_jars_paths)', |
| 451 '-DIS_TEST_APK=<(is_test_apk)', | 457 '-DIS_TEST_APK=<(is_test_apk)', |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 511 |
| 506 '>@(dex_inputs)', | 512 '>@(dex_inputs)', |
| 507 '>@(dex_generated_inputs)', | 513 '>@(dex_generated_inputs)', |
| 508 ] | 514 ] |
| 509 }, | 515 }, |
| 510 { | 516 { |
| 511 'action_name': 'ant_package_<(_target_name)', | 517 'action_name': 'ant_package_<(_target_name)', |
| 512 'message': 'Packaging <(_target_name).', | 518 'message': 'Packaging <(_target_name).', |
| 513 'inputs': [ | 519 'inputs': [ |
| 514 '<(DEPTH)/build/android/ant/apk-package.xml', | 520 '<(DEPTH)/build/android/ant/apk-package.xml', |
| 521 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 522 '<(DEPTH)/build/android/gyp/ant.py', |
| 515 '<(dex_path)', | 523 '<(dex_path)', |
| 516 '<(codegen_stamp)', | 524 '<(codegen_stamp)', |
| 517 '<(obfuscate_stamp)', | 525 '<(obfuscate_stamp)', |
| 518 '>@(package_input_paths)', | 526 '>@(package_input_paths)', |
| 519 ], | 527 ], |
| 520 'conditions': [ | 528 'conditions': [ |
| 521 ['is_test_apk == 1', { | 529 ['is_test_apk == 1', { |
| 522 'variables': { | 530 'variables': { |
| 523 'additional_res_dirs=': [], | 531 'additional_res_dirs=': [], |
| 524 'additional_res_packages=': [], | 532 'additional_res_packages=': [], |
| 525 } | 533 } |
| 526 }], | 534 }], |
| 527 ], | 535 ], |
| 528 'outputs': [ | 536 'outputs': [ |
| 529 '<(final_apk_path)', | 537 '<(final_apk_path)', |
| 530 ], | 538 ], |
| 531 'action': [ | 539 'action': [ |
| 532 'ant', '-quiet', | 540 'python', '<(DEPTH)/build/android/gyp/ant.py', |
| 541 '-quiet', |
| 533 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 542 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
| 534 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 543 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
| 535 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 544 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
| 536 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 545 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
| 537 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 546 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| 538 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 547 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
| 539 '-DAPKS_DIR=<(PRODUCT_DIR)/apks', | 548 '-DAPKS_DIR=<(PRODUCT_DIR)/apks', |
| 540 '-DAPK_NAME=<(apk_name)', | 549 '-DAPK_NAME=<(apk_name)', |
| 541 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', | 550 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
| 542 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', | 551 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
| 543 '-DASSET_DIR=<(asset_location)', | 552 '-DASSET_DIR=<(asset_location)', |
| 544 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 553 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
| 545 '-DKEYSTORE_PATH=<(DEPTH)/build/android/ant/chromium-debug.keystore', | 554 '-DKEYSTORE_PATH=<(DEPTH)/build/android/ant/chromium-debug.keystore', |
| 546 '-DOUT_DIR=<(intermediate_dir)', | 555 '-DOUT_DIR=<(intermediate_dir)', |
| 547 '-DRESOURCE_DIR=<(resource_dir)', | 556 '-DRESOURCE_DIR=<(resource_dir)', |
| 548 '-DSOURCE_DIR=<(java_in_dir)/src', | 557 '-DSOURCE_DIR=<(java_in_dir)/src', |
| 549 | 558 |
| 550 '-Dbasedir=.', | 559 '-Dbasedir=.', |
| 551 '-buildfile', | 560 '-buildfile', |
| 552 '<(DEPTH)/build/android/ant/apk-package.xml', | 561 '<(DEPTH)/build/android/ant/apk-package.xml', |
| 553 | 562 |
| 554 # Add list of inputs to the command line, so if inputs change | 563 # Add list of inputs to the command line, so if inputs change |
| 555 # (e.g. if a Java file is removed), the command will be re-run. | 564 # (e.g. if a Java file is removed), the command will be re-run. |
| 556 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 565 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| 557 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 566 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| 558 | |
| 559 ] | 567 ] |
| 560 }, | 568 }, |
| 561 ], | 569 ], |
| 562 } | 570 } |
| OLD | NEW |