| 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)', |
| 100 '--android-strip-arg=--strip-unneeded', |
| 101 '--stripped-libraries-dir=<(apk_libraries_dir)', |
| 99 '<(RULE_INPUT_PATH)', | 102 '<(RULE_INPUT_PATH)', |
| 100 '<(stripped_library_path)', | |
| 101 ], | 103 ], |
| 102 }, | 104 }, |
| 103 ], | 105 ], |
| 104 'conditions': [ | 106 'conditions': [ |
| 105 ['R_package != ""', { | 107 ['R_package != ""', { |
| 106 'variables': { | 108 'variables': { |
| 107 # We generate R.java in package R_package (in addition to the package | 109 # We generate R.java in package R_package (in addition to the package |
| 108 # listed in the AndroidManifest.xml, which is unavoidable). | 110 # listed in the AndroidManifest.xml, which is unavoidable). |
| 109 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], | 111 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], |
| 110 'additional_res_packages': ['<(R_package)'], | 112 'additional_res_packages': ['<(R_package)'], |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 '-buildfile', | 212 '-buildfile', |
| 211 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 213 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
| 212 | 214 |
| 213 # Specify CONFIGURATION_NAME as the target for ant to build. The | 215 # Specify CONFIGURATION_NAME as the target for ant to build. The |
| 214 # buildfile will then build the appropriate SDK tools target. | 216 # buildfile will then build the appropriate SDK tools target. |
| 215 '<(CONFIGURATION_NAME)', | 217 '<(CONFIGURATION_NAME)', |
| 216 ] | 218 ] |
| 217 }, | 219 }, |
| 218 ], | 220 ], |
| 219 } | 221 } |
| OLD | NEW |