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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 'message': 'Obfuscating <(_target_name)', | 616 'message': 'Obfuscating <(_target_name)', |
617 'inputs': [ | 617 'inputs': [ |
618 '<(DEPTH)/build/android/ant/apk-obfuscate.xml', | 618 '<(DEPTH)/build/android/ant/apk-obfuscate.xml', |
619 '<(DEPTH)/build/android/ant/create-test-jar.js', | 619 '<(DEPTH)/build/android/ant/create-test-jar.js', |
620 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 620 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
621 '<(DEPTH)/build/android/gyp/ant.py', | 621 '<(DEPTH)/build/android/gyp/ant.py', |
622 '<(instr_stamp)', | 622 '<(instr_stamp)', |
623 '>@(proguard_flags_paths)', | 623 '>@(proguard_flags_paths)', |
624 ], | 624 ], |
625 'outputs': [ | 625 'outputs': [ |
| 626 # This lists obfuscate_stamp instead of obfuscated_jar_path because |
| 627 # ant only writes the latter if the md5 of the inputs changes. |
626 '<(obfuscate_stamp)', | 628 '<(obfuscate_stamp)', |
627 ], | 629 ], |
628 'action': [ | 630 'action': [ |
629 'python', '<(DEPTH)/build/android/gyp/ant.py', | 631 'python', '<(DEPTH)/build/android/gyp/ant.py', |
630 '-quiet', | 632 '-quiet', |
631 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', | 633 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', |
632 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 634 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
633 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 635 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
634 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 636 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
635 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', | 637 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', |
(...skipping 18 matching lines...) Expand all Loading... |
654 # Add list of inputs to the command line, so if inputs change | 656 # Add list of inputs to the command line, so if inputs change |
655 # (e.g. if a Java file is removed), the command will be re-run. | 657 # (e.g. if a Java file is removed), the command will be re-run. |
656 # 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. |
657 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 659 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
658 ], | 660 ], |
659 }, | 661 }, |
660 { | 662 { |
661 'action_name': 'dex_<(_target_name)', | 663 'action_name': 'dex_<(_target_name)', |
662 'variables': { | 664 'variables': { |
663 'conditions': [ | 665 'conditions': [ |
664 ['proguard_enabled == "true"', { | |
665 'input_paths': [ '<(obfuscate_stamp)' ], | |
666 'proguard_enabled_input_path': '<(obfuscated_jar_path)', | |
667 }], | |
668 ['emma_instrument != 0', { | 666 ['emma_instrument != 0', { |
669 'dex_no_locals': 1, | 667 'dex_no_locals': 1, |
670 }], | 668 }], |
671 ['emma_instrument != 0 and is_test_apk == 0', { | 669 ['emma_instrument != 0 and is_test_apk == 0', { |
672 'dex_input_paths': [ '<(emma_device_jar)' ], | 670 'dex_input_paths': [ '<(emma_device_jar)' ], |
673 }], | 671 }], |
674 ], | 672 ], |
675 'input_paths': [ '<(instr_stamp)' ], | |
676 'dex_input_paths': [ '>@(library_dexed_jars_paths)' ], | 673 'dex_input_paths': [ '>@(library_dexed_jars_paths)' ], |
677 'dex_generated_input_dirs': [ '<(classes_final_dir)' ], | 674 'dex_generated_input_dirs': [ '<(classes_final_dir)' ], |
678 'output_path': '<(dex_path)', | 675 'output_path': '<(dex_path)', |
| 676 'proguard_enabled_input_path': '<(obfuscated_jar_path)', |
679 }, | 677 }, |
| 678 'conditions': [ |
| 679 ['proguard_enabled == "true"', { 'inputs': [ '<(obfuscate_stamp)' ] }, |
| 680 { 'inputs': [ '<(instr_stamp)' ] }], |
| 681 ], |
680 'includes': [ 'android/dex_action.gypi' ], | 682 'includes': [ 'android/dex_action.gypi' ], |
681 }, | 683 }, |
682 { | 684 { |
683 'action_name': 'ant package resources', | 685 'action_name': 'ant package resources', |
684 'message': 'Packaging resources for <(_target_name) APK', | 686 'message': 'Packaging resources for <(_target_name) APK', |
685 'inputs': [ | 687 'inputs': [ |
686 '<(DEPTH)/build/android/ant/apk-package-resources.xml', | 688 '<(DEPTH)/build/android/ant/apk-package-resources.xml', |
687 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 689 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
688 '<(DEPTH)/build/android/gyp/ant.py', | 690 '<(DEPTH)/build/android/gyp/ant.py', |
689 '<(android_manifest_path)', | 691 '<(android_manifest_path)', |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 '<(DEPTH)/build/android/ant/apk-package.xml', | 769 '<(DEPTH)/build/android/ant/apk-package.xml', |
768 | 770 |
769 # Add list of inputs to the command line, so if inputs change | 771 # Add list of inputs to the command line, so if inputs change |
770 # (e.g. if a Java file is removed), the command will be re-run. | 772 # (e.g. if a Java file is removed), the command will be re-run. |
771 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 773 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
772 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 774 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
773 ] | 775 ] |
774 }, | 776 }, |
775 ], | 777 ], |
776 } | 778 } |
OLD | NEW |