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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 # library will be included in the apk. | 43 # library will be included in the apk. |
44 # resource_dir - The directory for resources. | 44 # resource_dir - The directory for resources. |
45 # R_package - A custom Java package to generate the resource file R.java in. | 45 # R_package - A custom Java package to generate the resource file R.java in. |
46 # By default, the package given in AndroidManifest.xml will be used. | 46 # By default, the package given in AndroidManifest.xml will be used. |
47 # java_strings_grd - The name of the grd file from which to generate localized | 47 # java_strings_grd - The name of the grd file from which to generate localized |
48 # strings.xml files, if any. | 48 # strings.xml files, if any. |
49 # library_manifest_paths'- Paths to additional AndroidManifest.xml files from | 49 # library_manifest_paths'- Paths to additional AndroidManifest.xml files from |
50 # libraries. | 50 # libraries. |
51 | 51 |
52 { | 52 { |
53 'variables': { | 53 'variables': { |
Yaron
2013/04/09 05:37:16
In a follow-up patch, we should split out the expe
cjhopman
2013/04/09 15:49:47
Agreed.
| |
54 'additional_input_paths': [], | 54 'additional_input_paths': [], |
55 'input_jars_paths': [], | 55 'input_jars_paths': [], |
56 'library_dexed_jars_paths': [], | 56 'library_dexed_jars_paths': [], |
57 'additional_src_dirs': [], | 57 'additional_src_dirs': [], |
58 'generated_src_dirs': [], | 58 'generated_src_dirs': [], |
59 'app_manifest_version_name%': '<(android_app_version_name)', | 59 'app_manifest_version_name%': '<(android_app_version_name)', |
60 'app_manifest_version_code%': '<(android_app_version_code)', | 60 'app_manifest_version_code%': '<(android_app_version_code)', |
61 'proguard_enabled%': 'false', | 61 'proguard_enabled%': 'false', |
62 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'], | 62 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'], |
63 'native_lib_target%': '', | 63 'native_lib_target%': '', |
(...skipping 30 matching lines...) Expand all Loading... | |
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 'codegen_input_paths': [], | 103 'codegen_input_paths': [], |
104 'keystore_path': '<(DEPTH)/build/android/ant/chromium-debug.keystore', | |
105 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | |
104 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 106 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
105 'source_dir': '<(java_in_dir)/src', | 107 'source_dir': '<(java_in_dir)/src', |
106 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', | 108 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', |
107 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', | 109 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', |
108 }, | 110 }, |
109 # Pass the jar path to the apk's "fake" jar target. This would be better as | 111 # Pass the jar path to the apk's "fake" jar target. This would be better as |
110 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 112 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
111 # cannot be lifted in a dependent to all_dependent_settings. | 113 # cannot be lifted in a dependent to all_dependent_settings. |
112 'all_dependent_settings': { | 114 'all_dependent_settings': { |
113 'variables': { | 115 'variables': { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 552 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
551 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 553 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
552 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 554 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
553 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 555 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
554 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 556 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
555 '-DAPK_NAME=<(apk_name)', | 557 '-DAPK_NAME=<(apk_name)', |
556 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', | 558 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
557 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', | 559 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
558 '-DASSET_DIR=<(asset_location)', | 560 '-DASSET_DIR=<(asset_location)', |
559 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 561 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
560 '-DFINAL_APK_PATH=<(final_apk_path)', | |
561 '-DKEYSTORE_PATH=<(DEPTH)/build/android/ant/chromium-debug.keystore', | |
562 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', | 562 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', |
563 '-DOUT_DIR=<(intermediate_dir)', | 563 '-DOUT_DIR=<(intermediate_dir)', |
564 '-DRESOURCE_DIR=<(resource_dir)', | 564 '-DRESOURCE_DIR=<(resource_dir)', |
565 '-DSOURCE_DIR=<(source_dir)', | 565 '-DSOURCE_DIR=<(source_dir)', |
566 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)', | |
Yaron
2013/04/09 05:37:16
Where is this used? Oh, it looks like out.packaged
cjhopman
2013/04/09 15:49:47
Done.
| |
566 | 567 |
567 '-Dbasedir=.', | 568 '-Dbasedir=.', |
568 '-buildfile', | 569 '-buildfile', |
569 '<(DEPTH)/build/android/ant/apk-package.xml', | 570 '<(DEPTH)/build/android/ant/apk-package.xml', |
570 | 571 |
571 # Add list of inputs to the command line, so if inputs change | 572 # Add list of inputs to the command line, so if inputs change |
572 # (e.g. if a Java file is removed), the command will be re-run. | 573 # (e.g. if a Java file is removed), the command will be re-run. |
573 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 574 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
574 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 575 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
575 ] | 576 ] |
576 }, | 577 }, |
578 { | |
579 'action_name': 'finalize_apk', | |
580 'message': 'Signing/aligning <(_target_name) APK.', | |
581 'inputs': [ | |
582 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
583 '<(DEPTH)/build/android/gyp/finalize_apk.py', | |
584 '<(unsigned_apk_path)', | |
585 ], | |
586 'outputs': [ | |
587 '<(final_apk_path)', | |
588 ], | |
589 'action': [ | |
590 'python', '<(DEPTH)/build/android/gyp/finalize_apk.py', | |
591 '--android-sdk-root=<(android_sdk_root)', | |
592 '--unsigned-apk-path=<(unsigned_apk_path)', | |
593 '--final-apk-path=<(final_apk_path)', | |
594 '--keystore-path=<(keystore_path)', | |
595 | |
596 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | |
597 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | |
598 ], | |
599 }, | |
577 ], | 600 ], |
578 } | 601 } |
OLD | NEW |