Index: sky/apk/rules.gni |
diff --git a/sky/apk/rules.gni b/sky/apk/rules.gni |
index 27715b81ba72d08cf58f218865cf67ceef1b3b13..1dbd905d5532cc181ffe314075ecd768cdae91d9 100644 |
--- a/sky/apk/rules.gni |
+++ b/sky/apk/rules.gni |
@@ -4,17 +4,7 @@ |
import("//build/config/android/config.gni") |
import("//build/config/android/rules.gni") |
- |
-declare_args() { |
- # Controls whether we build app.skyx bundles in the sky_app template below. |
- # An app.skyx bundle contains all the code an resources needed to run a Sky |
- # app offline. Unfortunately, we don't yet have all the Dart packages we need |
- # to create skyx packages installed on the build bots, so this functionality |
- # is currently disabled. This flag allows for local testing of this feature. |
- enable_skyx = false |
-} |
- |
-package_root = "$root_gen_dir/dart-pkg/packages" |
+import("//sky/build/skyx.gni") |
template("sky_apk") { |
android_apk(target_name) { |
@@ -34,74 +24,16 @@ template("sky_apk") { |
} |
template("sky_app") { |
- # Note: org.domokit.sky.shell.SkyApplication knows about 'snapshot_blob.bin'. |
- snapshot = "$target_gen_dir/snapshot_blob.bin" |
- |
- action("gen_snapshot") { |
+ skyx("app") { |
main_dart = invoker.main_dart |
- inputs = [ |
- main_dart, |
- ] |
- outputs = [ |
- snapshot, |
- ] |
- |
- sky_packager_dir = |
- get_label_info("//sky/tools/packager($host_toolchain)", "root_out_dir") |
- |
- script = "//sky/tools/sky_packager.py" |
- |
- src_dir = "//" |
- cwd = rebase_path(src_dir, root_build_dir) |
- |
- args = [ |
- rebase_path("$sky_packager_dir/sky_packager", src_dir), |
- rebase_path(main_dart, src_dir), |
- "--package-root", |
- rebase_path(package_root, src_dir), |
- "--snapshot", |
- rebase_path(snapshot, src_dir), |
- "-C", |
- cwd, |
- ] |
- |
- deps = [ |
- "//sky/tools/packager($host_toolchain)", |
- "//sky/sdk", |
- ] |
- } |
- |
- app_bundle = "$target_gen_dir/app.skyx" |
- |
- action("gen_bundle") { |
- asset_base = "$package_root/sky/assets/material-design-icons" |
- sky_yaml = invoker.sky_yaml |
- |
- sources = [ |
- "//sky/tools/skyx/bin/skyx.dart", |
- sky_yaml, |
- snapshot, |
- ] |
- |
- outputs = [ |
- app_bundle, |
- ] |
- |
- script = "//sky/tools/skyx.py" |
- args = [ |
- "--asset-base", |
- rebase_path(asset_base, root_build_dir), |
- "--snapshot", |
- rebase_path(snapshot, root_build_dir), |
- "-o", |
- rebase_path(app_bundle, root_build_dir), |
- rebase_path(sky_yaml, root_build_dir), |
- ] |
+ if (defined(invoker.manifest)) { |
+ manifest = invoker.manifest |
+ } |
- deps = [ |
- ":gen_snapshot", |
- ] |
+ if (defined(invoker.sources)) { |
+ sources = invoker.sources |
+ } |
} |
copy_ex("assets") { |
@@ -111,14 +43,13 @@ template("sky_app") { |
sources = [ |
"$root_build_dir/icudtl.dat", |
] |
- |
deps = [ |
"//third_party/icu", |
] |
if (enable_skyx) { |
- sources += [ app_bundle ] |
- deps += [ ":gen_bundle" ] |
+ sources += [ "$target_gen_dir/app.skyx" ] |
+ deps += [ ":app" ] |
} |
} |