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 }, | 89 }, |
81 'outputs': [ | 90 'outputs': [ |
82 '<(stripped_library_path)', | 91 '<(stripped_library_path)', |
83 ], | 92 ], |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 '-DANDROID_TOOLCHAIN=<(android_toolchain)', | 136 '-DANDROID_TOOLCHAIN=<(android_toolchain)', |
128 '-DCHROMIUM_SRC=<(ant_build_out)/../..', | 137 '-DCHROMIUM_SRC=<(ant_build_out)/../..', |
129 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 138 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
130 '-DPRODUCT_DIR=<(ant_build_out)', | 139 '-DPRODUCT_DIR=<(ant_build_out)', |
131 | 140 |
132 '-DAPK_NAME=<(apk_name)', | 141 '-DAPK_NAME=<(apk_name)', |
133 '-DASSET_DIR=<(asset_location)', | 142 '-DASSET_DIR=<(asset_location)', |
134 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', | 143 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', |
135 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', | 144 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', |
136 '-DINPUT_JARS_PATHS=>(input_jars_paths)', | 145 '-DINPUT_JARS_PATHS=>(input_jars_paths)', |
| 146 '-DJAR_NAME=<(jar_name)', |
137 '-DPACKAGE_NAME=<(package_name)', | 147 '-DPACKAGE_NAME=<(package_name)', |
138 '-DRESOURCE_DIR=<(resource_dir)', | 148 '-DRESOURCE_DIR=<(resource_dir)', |
139 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', | 149 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
140 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', | 150 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
141 '-DPROGUARD_FLAGS=>(proguard_flags)', | 151 '-DPROGUARD_FLAGS=>(proguard_flags)', |
142 '-DPROGUARD_ENABLED=>(proguard_enabled)', | 152 '-DPROGUARD_ENABLED=>(proguard_enabled)', |
143 | 153 |
144 '-Dbasedir=<(java_in_dir)', | 154 '-Dbasedir=<(java_in_dir)', |
145 '-buildfile', | 155 '-buildfile', |
146 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 156 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
147 | 157 |
148 # Specify CONFIGURATION_NAME as the target for ant to build. The | 158 # Specify CONFIGURATION_NAME as the target for ant to build. The |
149 # buildfile will then build the appropriate SDK tools target. | 159 # buildfile will then build the appropriate SDK tools target. |
150 '<(CONFIGURATION_NAME)', | 160 '<(CONFIGURATION_NAME)', |
151 ] | 161 ] |
152 }, | 162 }, |
153 ], | 163 ], |
154 } | 164 } |
OLD | NEW |