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 import("//build/config/zip.gni") |
6 import("//third_party/ijar/ijar.gni") | 7 import("//third_party/ijar/ijar.gni") |
7 | 8 |
8 assert(is_android) | 9 assert(is_android) |
9 | 10 |
10 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) | 11 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) |
11 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) | 12 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) |
12 rebased_android_sdk_build_tools = | 13 rebased_android_sdk_build_tools = |
13 rebase_path(android_sdk_build_tools, root_build_dir) | 14 rebase_path(android_sdk_build_tools, root_build_dir) |
14 | 15 |
15 android_sdk_jar = "$android_sdk/android.jar" | 16 android_sdk_jar = "$android_sdk/android.jar" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (defined(invoker.args)) { | 206 if (defined(invoker.args)) { |
206 args += invoker.args | 207 args += invoker.args |
207 } | 208 } |
208 | 209 |
209 if (defined(invoker.sources)) { | 210 if (defined(invoker.sources)) { |
210 args += rebase_path(invoker.sources, root_build_dir) | 211 args += rebase_path(invoker.sources, root_build_dir) |
211 } | 212 } |
212 } | 213 } |
213 } | 214 } |
214 | 215 |
215 # Creates a zip archive of the inputs. | |
216 # If base_dir is provided, the archive paths will be relative to it. | |
217 template("zip") { | |
218 set_sources_assignment_filter([]) | |
219 assert(defined(invoker.inputs)) | |
220 assert(defined(invoker.output)) | |
221 | |
222 rebase_inputs = rebase_path(invoker.inputs, root_build_dir) | |
223 rebase_output = rebase_path(invoker.output, root_build_dir) | |
224 action(target_name) { | |
225 forward_variables_from(invoker, | |
226 [ | |
227 "data_deps", | |
228 "deps", | |
229 "public_deps", | |
230 "inputs", | |
231 "testonly", | |
232 "visibility", | |
233 ]) | |
234 script = "//build/android/gn/zip.py" | |
235 depfile = "$target_gen_dir/$target_name.d" | |
236 outputs = [ | |
237 depfile, | |
238 invoker.output, | |
239 ] | |
240 args = [ | |
241 "--depfile", | |
242 rebase_path(depfile, root_build_dir), | |
243 "--inputs=$rebase_inputs", | |
244 "--output=$rebase_output", | |
245 ] | |
246 if (defined(invoker.base_dir)) { | |
247 args += [ | |
248 "--base-dir", | |
249 rebase_path(invoker.base_dir, root_build_dir), | |
250 ] | |
251 } | |
252 } | |
253 } | |
254 | |
255 # Write the target's .build_config file. This is a json file that contains a | 216 # Write the target's .build_config file. This is a json file that contains a |
256 # dictionary of information about how to build this target (things that | 217 # dictionary of information about how to build this target (things that |
257 # require knowledge about this target's dependencies and cannot be calculated | 218 # require knowledge about this target's dependencies and cannot be calculated |
258 # at gn-time). There is a special syntax to add a value in that dictionary to | 219 # at gn-time). There is a special syntax to add a value in that dictionary to |
259 # an action/action_foreachs args: | 220 # an action/action_foreachs args: |
260 # --python-arg=@FileArg($rebased_build_config_path:key0:key1) | 221 # --python-arg=@FileArg($rebased_build_config_path:key0:key1) |
261 # At runtime, such an arg will be replaced by the value in the build_config. | 222 # At runtime, such an arg will be replaced by the value in the build_config. |
262 # See build/android/gyp/write_build_config.py and | 223 # See build/android/gyp/write_build_config.py and |
263 # build/android/gyp/util/build_utils.py:ExpandFileArgs | 224 # build/android/gyp/util/build_utils.py:ExpandFileArgs |
264 template("write_build_config") { | 225 template("write_build_config") { |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1628 ] | 1589 ] |
1629 args = [ | 1590 args = [ |
1630 "--depfile", | 1591 "--depfile", |
1631 rebase_path(depfile, root_build_dir), | 1592 rebase_path(depfile, root_build_dir), |
1632 "--script-output-path", | 1593 "--script-output-path", |
1633 rebase_path(generated_script, root_build_dir), | 1594 rebase_path(generated_script, root_build_dir), |
1634 ] | 1595 ] |
1635 args += test_runner_args | 1596 args += test_runner_args |
1636 } | 1597 } |
1637 } | 1598 } |
OLD | NEW |