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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 'all_dependent_settings': { | 78 'all_dependent_settings': { |
79 'variables': { | 79 'variables': { |
80 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 80 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
81 }, | 81 }, |
82 }, | 82 }, |
83 'rules': [ | 83 'rules': [ |
84 { | 84 { |
85 'rule_name': 'copy_and_strip_native_libraries', | 85 'rule_name': 'copy_and_strip_native_libraries', |
86 'extension': 'so', | 86 'extension': 'so', |
87 'variables': { | 87 'variables': { |
88 'stripped_library_path': '<(PRODUCT_DIR)/<(_target_name)/libs/<(android_
app_abi)/<(RULE_INPUT_ROOT).so', | 88 'apk_libraries_dir': '<(PRODUCT_DIR)/<(_target_name)/libs/<(android_app_
abi)', |
| 89 'stripped_library_path': '<(apk_libraries_dir)/<(RULE_INPUT_ROOT).so', |
89 }, | 90 }, |
| 91 'inputs': [ |
| 92 '<(DEPTH)/build/android/strip_library_for_apk.py', |
| 93 ], |
90 'outputs': [ | 94 'outputs': [ |
91 '<(stripped_library_path)', | 95 '<(stripped_library_path)', |
92 ], | 96 ], |
93 # There is no way to do 2 actions for each source library in gyp. So to | |
94 # both strip the library and create the link in <(link_dir) a separate | |
95 # script is required. | |
96 'action': [ | 97 'action': [ |
97 '<(DEPTH)/build/android/prepare_library_for_apk', | 98 'python', '<(DEPTH)/build/android/strip_library_for_apk.py', |
98 '<(android_strip)', | 99 '--android-strip=<(android_strip)', |
99 '<(RULE_INPUT_PATH)', | 100 '--android-strip-arg=--strip-unneeded', |
100 '<(stripped_library_path)', | 101 '--libraries-dir=<(SHARED_LIB_DIR)', |
| 102 '--stripped-libraries-dir=<(apk_libraries_dir)', |
| 103 '--library-file-name=<(RULE_INPUT_ROOT).so', |
101 ], | 104 ], |
102 }, | 105 }, |
103 ], | 106 ], |
104 'conditions': [ | 107 'conditions': [ |
105 ['R_package != ""', { | 108 ['R_package != ""', { |
106 'variables': { | 109 'variables': { |
107 # We generate R.java in package R_package (in addition to the package | 110 # We generate R.java in package R_package (in addition to the package |
108 # listed in the AndroidManifest.xml, which is unavoidable). | 111 # listed in the AndroidManifest.xml, which is unavoidable). |
109 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], | 112 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], |
110 'additional_res_packages': ['<(R_package)'], | 113 'additional_res_packages': ['<(R_package)'], |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 '-buildfile', | 208 '-buildfile', |
206 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 209 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
207 | 210 |
208 # Specify CONFIGURATION_NAME as the target for ant to build. The | 211 # Specify CONFIGURATION_NAME as the target for ant to build. The |
209 # buildfile will then build the appropriate SDK tools target. | 212 # buildfile will then build the appropriate SDK tools target. |
210 '<(CONFIGURATION_NAME)', | 213 '<(CONFIGURATION_NAME)', |
211 ] | 214 ] |
212 }, | 215 }, |
213 ], | 216 ], |
214 } | 217 } |
OLD | NEW |