OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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("//mojo/public/mojo_constants.gni") | 5 import("//mojo/public/mojo_constants.gni") |
6 | 6 |
7 # Used to produce a Mojo Application Manifest for an application. | 7 # Used to produce a Mojo Application Manifest for an application. |
8 # | 8 # |
9 # Parameters: | 9 # Parameters: |
10 # | 10 # |
11 # source | 11 # source |
12 # The manifest file template for this application, must be valid JSON with | 12 # The manifest file template for this application, must be valid JSON with |
13 # a valid 'url' key matching application_name. | 13 # a valid 'url' key matching application_name. |
14 # | 14 # |
| 15 # base_manifest (optional) |
| 16 # A manifest file template to use as a base for |source|. Any properties |
| 17 # defined in |source| will overwrite or be merged with properties defined |
| 18 # in |base_manifest|. |
| 19 # |
15 # application_name | 20 # application_name |
16 # The host portion of the mojo: URL of the application. The script | 21 # The host portion of the mojo: URL of the application. The script |
17 # validates that the value of this parameter matches the host name portion | 22 # validates that the value of this parameter matches the host name portion |
18 # of the 'url' property set in the manifest and throws a ValueError if | 23 # of the 'url' property set in the manifest and throws a ValueError if |
19 # they do not. | 24 # they do not. |
20 # | 25 # |
| 26 # base_deps (optional) |
| 27 # Dependencies required to generate |base_manifest| if applicable. |
| 28 # |
21 # deps (optional) | 29 # deps (optional) |
22 # An array of dependent instances of this template. This template enforces | 30 # An array of dependent instances of this template. This template enforces |
23 # that dependencies can only be instances of this template. | 31 # that dependencies can only be instances of this template. |
24 # | 32 # |
25 # packaged_applications (optional) | 33 # packaged_applications (optional) |
26 # An array of application_names of the dependent applications. | 34 # An array of application_names of the dependent applications. |
27 # | 35 # |
28 # type (default is mojo) | 36 # type (default is mojo) |
29 # Possible values are 'mojo' and 'exe'. Default is 'mojo'. | 37 # Possible values are 'mojo' and 'exe'. Default is 'mojo'. |
30 # | 38 # |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 87 |
80 rebase_parent = rebase_path(invoker.source, root_build_dir) | 88 rebase_parent = rebase_path(invoker.source, root_build_dir) |
81 rebase_output = rebase_path(output, root_build_dir) | 89 rebase_output = rebase_path(output, root_build_dir) |
82 | 90 |
83 args = [ | 91 args = [ |
84 "--application-name=$application_name", | 92 "--application-name=$application_name", |
85 "--parent=$rebase_parent", | 93 "--parent=$rebase_parent", |
86 "--output=$rebase_output", | 94 "--output=$rebase_output", |
87 ] | 95 ] |
88 | 96 |
| 97 if (defined(invoker.base_manifest)) { |
| 98 rebase_base = rebase_path(invoker.base_manifest, root_build_dir) |
| 99 args += [ "--base-manifest=$rebase_base" ] |
| 100 } |
| 101 |
89 if (defined(invoker.packaged_applications)) { | 102 if (defined(invoker.packaged_applications)) { |
90 foreach(application_name, invoker.packaged_applications) { | 103 foreach(application_name, invoker.packaged_applications) { |
91 input = "$root_out_dir/$mojo_application_subdir/$application_name/manife
st.json" | 104 input = "$root_out_dir/$mojo_application_subdir/$application_name/manife
st.json" |
92 inputs += [ input ] | 105 inputs += [ input ] |
93 args += [ rebase_path(input, root_build_dir) ] | 106 args += [ rebase_path(input, root_build_dir) ] |
94 } | 107 } |
95 } | 108 } |
96 deps = [] | 109 deps = [] |
97 if (defined(invoker.deps)) { | 110 if (defined(invoker.deps)) { |
98 deps += invoker.deps | 111 deps += invoker.deps |
99 } | 112 } |
| 113 if (defined(invoker.base_deps)) { |
| 114 deps += invoker.base_deps |
| 115 } |
100 } | 116 } |
101 | 117 |
102 all_deps = [] | 118 all_deps = [] |
103 if (defined(invoker.deps)) { | 119 if (defined(invoker.deps)) { |
104 all_deps += invoker.deps | 120 all_deps += invoker.deps |
105 } | 121 } |
106 | 122 |
107 group("${target_name}__is_mojo_application_manifest") { | 123 group("${target_name}__is_mojo_application_manifest") { |
108 } | 124 } |
109 | 125 |
110 # Explicitly ensure that all dependencies are mojo_application_manifest | 126 # Explicitly ensure that all dependencies are mojo_application_manifest |
111 # targets themselves. | 127 # targets themselves. |
112 group("${target_name}__check_deps_are_all_mojo_application_manifest") { | 128 group("${target_name}__check_deps_are_all_mojo_application_manifest") { |
113 deps = [] | 129 deps = [] |
114 foreach(d, all_deps) { | 130 foreach(d, all_deps) { |
115 name = get_label_info(d, "label_no_toolchain") | 131 name = get_label_info(d, "label_no_toolchain") |
116 toolchain = get_label_info(d, "toolchain") | 132 toolchain = get_label_info(d, "toolchain") |
117 deps += [ "${name}__is_mojo_application_manifest(${toolchain})" ] | 133 deps += [ "${name}__is_mojo_application_manifest(${toolchain})" ] |
118 } | 134 } |
119 } | 135 } |
120 } | 136 } |
OLD | NEW |