OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 | 6 |
7 assert(is_android) | 7 assert(is_android) |
8 | 8 |
9 | 9 |
10 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) | 10 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) |
11 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) | 11 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) |
12 rebased_android_sdk_build_tools = rebase_path(android_sdk_build_tools, root_buil
d_dir) | 12 rebased_android_sdk_build_tools = rebase_path(android_sdk_build_tools, root_buil
d_dir) |
13 | 13 |
14 | 14 |
15 # Write the target's .build_config file. This is a json file that contains a | 15 # Write the target's .build_config file. This is a json file that contains a |
16 # dictionary of information about how to build this target (things that | 16 # dictionary of information about how to build this target (things that |
17 # require knowledge about this target's dependencies and cannot be calculated | 17 # require knowledge about this target's dependencies and cannot be calculated |
18 # at gn-time). There is a special syntax to add a value in that dictionary to | 18 # at gn-time). There is a special syntax to add a value in that dictionary to |
19 # an action/action_foreachs args: | 19 # an action/action_foreachs args: |
20 # --python-arg=@($rebased_build_config_path:key0:key1) | 20 # --python-arg=@FileArg($rebased_build_config_path:key0:key1) |
21 # At runtime, such an arg will be replaced by the value in the build_config. | 21 # At runtime, such an arg will be replaced by the value in the build_config. |
22 # See build/android/gyp/write_build_config.py and | 22 # See build/android/gyp/write_build_config.py and |
23 # build/android/gyp/util/build_utils.py:ExpandFileArgs | 23 # build/android/gyp/util/build_utils.py:ExpandFileArgs |
24 template("write_build_config") { | 24 template("write_build_config") { |
25 assert(defined(invoker.type)) | 25 assert(defined(invoker.type)) |
26 assert(defined(invoker.base_path)) | 26 assert(defined(invoker.base_path)) |
27 | 27 |
28 base_path = invoker.base_path | 28 base_path = invoker.base_path |
29 type = invoker.type | 29 type = invoker.type |
30 build_config = base_path + ".build_config" | 30 build_config = base_path + ".build_config" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 sources = java_files + java_srcjars | 175 sources = java_files + java_srcjars |
176 inputs = system_jars + [ build_config ] | 176 inputs = system_jars + [ build_config ] |
177 | 177 |
178 rebase_system_jars = rebase_path(system_jars, root_build_dir) | 178 rebase_system_jars = rebase_path(system_jars, root_build_dir) |
179 rebase_java_srcjars = rebase_path(java_srcjars, root_build_dir) | 179 rebase_java_srcjars = rebase_path(java_srcjars, root_build_dir) |
180 rebase_build_config = rebase_path(build_config, root_build_dir) | 180 rebase_build_config = rebase_path(build_config, root_build_dir) |
181 rebase_depfile = rebase_path(depfile, root_build_dir) | 181 rebase_depfile = rebase_path(depfile, root_build_dir) |
182 args = [ | 182 args = [ |
183 "--depfile=$rebase_depfile", | 183 "--depfile=$rebase_depfile", |
184 "--classpath=$rebase_system_jars", | 184 "--classpath=$rebase_system_jars", |
185 "--classpath=@($rebase_build_config:javac:classpath)", | 185 "--classpath=@FileArg($rebase_build_config:javac:classpath)", |
186 "--jar-path=$rebase_jar_path", | 186 "--jar-path=$rebase_jar_path", |
187 "--java-srcjars=$rebase_java_srcjars", | 187 "--java-srcjars=$rebase_java_srcjars", |
188 "--java-srcjars=@($rebase_build_config:javac:srcjars)", | 188 "--java-srcjars=@FileArg($rebase_build_config:javac:srcjars)", |
189 "--jar-excluded-classes=$jar_excluded_patterns", | 189 "--jar-excluded-classes=$jar_excluded_patterns", |
190 ] | 190 ] |
191 if (chromium_code) { | 191 if (chromium_code) { |
192 args += [ "--chromium-code" ] | 192 args += [ "--chromium-code" ] |
193 } | 193 } |
194 | 194 |
195 args += rebase_path(java_files, root_build_dir) | 195 args += rebase_path(java_files, root_build_dir) |
196 } | 196 } |
197 | 197 |
198 # TODO(cjhopman): proguard | 198 # TODO(cjhopman): proguard |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 "--depfile", rebase_path(depfile, root_build_dir), | 293 "--depfile", rebase_path(depfile, root_build_dir), |
294 "--android-sdk", rebase_path(android_sdk, root_build_dir), | 294 "--android-sdk", rebase_path(android_sdk, root_build_dir), |
295 "--android-sdk-tools", rebase_path(android_sdk_build_tools, root_build_dir
), | 295 "--android-sdk-tools", rebase_path(android_sdk_build_tools, root_build_dir
), |
296 "--non-constant-id", | 296 "--non-constant-id", |
297 "--android-manifest", rebase_path(android_manifest, root_build_dir), | 297 "--android-manifest", rebase_path(android_manifest, root_build_dir), |
298 | 298 |
299 "--resource-dirs=$rebase_resource_dirs", | 299 "--resource-dirs=$rebase_resource_dirs", |
300 "--srcjar-out", rebase_path(srcjar_path, root_build_dir), | 300 "--srcjar-out", rebase_path(srcjar_path, root_build_dir), |
301 "--resource-zip-out", rebase_path(zip_path, root_build_dir), | 301 "--resource-zip-out", rebase_path(zip_path, root_build_dir), |
302 | 302 |
303 "--dependencies-res-zips=@($rebase_build_config:resources:dependency_zips)
", | 303 "--dependencies-res-zips=@FileArg($rebase_build_config:resources:dependenc
y_zips)", |
304 ] | 304 ] |
305 | 305 |
306 if (defined(invoker.custom_package)) { | 306 if (defined(invoker.custom_package)) { |
307 args += [ | 307 args += [ |
308 "--custom-package", invoker.custom_package, | 308 "--custom-package", invoker.custom_package, |
309 ] | 309 ] |
310 } | 310 } |
311 | 311 |
312 if (defined(invoker.v14_verify_only) && invoker.v14_verify_only) { | 312 if (defined(invoker.v14_verify_only) && invoker.v14_verify_only) { |
313 args += ["--v14-verify-only"] | 313 args += ["--v14-verify-only"] |
314 } | 314 } |
315 } | 315 } |
316 } | 316 } |
OLD | NEW |