| 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 declare_args() { | |
| 6 # Controls whether we build app.skyx bundles in the sky_app template below. | |
| 7 # An app.skyx bundle contains all the code an resources needed to run a Sky | |
| 8 # app offline. Unfortunately, we don't yet have all the Dart packages we need | |
| 9 # to create skyx packages installed on the build bots, so this functionality | |
| 10 # is currently disabled. This flag allows for local testing of this feature. | |
| 11 enable_skyx = false | |
| 12 } | |
| 13 | |
| 14 package_root = "$root_gen_dir/dart-pkg/packages" | 5 package_root = "$root_gen_dir/dart-pkg/packages" |
| 15 | 6 |
| 16 template("skyx") { | 7 template("skyx") { |
| 17 bundle_prefix = target_name | 8 bundle_prefix = target_name |
| 18 bundle = "$target_gen_dir/${bundle_prefix}.skyx" | 9 bundle = "$target_gen_dir/${bundle_prefix}.skyx" |
| 19 snapshot = "$target_gen_dir/${bundle_prefix}_snapshot.bin" | 10 snapshot = "$target_gen_dir/${bundle_prefix}_snapshot.bin" |
| 20 | 11 |
| 21 action("gen_${bundle_prefix}_snapshot") { | 12 action("gen_${bundle_prefix}_snapshot") { |
| 22 main_dart = invoker.main_dart | 13 main_dart = invoker.main_dart |
| 23 | 14 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 "//sky/tools/skyx/bin/skyx.dart", | 59 "//sky/tools/skyx/bin/skyx.dart", |
| 69 snapshot, | 60 snapshot, |
| 70 ] | 61 ] |
| 71 | 62 |
| 72 outputs = [ | 63 outputs = [ |
| 73 bundle, | 64 bundle, |
| 74 ] | 65 ] |
| 75 | 66 |
| 76 script = "//sky/tools/skyx.py" | 67 script = "//sky/tools/skyx.py" |
| 77 args = [ | 68 args = [ |
| 69 "--package-root", |
| 70 rebase_path(package_root, root_build_dir), |
| 78 "--asset-base", | 71 "--asset-base", |
| 79 rebase_path(asset_base, root_build_dir), | 72 rebase_path(asset_base, root_build_dir), |
| 80 "--snapshot", | 73 "--snapshot", |
| 81 rebase_path(snapshot, root_build_dir), | 74 rebase_path(snapshot, root_build_dir), |
| 82 "-o", | 75 "-o", |
| 83 rebase_path(bundle, root_build_dir), | 76 rebase_path(bundle, root_build_dir), |
| 84 ] | 77 ] |
| 85 | 78 |
| 86 if (defined(invoker.manifest)) { | 79 if (defined(invoker.manifest)) { |
| 87 sources += [ invoker.manifest ] | 80 sources += [ invoker.manifest ] |
| 88 args += [ | 81 args += [ |
| 89 "--manifest", | 82 "--manifest", |
| 90 rebase_path(invoker.manifest, root_build_dir), | 83 rebase_path(invoker.manifest, root_build_dir), |
| 91 ] | 84 ] |
| 92 } | 85 } |
| 93 | 86 |
| 94 deps = [ | 87 deps = [ |
| 95 ":gen_${bundle_prefix}_snapshot", | 88 ":gen_${bundle_prefix}_snapshot", |
| 89 "//third_party/dart-pkg", |
| 96 ] | 90 ] |
| 97 } | 91 } |
| 98 | 92 |
| 99 group(target_name) { | 93 group(target_name) { |
| 100 if (enable_skyx) { | 94 deps = [ |
| 101 deps = [ | 95 ":gen_${bundle_prefix}_bundle", |
| 102 ":gen_${bundle_prefix}_bundle", | 96 ] |
| 103 ] | |
| 104 } | |
| 105 } | 97 } |
| 106 } | 98 } |
| OLD | NEW |