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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 'strip_stamp': '<(intermediate_dir)/strip.stamp', | 93 'strip_stamp': '<(intermediate_dir)/strip.stamp', |
94 'classes_dir': '<(intermediate_dir)/classes', | 94 'classes_dir': '<(intermediate_dir)/classes', |
95 'javac_includes': [], | 95 'javac_includes': [], |
96 'jar_excluded_classes': [], | 96 'jar_excluded_classes': [], |
97 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 97 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
98 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 98 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
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 'codegen_input_paths': [], | 104 'codegen_input_paths': [], |
104 'keystore_path': '<(DEPTH)/build/android/ant/chromium-debug.keystore', | 105 'keystore_path': '<(DEPTH)/build/android/ant/chromium-debug.keystore', |
105 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | 106 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
106 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 107 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
107 'source_dir': '<(java_in_dir)/src', | 108 'source_dir': '<(java_in_dir)/src', |
108 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', | 109 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', |
109 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', | 110 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', |
110 }, | 111 }, |
111 # Pass the jar path to the apk's "fake" jar target. This would be better as | 112 # Pass the jar path to the apk's "fake" jar target. This would be better as |
112 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 113 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 'additional_res_dirs=': [], | 339 'additional_res_dirs=': [], |
339 'additional_res_packages=': [], | 340 'additional_res_packages=': [], |
340 } | 341 } |
341 }], | 342 }], |
342 ], | 343 ], |
343 'inputs': [ | 344 'inputs': [ |
344 '<(DEPTH)/build/android/ant/apk-codegen.xml', | 345 '<(DEPTH)/build/android/ant/apk-codegen.xml', |
345 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 346 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
346 '<(DEPTH)/build/android/gyp/ant.py', | 347 '<(DEPTH)/build/android/gyp/ant.py', |
347 '<(android_manifest_path)', | 348 '<(android_manifest_path)', |
348 '>@(library_manifest_paths)' | 349 '>@(additional_input_paths)', |
349 '>@(codegen_input_paths)', | 350 '>@(codegen_input_paths)', |
350 '>@(additional_input_paths)', | 351 '>@(library_manifest_paths)', |
| 352 '>@(resource_input_paths)', |
351 ], | 353 ], |
352 'outputs': [ | 354 'outputs': [ |
353 '<(codegen_stamp)', | 355 '<(codegen_stamp)', |
354 ], | 356 ], |
355 'action': [ | 357 'action': [ |
356 'python', '<(DEPTH)/build/android/gyp/ant.py', | 358 'python', '<(DEPTH)/build/android/gyp/ant.py', |
357 '-quiet', | 359 '-quiet', |
358 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 360 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
359 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 361 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
360 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 362 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 '--android-sdk-root=<(android_sdk_root)', | 518 '--android-sdk-root=<(android_sdk_root)', |
517 | 519 |
518 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 520 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
519 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 521 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
520 | 522 |
521 '>@(dex_inputs)', | 523 '>@(dex_inputs)', |
522 '>@(dex_generated_inputs)', | 524 '>@(dex_generated_inputs)', |
523 ] | 525 ] |
524 }, | 526 }, |
525 { | 527 { |
526 'action_name': 'ant_package_<(_target_name)', | 528 'action_name': 'ant package resources', |
527 'message': 'Packaging <(_target_name).', | 529 'message': 'Packaging resources for <(_target_name) APK.', |
528 'inputs': [ | 530 'inputs': [ |
529 '<(DEPTH)/build/android/ant/apk-package.xml', | 531 '<(DEPTH)/build/android/ant/apk-package-resources.xml', |
530 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 532 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
531 '<(DEPTH)/build/android/gyp/ant.py', | 533 '<(DEPTH)/build/android/gyp/ant.py', |
532 '<(dex_path)', | 534 '<(android_manifest_path)', |
533 '<(codegen_stamp)', | 535 '<(codegen_stamp)', |
534 '<(obfuscate_stamp)', | 536 |
535 '>@(package_input_paths)', | 537 '>@(library_manifest_paths)', |
| 538 '>@(additional_input_paths)', |
536 ], | 539 ], |
537 'conditions': [ | 540 'conditions': [ |
538 ['is_test_apk == 1', { | 541 ['is_test_apk == 1', { |
539 'variables': { | 542 'variables': { |
540 'additional_res_dirs=': [], | 543 'additional_res_dirs=': [], |
541 'additional_res_packages=': [], | 544 'additional_res_packages=': [], |
542 } | 545 } |
543 }], | 546 }], |
544 ], | 547 ], |
545 'outputs': [ | 548 'outputs': [ |
546 '<(unsigned_apk_path)', | 549 '<(package_resources_stamp)', |
547 ], | 550 ], |
548 'action': [ | 551 'action': [ |
549 'python', '<(DEPTH)/build/android/gyp/ant.py', | 552 'python', '<(DEPTH)/build/android/gyp/ant.py', |
550 '-quiet', | 553 '-quiet', |
551 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 554 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
552 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 555 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
553 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 556 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
554 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 557 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
555 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 558 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
556 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | |
557 '-DAPK_NAME=<(apk_name)', | 559 '-DAPK_NAME=<(apk_name)', |
558 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', | 560 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
559 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', | 561 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
560 '-DASSET_DIR=<(asset_location)', | 562 '-DASSET_DIR=<(asset_location)', |
561 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 563 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
| 564 '-DOUT_DIR=<(intermediate_dir)', |
| 565 '-DRESOURCE_DIR=<(resource_dir)', |
| 566 |
| 567 '-DSTAMP=<(package_resources_stamp)', |
| 568 |
| 569 '-Dbasedir=.', |
| 570 '-buildfile', |
| 571 '<(DEPTH)/build/android/ant/apk-package-resources.xml', |
| 572 |
| 573 # Add list of inputs to the command line, so if inputs change |
| 574 # (e.g. if a Java file is removed), the command will be re-run. |
| 575 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| 576 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| 577 ] |
| 578 }, |
| 579 { |
| 580 'action_name': 'ant_package_<(_target_name)', |
| 581 'message': 'Packaging <(_target_name).', |
| 582 'inputs': [ |
| 583 '<(DEPTH)/build/android/ant/apk-package.xml', |
| 584 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 585 '<(DEPTH)/build/android/gyp/ant.py', |
| 586 '<(dex_path)', |
| 587 '<(codegen_stamp)', |
| 588 '<(obfuscate_stamp)', |
| 589 '<(package_resources_stamp)', |
| 590 '>@(package_input_paths)', |
| 591 ], |
| 592 'outputs': [ |
| 593 '<(unsigned_apk_path)', |
| 594 ], |
| 595 'action': [ |
| 596 'python', '<(DEPTH)/build/android/gyp/ant.py', |
| 597 '-quiet', |
| 598 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| 599 '-DAPK_NAME=<(apk_name)', |
| 600 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
562 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', | 601 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', |
563 '-DOUT_DIR=<(intermediate_dir)', | 602 '-DOUT_DIR=<(intermediate_dir)', |
564 '-DRESOURCE_DIR=<(resource_dir)', | |
565 '-DSOURCE_DIR=<(source_dir)', | 603 '-DSOURCE_DIR=<(source_dir)', |
566 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)', | 604 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)', |
567 | 605 |
568 '-Dbasedir=.', | 606 '-Dbasedir=.', |
569 '-buildfile', | 607 '-buildfile', |
570 '<(DEPTH)/build/android/ant/apk-package.xml', | 608 '<(DEPTH)/build/android/ant/apk-package.xml', |
571 | 609 |
572 # Add list of inputs to the command line, so if inputs change | 610 # Add list of inputs to the command line, so if inputs change |
573 # (e.g. if a Java file is removed), the command will be re-run. | 611 # (e.g. if a Java file is removed), the command will be re-run. |
574 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 612 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
(...skipping 17 matching lines...) Expand all Loading... |
592 '--unsigned-apk-path=<(unsigned_apk_path)', | 630 '--unsigned-apk-path=<(unsigned_apk_path)', |
593 '--final-apk-path=<(final_apk_path)', | 631 '--final-apk-path=<(final_apk_path)', |
594 '--keystore-path=<(keystore_path)', | 632 '--keystore-path=<(keystore_path)', |
595 | 633 |
596 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 634 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
597 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 635 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
598 ], | 636 ], |
599 }, | 637 }, |
600 ], | 638 ], |
601 } | 639 } |
OLD | NEW |