Chromium Code Reviews| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 578 'action_name': 'jar_<(_target_name)', | 578 'action_name': 'jar_<(_target_name)', |
| 579 'message': 'Creating <(_target_name) jar', | 579 'message': 'Creating <(_target_name) jar', |
| 580 'inputs': [ | 580 'inputs': [ |
| 581 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 581 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 582 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 582 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
| 583 '<(DEPTH)/build/android/gyp/jar.py', | 583 '<(DEPTH)/build/android/gyp/jar.py', |
| 584 '<(instr_stamp)', | 584 '<(instr_stamp)', |
| 585 ], | 585 ], |
| 586 'outputs': [ | 586 'outputs': [ |
| 587 '<(jar_stamp)', | 587 '<(jar_stamp)', |
| 588 '<(jar_path)', | |
| 588 ], | 589 ], |
| 589 'action': [ | 590 'action': [ |
| 590 'python', '<(DEPTH)/build/android/gyp/jar.py', | 591 'python', '<(DEPTH)/build/android/gyp/jar.py', |
| 591 '--classes-dir=<(classes_final_dir)', | 592 '--classes-dir=<(classes_final_dir)', |
| 592 '--jar-path=<(jar_path)', | 593 '--jar-path=<(jar_path)', |
| 593 '--excluded-classes=<(jar_excluded_classes)', | 594 '--excluded-classes=<(jar_excluded_classes)', |
| 594 '--stamp=<(jar_stamp)', | 595 '--stamp=<(jar_stamp)', |
| 595 ] | 596 ] |
| 596 }, | 597 }, |
| 597 { | 598 { |
| 598 'action_name': 'ant_obfuscate_<(_target_name)', | 599 'action_name': 'ant_obfuscate_<(_target_name)', |
| 599 'message': 'Obfuscating <(_target_name)', | 600 'message': 'Obfuscating <(_target_name)', |
| 601 'variables': { | |
| 602 'additional_obfuscate_options': [], | |
| 603 'proguard_out_dir': '<(intermediate_dir)/proguard', | |
| 604 'proguard_input_jar_paths': [ | |
| 605 '>@(input_jars_paths)', | |
| 606 '<(jar_path)', | |
| 607 ], | |
| 608 'conditions': [ | |
| 609 ['is_test_apk == 1', { | |
| 610 'additional_obfuscate_options': [ | |
| 611 '--testapp', | |
| 612 ], | |
| 613 }], | |
| 614 ['proguard_enabled == "true"', { | |
| 615 'additional_obfuscate_options': [ | |
| 616 '--proguard-enabled', | |
| 617 ], | |
| 618 }], | |
| 619 ], | |
| 620 }, | |
| 600 'inputs': [ | 621 'inputs': [ |
| 601 '<(DEPTH)/build/android/ant/apk-obfuscate.xml', | 622 '<(DEPTH)/build/android/gyp/apk_obfuscate.py', |
| 602 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 623 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 603 '<(DEPTH)/build/android/gyp/ant.py', | |
| 604 '<(android_manifest_path)', | |
| 605 '>@(proguard_flags_paths)', | 624 '>@(proguard_flags_paths)', |
| 606 '<(instr_stamp)', | 625 '<(instr_stamp)', |
| 607 ], | 626 ], |
| 608 'outputs': [ | 627 'outputs': [ |
| 609 # This lists obfuscate_stamp instead of obfuscated_jar_path because | 628 # This lists obfuscate_stamp instead of obfuscated_jar_path because |
| 610 # ant only writes the latter if the md5 of the inputs changes. | 629 # ant only writes the latter if the md5 of the inputs changes. |
| 611 '<(obfuscate_stamp)', | 630 '<(obfuscate_stamp)', |
| 631 | |
| 632 # In non-Release builds, these paths will all be empty files. | |
| 633 '<(obfuscated_jar_path)', | |
| 634 '<(obfuscated_jar_path).dump', | |
| 635 '<(obfuscated_jar_path).seeds', | |
| 636 '<(obfuscated_jar_path).mapping', | |
| 637 '<(obfuscated_jar_path).usage', | |
| 638 | |
| 639 # test_jar_path | |
|
Yaron
2014/06/07 07:02:38
?
cjhopman
2014/06/10 17:10:16
Done.
| |
| 612 ], | 640 ], |
| 613 'action': [ | 641 'action': [ |
| 614 'python', '<(DEPTH)/build/android/gyp/ant.py', | 642 '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 | 643 |
| 631 '-DSTAMP=<(obfuscate_stamp)', | 644 '--configuration-name', '<(CONFIGURATION_NAME)', |
| 632 '-Dbasedir=.', | 645 |
| 633 '-buildfile', | 646 '--android-sdk', '<(android_sdk)', |
| 634 '<(DEPTH)/build/android/ant/apk-obfuscate.xml', | 647 '--android-sdk-tools', '<(android_sdk_tools)', |
| 648 '--android-sdk-jar', '<(android_sdk_jar)', | |
| 649 | |
| 650 '--input-jars-paths=>(proguard_input_jar_paths)', | |
| 651 | |
| 652 '--test-jar-path', '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | |
| 653 '--obfuscated-jar-path', '<(obfuscated_jar_path)', | |
| 654 | |
| 655 '--proguard-jar-path', '<(android_sdk_root)/tools/proguard/lib/proguard. jar', | |
| 656 | |
| 657 '--proguard-config-files=<(proguard_flags_paths)', | |
| 658 '--stamp', '<(obfuscate_stamp)', | |
| 659 | |
| 660 '<@(additional_obfuscate_options)', | |
| 635 ], | 661 ], |
| 636 }, | 662 }, |
| 637 { | 663 { |
| 638 'action_name': 'dex_<(_target_name)', | 664 'action_name': 'dex_<(_target_name)', |
| 639 'variables': { | 665 'variables': { |
| 640 'conditions': [ | 666 'conditions': [ |
| 641 ['emma_instrument != 0', { | 667 ['emma_instrument != 0', { |
| 642 'dex_no_locals': 1, | 668 'dex_no_locals': 1, |
| 643 'dex_input_paths': [ '<(emma_device_jar)' ], | 669 'dex_input_paths': [ '<(emma_device_jar)' ], |
| 644 }], | 670 }], |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 737 '-DEMMA_INSTRUMENT=<(emma_instrument)', | 763 '-DEMMA_INSTRUMENT=<(emma_instrument)', |
| 738 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', | 764 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', |
| 739 | 765 |
| 740 '-Dbasedir=.', | 766 '-Dbasedir=.', |
| 741 '-buildfile', | 767 '-buildfile', |
| 742 '<(DEPTH)/build/android/ant/apk-package.xml', | 768 '<(DEPTH)/build/android/ant/apk-package.xml', |
| 743 ] | 769 ] |
| 744 }, | 770 }, |
| 745 ], | 771 ], |
| 746 } | 772 } |
| OLD | NEW |