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/toolchain/toolchain.gni") | 5 import("//build/toolchain/toolchain.gni") |
6 | 6 |
7 if (is_android) { | 7 if (is_android) { |
8 import("//build/config/android/rules.gni") | 8 import("//build/config/android/rules.gni") |
| 9 import("//build/config/zip.gni") |
9 } | 10 } |
10 | 11 |
11 # Generate a binary Mojo application in a self-named directory. | 12 # Generate a binary Mojo application in a self-named directory. |
12 # Application resources are copied to a "resources" directory alongside the app. | 13 # Application resources are copied to a "resources" directory alongside the app. |
13 # The parameters of this template are those of a shared library. | 14 # The parameters of this template are those of a shared library. |
14 template("mojo_native_application") { | 15 template("mojo_native_application") { |
15 base_target_name = target_name | 16 base_target_name = target_name |
16 if (defined(invoker.output_name)) { | 17 if (defined(invoker.output_name)) { |
17 base_target_name = invoker.output_name | 18 base_target_name = invoker.output_name |
18 } | 19 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 if (defined(invoker.deps)) { | 198 if (defined(invoker.deps)) { |
198 deps = invoker.deps | 199 deps = invoker.deps |
199 } | 200 } |
200 } | 201 } |
201 mojo_deps += [ ":$copy_step_name" ] | 202 mojo_deps += [ ":$copy_step_name" ] |
202 } | 203 } |
203 | 204 |
204 zip_action_name = "${target_name}_zip" | 205 zip_action_name = "${target_name}_zip" |
205 zip_action_output = "$target_gen_dir/${target_name}.zip" | 206 zip_action_output = "$target_gen_dir/${target_name}.zip" |
206 prepend_action_name = target_name | 207 prepend_action_name = target_name |
207 action(zip_action_name) { | 208 zip(zip_action_name) { |
208 visibility = [ ":$prepend_action_name" ] | 209 visibility = [ ":$prepend_action_name" ] |
209 script = "//build/android/gn/zip.py" | |
210 | |
211 inputs = [ | 210 inputs = [ |
212 invoker.input_so, | 211 invoker.input_so, |
213 invoker.input_dex_jar, | 212 invoker.input_dex_jar, |
214 ] | 213 ] |
215 | |
216 output = zip_action_output | 214 output = zip_action_output |
217 outputs = [ | 215 forward_variables_from(invoker, |
218 output, | 216 [ |
219 ] | 217 "deps", |
220 | 218 "public_deps", |
221 rebase_inputs = rebase_path(inputs, root_build_dir) | 219 "data_deps", |
222 rebase_output = rebase_path(output, root_build_dir) | 220 ]) |
223 args = [ | |
224 "--inputs=$rebase_inputs", | |
225 "--output=$rebase_output", | |
226 ] | |
227 | |
228 if (defined(invoker.deps)) { | |
229 deps = invoker.deps | |
230 } | |
231 if (defined(invoker.public_deps)) { | |
232 public_deps = invoker.public_deps | |
233 } | |
234 if (defined(invoker.data_deps)) { | |
235 data_deps = invoker.data_deps | |
236 } | |
237 } | 221 } |
238 | 222 |
239 _mojo_output = | 223 _mojo_output = |
240 "${root_out_dir}/${base_target_name}/${base_target_name}.mojo" | 224 "${root_out_dir}/${base_target_name}/${base_target_name}.mojo" |
241 | 225 |
242 action(target_name) { | 226 action(target_name) { |
243 script = "//mojo/public/tools/prepend.py" | 227 script = "//mojo/public/tools/prepend.py" |
244 | 228 |
245 input = zip_action_output | 229 input = zip_action_output |
246 inputs = [ | 230 inputs = [ |
(...skipping 28 matching lines...) Expand all Loading... |
275 renaming_destinations = [ "${base_target_name}/${base_target_name}.mojo" ] | 259 renaming_destinations = [ "${base_target_name}/${base_target_name}.mojo" ] |
276 if (defined(invoker.resources)) { | 260 if (defined(invoker.resources)) { |
277 renaming_sources += invoker.resources | 261 renaming_sources += invoker.resources |
278 renaming_destinations += process_file_template( | 262 renaming_destinations += process_file_template( |
279 invoker.resources, | 263 invoker.resources, |
280 [ "$base_target_name/resources/{{source_file_part}}" ]) | 264 [ "$base_target_name/resources/{{source_file_part}}" ]) |
281 } | 265 } |
282 } | 266 } |
283 } | 267 } |
284 } | 268 } |
OLD | NEW |