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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 'input_jars_paths': [], | 60 'input_jars_paths': [], |
61 'additional_src_dirs': [], | 61 'additional_src_dirs': [], |
62 'generated_src_dirs': [], | 62 'generated_src_dirs': [], |
63 'app_manifest_version_name%': '<(android_app_version_name)', | 63 'app_manifest_version_name%': '<(android_app_version_name)', |
64 'app_manifest_version_code%': '<(android_app_version_code)', | 64 'app_manifest_version_code%': '<(android_app_version_code)', |
65 'proguard_enabled%': 'false', | 65 'proguard_enabled%': 'false', |
66 'proguard_flags%': '', | 66 'proguard_flags%': '', |
67 'native_libs_paths': [], | 67 'native_libs_paths': [], |
68 'manifest_package_name%': 'unknown.package.name', | 68 'manifest_package_name%': 'unknown.package.name', |
69 'resource_dir%':'', | 69 'resource_dir%':'', |
| 70 'jar_name%': 'chromium_apk_<(package_name).jar', |
70 }, | 71 }, |
71 'sources': [ | 72 'sources': [ |
72 '<@(native_libs_paths)' | 73 '<@(native_libs_paths)' |
73 ], | 74 ], |
| 75 # Pass the jar path to the apk's "fake" jar target. This would be better as |
| 76 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
| 77 # cannot be lifted in a dependent to all_dependent_settings. |
| 78 'all_dependent_settings': { |
| 79 'variables': { |
| 80 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| 81 }, |
| 82 }, |
74 'rules': [ | 83 'rules': [ |
75 { | 84 { |
76 'rule_name': 'copy_and_strip_native_libraries', | 85 'rule_name': 'copy_and_strip_native_libraries', |
77 'extension': 'so', | 86 'extension': 'so', |
78 'variables': { | 87 'variables': { |
79 'stripped_library_path': '<(PRODUCT_DIR)/<(package_name)/libs/<(android_
app_abi)/<(RULE_INPUT_ROOT).so', | 88 'stripped_library_path': '<(PRODUCT_DIR)/<(package_name)/libs/<(android_
app_abi)/<(RULE_INPUT_ROOT).so', |
80 'link_dir': '<(android_product_out)/symbols/data/data/<(manifest_package
_name)/lib/', | 89 'link_dir': '<(android_product_out)/symbols/data/data/<(manifest_package
_name)/lib/', |
81 }, | 90 }, |
82 'outputs': [ | 91 'outputs': [ |
83 '<(stripped_library_path)', | 92 '<(stripped_library_path)', |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 '-DANDROID_TOOLCHAIN=<(android_toolchain)', | 139 '-DANDROID_TOOLCHAIN=<(android_toolchain)', |
131 '-DCHROMIUM_SRC=<(ant_build_out)/../..', | 140 '-DCHROMIUM_SRC=<(ant_build_out)/../..', |
132 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 141 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
133 '-DPRODUCT_DIR=<(ant_build_out)', | 142 '-DPRODUCT_DIR=<(ant_build_out)', |
134 | 143 |
135 '-DAPK_NAME=<(apk_name)', | 144 '-DAPK_NAME=<(apk_name)', |
136 '-DASSET_DIR=<(asset_location)', | 145 '-DASSET_DIR=<(asset_location)', |
137 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', | 146 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', |
138 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', | 147 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', |
139 '-DINPUT_JARS_PATHS=>(input_jars_paths)', | 148 '-DINPUT_JARS_PATHS=>(input_jars_paths)', |
| 149 '-DJAR_NAME=<(jar_name)', |
140 '-DPACKAGE_NAME=<(package_name)', | 150 '-DPACKAGE_NAME=<(package_name)', |
141 '-DRESOURCE_DIR=<(resource_dir)', | 151 '-DRESOURCE_DIR=<(resource_dir)', |
142 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', | 152 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
143 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', | 153 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
144 '-DPROGUARD_FLAGS=>(proguard_flags)', | 154 '-DPROGUARD_FLAGS=>(proguard_flags)', |
145 '-DPROGUARD_ENABLED=>(proguard_enabled)', | 155 '-DPROGUARD_ENABLED=>(proguard_enabled)', |
146 | 156 |
147 '-Dbasedir=<(java_in_dir)', | 157 '-Dbasedir=<(java_in_dir)', |
148 '-buildfile', | 158 '-buildfile', |
149 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 159 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
150 | 160 |
151 # Specify CONFIGURATION_NAME as the target for ant to build. The | 161 # Specify CONFIGURATION_NAME as the target for ant to build. The |
152 # buildfile will then build the appropriate SDK tools target. | 162 # buildfile will then build the appropriate SDK tools target. |
153 '<(CONFIGURATION_NAME)', | 163 '<(CONFIGURATION_NAME)', |
154 ] | 164 ] |
155 }, | 165 }, |
156 ], | 166 ], |
157 } | 167 } |
OLD | NEW |