Index: sky/build/skyx.gni |
diff --git a/sky/apk/rules.gni b/sky/build/skyx.gni |
similarity index 54% |
copy from sky/apk/rules.gni |
copy to sky/build/skyx.gni |
index 27715b81ba72d08cf58f218865cf67ceef1b3b13..2306558d207e6a88fc0ba0e200b113db4f94ce75 100644 |
--- a/sky/apk/rules.gni |
+++ b/sky/build/skyx.gni |
@@ -2,9 +2,6 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-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 |
@@ -16,28 +13,12 @@ declare_args() { |
package_root = "$root_gen_dir/dart-pkg/packages" |
-template("sky_apk") { |
- android_apk(target_name) { |
- apk_name = invoker.apk_name |
- android_manifest = invoker.android_manifest |
- |
- native_libs = [ "libsky_shell.so" ] |
- asset_location = "$root_build_dir/sky_shell/assets" |
+template("skyx") { |
+ bundle_prefix = target_name |
+ bundle = "$target_gen_dir/${bundle_prefix}.skyx" |
+ snapshot = "$target_gen_dir/${bundle_prefix}_snapshot.bin" |
- deps = [ |
- "//base:base_java", |
- "//sky/shell:assets", |
- "//sky/shell:java", |
- "//sky/shell:sky_shell", |
- ] + invoker.deps |
- } |
-} |
- |
-template("sky_app") { |
- # Note: org.domokit.sky.shell.SkyApplication knows about 'snapshot_blob.bin'. |
- snapshot = "$target_gen_dir/snapshot_blob.bin" |
- |
- action("gen_snapshot") { |
+ action("gen_${bundle_prefix}_snapshot") { |
main_dart = invoker.main_dart |
inputs = [ |
@@ -47,6 +28,10 @@ template("sky_app") { |
snapshot, |
] |
+ if (defined(invoker.sources)) { |
+ inputs += sources |
+ } |
+ |
sky_packager_dir = |
get_label_info("//sky/tools/packager($host_toolchain)", "root_out_dir") |
@@ -70,22 +55,22 @@ template("sky_app") { |
"//sky/tools/packager($host_toolchain)", |
"//sky/sdk", |
] |
- } |
- app_bundle = "$target_gen_dir/app.skyx" |
+ if (defined(invoker.deps)) { |
+ deps += invoker.deps |
+ } |
+ } |
- action("gen_bundle") { |
+ action("gen_${bundle_prefix}_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, |
+ bundle, |
] |
script = "//sky/tools/skyx.py" |
@@ -95,50 +80,27 @@ template("sky_app") { |
"--snapshot", |
rebase_path(snapshot, root_build_dir), |
"-o", |
- rebase_path(app_bundle, root_build_dir), |
- rebase_path(sky_yaml, root_build_dir), |
+ rebase_path(bundle, root_build_dir), |
] |
- deps = [ |
- ":gen_snapshot", |
- ] |
- } |
- |
- copy_ex("assets") { |
- clear_dir = true |
- dest = "$target_gen_dir/assets" |
- |
- sources = [ |
- "$root_build_dir/icudtl.dat", |
- ] |
- |
- deps = [ |
- "//third_party/icu", |
- ] |
- |
- if (enable_skyx) { |
- sources += [ app_bundle ] |
- deps += [ ":gen_bundle" ] |
+ if (defined(invoker.manifest)) { |
+ sources += [ invoker.manifest ] |
+ args += [ |
+ "--manifest", |
+ rebase_path(invoker.manifest, root_build_dir), |
+ ] |
} |
- } |
- |
- android_apk(target_name) { |
- apk_name = invoker.apk_name |
- android_manifest = "apk/AndroidManifest.xml" |
- |
- native_libs = [ "libsky_shell.so" ] |
- asset_location = "$target_gen_dir/assets" |
deps = [ |
- "//base:base_java", |
- "//sky/shell:assets", |
- "//sky/shell:java", |
- "//sky/shell:sky_shell", |
- ":assets", |
+ ":gen_${bundle_prefix}_snapshot", |
] |
+ } |
- if (defined(invoker.deps)) { |
- deps += invoker.deps |
+ group(target_name) { |
+ if (enable_skyx) { |
+ deps = [ |
+ ":gen_${bundle_prefix}_bundle", |
+ ] |
} |
} |
} |