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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 'instr_stamp': '<(intermediate_dir)/instr.stamp', | 91 'instr_stamp': '<(intermediate_dir)/instr.stamp', |
92 'jar_stamp': '<(intermediate_dir)/jar.stamp', | 92 'jar_stamp': '<(intermediate_dir)/jar.stamp', |
93 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', | 93 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', |
94 'strip_stamp': '<(intermediate_dir)/strip.stamp', | 94 'strip_stamp': '<(intermediate_dir)/strip.stamp', |
95 'classes_dir': '<(intermediate_dir)/classes', | 95 'classes_dir': '<(intermediate_dir)/classes', |
96 'classes_final_dir': '<(intermediate_dir)/classes_instr', | 96 'classes_final_dir': '<(intermediate_dir)/classes_instr', |
97 'javac_includes': [], | 97 'javac_includes': [], |
98 'jar_excluded_classes': [], | 98 'jar_excluded_classes': [], |
99 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 99 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
100 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 100 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
101 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | |
101 'dex_path': '<(intermediate_dir)/classes.dex', | 102 'dex_path': '<(intermediate_dir)/classes.dex', |
102 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 103 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
103 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 104 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
104 'push_stamp': '<(intermediate_dir)/push.stamp', | 105 'push_stamp': '<(intermediate_dir)/push.stamp', |
105 'link_stamp': '<(intermediate_dir)/link.stamp', | 106 'link_stamp': '<(intermediate_dir)/link.stamp', |
106 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', | 107 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', |
107 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', | 108 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', |
108 'resource_packaged_apk_name': '<(apk_name)-resources.ap_', | 109 'resource_packaged_apk_name': '<(apk_name)-resources.ap_', |
109 'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_n ame)', | 110 'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_n ame)', |
110 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | 111 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
578 'action_name': 'jar_<(_target_name)', | 579 'action_name': 'jar_<(_target_name)', |
579 'message': 'Creating <(_target_name) jar', | 580 'message': 'Creating <(_target_name) jar', |
580 'inputs': [ | 581 'inputs': [ |
581 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 582 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
582 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 583 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
583 '<(DEPTH)/build/android/gyp/jar.py', | 584 '<(DEPTH)/build/android/gyp/jar.py', |
584 '<(instr_stamp)', | 585 '<(instr_stamp)', |
585 ], | 586 ], |
586 'outputs': [ | 587 'outputs': [ |
587 '<(jar_stamp)', | 588 '<(jar_stamp)', |
589 '<(jar_path)', | |
588 ], | 590 ], |
589 'action': [ | 591 'action': [ |
590 'python', '<(DEPTH)/build/android/gyp/jar.py', | 592 'python', '<(DEPTH)/build/android/gyp/jar.py', |
591 '--classes-dir=<(classes_final_dir)', | 593 '--classes-dir=<(classes_final_dir)', |
592 '--jar-path=<(jar_path)', | 594 '--jar-path=<(jar_path)', |
593 '--excluded-classes=<(jar_excluded_classes)', | 595 '--excluded-classes=<(jar_excluded_classes)', |
594 '--stamp=<(jar_stamp)', | 596 '--stamp=<(jar_stamp)', |
595 ] | 597 ] |
596 }, | 598 }, |
597 { | 599 { |
598 'action_name': 'ant_obfuscate_<(_target_name)', | 600 'action_name': 'ant_obfuscate_<(_target_name)', |
Yaron
2014/06/11 00:11:04
nit: drop "ant_"
| |
599 'message': 'Obfuscating <(_target_name)', | 601 'message': 'Obfuscating <(_target_name)', |
602 'variables': { | |
603 'additional_obfuscate_options': [], | |
604 'proguard_out_dir': '<(intermediate_dir)/proguard', | |
605 'proguard_input_jar_paths': [ | |
606 '>@(input_jars_paths)', | |
607 '<(jar_path)', | |
608 ], | |
609 'conditions': [ | |
610 ['is_test_apk == 1', { | |
611 'additional_obfuscate_options': [ | |
612 '--testapp', | |
613 ], | |
614 }], | |
615 ['proguard_enabled == "true"', { | |
616 'additional_obfuscate_options': [ | |
617 '--proguard-enabled', | |
618 ], | |
619 }], | |
620 ], | |
621 }, | |
622 'conditions': [ | |
623 ['is_test_apk == 1', { | |
624 'outputs': [ | |
625 '<(test_jar_path)', | |
626 ], | |
627 }], | |
628 ], | |
600 'inputs': [ | 629 'inputs': [ |
601 '<(DEPTH)/build/android/ant/apk-obfuscate.xml', | 630 '<(DEPTH)/build/android/gyp/apk_obfuscate.py', |
602 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 631 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
603 '<(DEPTH)/build/android/gyp/ant.py', | |
604 '<(android_manifest_path)', | |
605 '>@(proguard_flags_paths)', | 632 '>@(proguard_flags_paths)', |
606 '<(instr_stamp)', | 633 '>@(proguard_input_jar_paths)', |
607 ], | 634 ], |
608 'outputs': [ | 635 'outputs': [ |
609 # This lists obfuscate_stamp instead of obfuscated_jar_path because | 636 # This lists obfuscate_stamp instead of obfuscated_jar_path because |
610 # ant only writes the latter if the md5 of the inputs changes. | 637 # ant only writes the latter if the md5 of the inputs changes. |
611 '<(obfuscate_stamp)', | 638 '<(obfuscate_stamp)', |
639 | |
640 # In non-Release builds, these paths will all be empty files. | |
641 '<(obfuscated_jar_path)', | |
642 '<(obfuscated_jar_path).dump', | |
643 '<(obfuscated_jar_path).seeds', | |
644 '<(obfuscated_jar_path).mapping', | |
645 '<(obfuscated_jar_path).usage', | |
612 ], | 646 ], |
613 'action': [ | 647 'action': [ |
614 'python', '<(DEPTH)/build/android/gyp/ant.py', | 648 'python', '<(DEPTH)/build/android/gyp/apk_obfuscate.py', |
615 '-quiet', | |
616 '-DANDROID_MANIFEST=<(android_manifest_path)', | |
617 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | |
618 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | |
619 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | |
620 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', | |
621 '-DAPK_NAME=<(apk_name)', | |
622 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | |
623 '-DINPUT_JARS_PATHS=>(input_jars_paths)', | |
624 '-DIS_TEST_APK=<(is_test_apk)', | |
625 '-DOBFUSCATED_JAR_PATH=<(obfuscated_jar_path)', | |
626 '-DOUT_DIR=<(intermediate_dir)', | |
627 '-DPROGUARD_ENABLED=<(proguard_enabled)', | |
628 '-DPROGUARD_FLAGS=<(proguard_flags_paths)', | |
629 '-DTEST_JAR_PATH=<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | |
630 | 649 |
631 '-DSTAMP=<(obfuscate_stamp)', | 650 '--configuration-name', '<(CONFIGURATION_NAME)', |
632 '-Dbasedir=.', | 651 |
633 '-buildfile', | 652 '--android-sdk', '<(android_sdk)', |
634 '<(DEPTH)/build/android/ant/apk-obfuscate.xml', | 653 '--android-sdk-tools', '<(android_sdk_tools)', |
654 '--android-sdk-jar', '<(android_sdk_jar)', | |
655 | |
656 '--input-jars-paths=>(proguard_input_jar_paths)', | |
657 '--test-jar-path', '<(test_jar_path)', | |
658 '--obfuscated-jar-path', '<(obfuscated_jar_path)', | |
659 | |
660 '--proguard-jar-path', '<(android_sdk_root)/tools/proguard/lib/proguard. jar', | |
661 | |
662 '--proguard-config-files=<(proguard_flags_paths)', | |
663 '--stamp', '<(obfuscate_stamp)', | |
664 | |
665 '<@(additional_obfuscate_options)', | |
635 ], | 666 ], |
636 }, | 667 }, |
637 { | 668 { |
638 'action_name': 'dex_<(_target_name)', | 669 'action_name': 'dex_<(_target_name)', |
639 'variables': { | 670 'variables': { |
640 'conditions': [ | 671 'conditions': [ |
641 ['emma_instrument != 0', { | 672 ['emma_instrument != 0', { |
642 'dex_no_locals': 1, | 673 'dex_no_locals': 1, |
643 'dex_input_paths': [ '<(emma_device_jar)' ], | 674 'dex_input_paths': [ '<(emma_device_jar)' ], |
644 }], | 675 }], |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
737 '-DEMMA_INSTRUMENT=<(emma_instrument)', | 768 '-DEMMA_INSTRUMENT=<(emma_instrument)', |
738 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', | 769 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', |
739 | 770 |
740 '-Dbasedir=.', | 771 '-Dbasedir=.', |
741 '-buildfile', | 772 '-buildfile', |
742 '<(DEPTH)/build/android/ant/apk-package.xml', | 773 '<(DEPTH)/build/android/ant/apk-package.xml', |
743 ] | 774 ] |
744 }, | 775 }, |
745 ], | 776 ], |
746 } | 777 } |
OLD | NEW |