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 # Currently paths here are hard coded for convenience in building Mojo/Flutter. | 5 # Currently paths here are hard coded for convenience in building Mojo/Flutter. |
6 declare_args() { | 6 declare_args() { |
7 # Specify the path to a host compatible version of the Dart SDK. | 7 # Specify the path to a host compatible version of the Dart SDK. |
8 # This SDK is used to compile the Observatory frontend sources. | 8 # This SDK is used to compile the Observatory frontend sources. |
9 dart_host_sdk = rebase_path("//third_party/dart-sdk/dart-sdk") | 9 dart_host_sdk = rebase_path("//third_party/dart-sdk/dart-sdk") |
10 | 10 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 outputs = [ | 153 outputs = [ |
154 "$root_out_dir/observatory/deployed/web/main.dart.js", | 154 "$root_out_dir/observatory/deployed/web/main.dart.js", |
155 ] | 155 ] |
156 } | 156 } |
157 | 157 |
158 template("observatory_archive") { | 158 template("observatory_archive") { |
159 assert(defined(invoker.inner_namespace), | 159 assert(defined(invoker.inner_namespace), |
160 "Need inner_namespace in $target_name") | 160 "Need inner_namespace in $target_name") |
161 assert(defined(invoker.outer_namespace), | 161 assert(defined(invoker.outer_namespace), |
162 "Need outer_namespace in $target_name") | 162 "Need outer_namespace in $target_name") |
| 163 enable_compression = false |
| 164 if (defined(invoker.compress) && invoker.compress) { |
| 165 enable_compression = true |
| 166 } |
163 action(target_name) { | 167 action(target_name) { |
164 deps = [ | 168 deps = [ |
165 ":deploy_observatory", | 169 ":deploy_observatory", |
166 ] | 170 ] |
167 | 171 |
168 script = "../tools/create_archive.py" | 172 script = "../tools/create_archive.py" |
169 | 173 |
170 inputs = [ | 174 inputs = [ |
171 script, | 175 script, |
172 "$root_out_dir/observatory/deployed/web/main.dart.js", | 176 "$root_out_dir/observatory/deployed/web/main.dart.js", |
173 ] | 177 ] |
174 | 178 |
175 inner_namespace = invoker.inner_namespace | 179 inner_namespace = invoker.inner_namespace |
176 outer_namespace = invoker.outer_namespace | 180 outer_namespace = invoker.outer_namespace |
177 output_name = target_name | 181 output_name = target_name |
178 args = [ | 182 args = [ |
179 "--output", | 183 "--output", |
180 rebase_path("$root_gen_dir/observatory/${output_name}.cc"), | 184 rebase_path("$root_gen_dir/observatory/${output_name}.cc"), |
181 "--tar_output", | 185 "--tar_output", |
182 rebase_path("$root_gen_dir/observatory/${output_name}.tar"), | 186 rebase_path("$root_gen_dir/observatory/${output_name}.tar"), |
183 "--outer_namespace", outer_namespace, | 187 "--outer_namespace", outer_namespace, |
184 "--inner_namespace", inner_namespace, | 188 "--inner_namespace", inner_namespace, |
185 "--name", "observatory_assets_archive", | 189 "--name", "observatory_assets_archive", |
186 "--client_root", rebase_path("$root_out_dir/observatory/deployed/web/"), | 190 "--client_root", rebase_path("$root_out_dir/observatory/deployed/web/"), |
187 ] | 191 ] |
| 192 if (enable_compression) { |
| 193 args += [ "--compress" ] |
| 194 } |
188 | 195 |
189 outputs = [ | 196 outputs = [ |
190 "$root_gen_dir/observatory/${output_name}.cc", | 197 "$root_gen_dir/observatory/${output_name}.cc", |
191 "$root_gen_dir/observatory/${output_name}.tar", | 198 "$root_gen_dir/observatory/${output_name}.tar", |
192 ] | 199 ] |
193 } | 200 } |
194 } | 201 } |
195 | 202 |
196 observatory_archive("embedded_archive_observatory") { | 203 observatory_archive("embedded_archive_observatory") { |
197 outer_namespace = "dart" | 204 outer_namespace = "dart" |
198 inner_namespace = "observatory" | 205 inner_namespace = "observatory" |
199 } | 206 } |
200 | 207 |
201 source_set("embedded_observatory_archive") { | 208 source_set("embedded_observatory_archive") { |
202 deps = [ | 209 deps = [ |
203 ":embedded_archive_observatory", | 210 ":embedded_archive_observatory", |
204 ] | 211 ] |
205 | 212 |
206 sources = [ | 213 sources = [ |
207 rebase_path("$root_gen_dir/observatory/embedded_archive_observatory.cc"), | 214 rebase_path("$root_gen_dir/observatory/embedded_archive_observatory.cc"), |
208 ] | 215 ] |
209 } | 216 } |
210 | 217 |
211 observatory_archive("standalone_archive_observatory") { | 218 observatory_archive("standalone_archive_observatory") { |
| 219 compress = true |
212 outer_namespace = "dart" | 220 outer_namespace = "dart" |
213 inner_namespace = "bin" | 221 inner_namespace = "bin" |
214 } | 222 } |
215 | 223 |
216 source_set("standalone_observatory_archive") { | 224 source_set("standalone_observatory_archive") { |
217 deps = [ | 225 deps = [ |
218 ":standalone_archive_observatory", | 226 ":standalone_archive_observatory", |
219 ] | 227 ] |
220 | 228 |
221 sources = [ | 229 sources = [ |
222 rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"), | 230 rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"), |
223 ] | 231 ] |
224 } | 232 } |
OLD | NEW |