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