| 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 # Rules to generate zipped applications for Dart. | 5 # Rules to generate zipped applications for Dart. |
| 6 # Rules to generate dart-pkg and dart-pkg/packages. | 6 # Rules to generate dart-pkg and dart-pkg/packages. |
| 7 | 7 |
| 8 import("//build/module_args/mojo.gni") | 8 import("//build/module_args/mojo.gni") |
| 9 | 9 |
| 10 template("dartzip_package") { | 10 template("dartzip_package") { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 # sources. Also copies any mojom dependencies into lib/mojom. | 213 # sources. Also copies any mojom dependencies into lib/mojom. |
| 214 # | 214 # |
| 215 # sources | 215 # sources |
| 216 # List of sources to include in the package. | 216 # List of sources to include in the package. |
| 217 # | 217 # |
| 218 # deps (optional) | 218 # deps (optional) |
| 219 # Note: this can only contain mojom targets. | 219 # Note: this can only contain mojom targets. |
| 220 # | 220 # |
| 221 # datadeps (optional) | 221 # datadeps (optional) |
| 222 # | 222 # |
| 223 # sdk_ext_directory (optional) |
| 224 # Directory containing sdk-ext .dart sources. |
| 225 # |
| 223 template("dart_pkg") { | 226 template("dart_pkg") { |
| 224 pubspec_yaml_path = rebase_path("pubspec.yaml") | 227 pubspec_yaml_path = rebase_path("pubspec.yaml") |
| 225 dart_package_name_script = | 228 dart_package_name_script = |
| 226 rebase_path("mojo/public/tools/dart_package_name.py", ".", mojo_sdk_root) | 229 rebase_path("mojo/public/tools/dart_package_name.py", ".", mojo_sdk_root) |
| 227 package_name = exec_script(dart_package_name_script, | 230 package_name = exec_script(dart_package_name_script, |
| 228 [ | 231 [ |
| 229 "--pubspec", | 232 "--pubspec", |
| 230 pubspec_yaml_path, | 233 pubspec_yaml_path, |
| 231 ], | 234 ], |
| 232 "trim string", | 235 "trim string", |
| (...skipping 23 matching lines...) Expand all Loading... |
| 256 root_prefix = rebase_path(".", "", mojo_sdk_root) | 259 root_prefix = rebase_path(".", "", mojo_sdk_root) |
| 257 source_directory = rebase_path(get_label_info(d, "dir")) | 260 source_directory = rebase_path(get_label_info(d, "dir")) |
| 258 mojom_sources += exec_script(list_mojoms_script, | 261 mojom_sources += exec_script(list_mojoms_script, |
| 259 [ | 262 [ |
| 260 source_directory, | 263 source_directory, |
| 261 root_prefix, | 264 root_prefix, |
| 262 ], | 265 ], |
| 263 "list lines") | 266 "list lines") |
| 264 } | 267 } |
| 265 | 268 |
| 269 sdk_ext_directory = [] |
| 270 if (defined(invoker.sdk_ext_directory)) { |
| 271 sdk_ext_directory += [ invoker.sdk_ext_directory ] |
| 272 } |
| 273 |
| 266 script = rebase_path("mojo/public/tools/dart_pkg.py", ".", mojo_sdk_root) | 274 script = rebase_path("mojo/public/tools/dart_pkg.py", ".", mojo_sdk_root) |
| 267 outputs = [ | 275 outputs = [ |
| 268 stamp_file, | 276 stamp_file, |
| 269 ] | 277 ] |
| 270 | 278 |
| 271 inputs = [ | 279 inputs = [ |
| 272 list_mojoms_script, | 280 list_mojoms_script, |
| 273 script, | 281 script, |
| 274 ] + rebase_path(invoker.sources) | 282 ] + rebase_path(invoker.sources) + rebase_path(sdk_ext_directory) |
| 275 | 283 |
| 276 args = [ | 284 args = [ |
| 277 "--package-name", | 285 "--package-name", |
| 278 package_name, | 286 package_name, |
| 279 "--gen-directory", | 287 "--gen-directory", |
| 280 rebase_path("$root_gen_dir/dart-gen"), | 288 rebase_path("$root_gen_dir/dart-gen"), |
| 281 "--pkg-directory", | 289 "--pkg-directory", |
| 282 pkg_directory, | 290 pkg_directory, |
| 283 "--package-root", | 291 "--package-root", |
| 284 package_root, | 292 package_root, |
| 285 "--stamp-file", | 293 "--stamp-file", |
| 286 rebase_path(stamp_file), | 294 rebase_path(stamp_file), |
| 287 "--package-sources", | 295 "--package-sources", |
| 288 ] + rebase_path(invoker.sources) + [ "--mojom-sources" ] + | 296 ] + rebase_path(invoker.sources) + [ "--mojom-sources" ] + |
| 289 rebase_path(mojom_sources, "", mojo_sdk_root) | 297 rebase_path(mojom_sources, "", mojo_sdk_root) + |
| 298 [ "--sdk-ext-directories" ] + rebase_path(sdk_ext_directory) |
| 290 } | 299 } |
| 291 } | 300 } |
| OLD | NEW |