提交 2f4e404f 编写于 作者: A Adam Barth

Build stocks.skyx

This CL teaches the build system how to create the stocks.skyx application
bundle. This bundle contains the stocks snapshot as well as the material design
assets needed by the stocks app to run offline.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1216273002.
上级 7d7cde50
......@@ -5,6 +5,8 @@
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
package_root = "$root_gen_dir/dart-pkg/packages"
template("sky_apk") {
android_apk(target_name) {
apk_name = invoker.apk_name
......@@ -23,12 +25,11 @@ template("sky_apk") {
}
template("sky_app") {
# Note: org.chromium.base.ResourceExtractor knows about 'snapshot_blob.bin'.
snapshot = "$target_gen_dir/snapshot_blob.bin"
action("gen_snapshot") {
main_dart = invoker.main_dart
package_root = "$root_gen_dir/dart-pkg/packages"
# Note: org.chromium.base.ResourceExtractor knows about 'snapshot_blob.bin'.
snapshot = "$target_gen_dir/snapshot_blob.bin"
inputs = [
main_dart,
......@@ -62,6 +63,40 @@ template("sky_app") {
]
}
if (defined(invoker.sky_yaml)) {
app_bundle = "$target_gen_dir/${target_name}.skyx"
action("gen_bundle") {
asset_base = "$package_root/sky/assets/material-design-icons"
sky_yaml = invoker.sky_yaml
sources = [
sky_yaml,
snapshot,
]
outputs = [
app_bundle,
]
script = "//sky/tools/skyx.py"
args = [
rebase_path(sky_yaml, root_build_dir),
"--asset-base",
rebase_path(asset_base, root_build_dir),
"--snapshot",
rebase_path(snapshot, root_build_dir),
"-o",
rebase_path(app_bundle, root_build_dir),
]
deps = [
":gen_snapshot",
]
}
}
copy_ex("assets") {
clear_dir = true
dest = "$target_gen_dir/assets"
......@@ -92,6 +127,10 @@ template("sky_app") {
":gen_snapshot",
]
if (defined(invoker.sky_yaml)) {
deps += [ ":gen_bundle" ]
}
if (defined(invoker.deps)) {
deps += invoker.deps
}
......
......@@ -9,4 +9,5 @@ import("//sky/apk/rules.gni")
sky_app("stocks") {
apk_name = "Stocks"
main_dart = "lib/main.dart"
sky_yaml = "sky.yaml"
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册