OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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("//third_party/mojo/src/mojo/public/mojo_application.gni") | 5 import("//third_party/mojo/src/mojo/public/mojo_application.gni") |
6 | 6 |
7 # Used for mojo applications that have resources. This creates a directory | 7 # Used for mojo applications that have resources. This creates a directory |
8 # named output_name with the following contents: | 8 # named output_name with the following contents: |
9 # output_name.mojo : the shared library | 9 # output_name.mojo : the shared library |
10 # resources : resources | 10 # resources : resources |
11 template("mojo_application_package") { | 11 template("mojo_application_package") { |
12 mojo_deps = [] | 12 mojo_deps = [] |
13 if (defined(invoker.deps)) { | 13 if (defined(invoker.deps)) { |
14 mojo_deps += invoker.deps | 14 mojo_deps += invoker.deps |
15 } | 15 } |
16 | 16 |
17 if (defined(invoker.resources)) { | 17 if (defined(invoker.resources)) { |
18 output_name = target_name | 18 output_name = target_name |
19 if (defined(invoker.output_name)) { | 19 if (defined(invoker.output_name)) { |
20 output_name = invoker.output_name | 20 output_name = invoker.output_name |
21 } | 21 } |
22 | 22 |
23 copy_step_name = "${target_name}__copy_resources" | 23 copy("copy_mojo_application_resources") { |
24 copy(copy_step_name) { | |
25 sources = invoker.resources | 24 sources = invoker.resources |
26 outputs = [ | 25 outputs = [ |
27 "$root_out_dir/$output_name/resources/{{source_file_part}}", | 26 "$root_out_dir/$output_name/resources/{{source_file_part}}", |
28 ] | 27 ] |
29 if (defined(invoker.testonly)) { | |
30 testonly = invoker.testonly | |
31 } | |
32 deps = mojo_deps | |
33 } | 28 } |
34 mojo_deps += [ ":$copy_step_name" ] | 29 mojo_deps += [ ":copy_mojo_application_resources" ] |
35 } | 30 } |
36 | 31 |
37 mojo_native_application(target_name) { | 32 mojo_native_application(target_name) { |
38 output_name = invoker.target_name | 33 output_name = invoker.target_name |
39 if (defined(invoker.output_name)) { | 34 if (defined(invoker.output_name)) { |
40 output_name = invoker.output_name | 35 output_name = invoker.output_name |
41 } | 36 } |
42 output_name = output_name + "/" + output_name | 37 output_name = output_name + "/" + output_name |
43 | 38 |
44 deps = mojo_deps | 39 deps = mojo_deps |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 public = invoker.public | 99 public = invoker.public |
105 } | 100 } |
106 if (defined(invoker.sources)) { | 101 if (defined(invoker.sources)) { |
107 sources = invoker.sources | 102 sources = invoker.sources |
108 } | 103 } |
109 if (defined(invoker.testonly)) { | 104 if (defined(invoker.testonly)) { |
110 testonly = invoker.testonly | 105 testonly = invoker.testonly |
111 } | 106 } |
112 } | 107 } |
113 } | 108 } |
OLD | NEW |