Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
dcb02618
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dcb02618
编写于
9月 01, 2016
作者:
J
James Robinson
提交者:
GitHub
9月 01, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[build] Add new flutter_app GN template for Fuchsia style package management (#2999)
上级
9dc8de12
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
101 addition
and
2 deletion
+101
-2
build/flutter_app.gni
build/flutter_app.gni
+99
-0
examples/spinning_square/BUILD.gn
examples/spinning_square/BUILD.gn
+2
-2
未找到文件。
build/fl
x
.gni
→
build/fl
utter_app
.gni
浏览文件 @
dcb02618
...
...
@@ -2,37 +2,60 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
template("flx") {
assert(is_fuchsia)
import("//build/dart/dart_package.gni")
# Defines a Flutter application
#
# Parameters
#
# main_dart (required)
# Name of the Dart file containing the main function.
#
# package_name (optional)
# Name of the Dart package.
#
# output_name (optional)
# Name of output to generate. Defaults to $target_name.flx.
#
# deps (optional)
# List of Dart packages the application depends on.
template("flutter_app") {
assert(defined(invoker.main_dart), "Must define main_dart")
dart_package_name = target_name + "_dart_package"
dart_package(dart_package_name) {
forward_variables_from(invoker, [ "deps" ])
if (defined(invoker.package_name)) {
package_name = invoker.package_name
} else {
infer_package_name = true
}
}
if (defined(invoker.output_name)) {
bundle_name = invoker.output_name
} else {
bundle_name = "${target_name}.flx"
}
flutter_snapshot_label = "//flutter/snapshotter($host_toolchain)"
flutter_snapshot_dir = get_label_info(flutter_snapshot_label, "root_out_dir")
flutter_snapshot = "$flutter_snapshot_dir/sky_snapshot"
bundle_path = "$root_out_dir/$bundle_name"
snapshot_path = "$target_gen_dir/${target_name}_snapshot.bin"
depfile_path = "${snapshot_path}.d"
main_dart = invoker.main_dart
if (defined(invoker.packages)) {
packages_path = invoker.packages
} else {
main_dir = get_path_info(main_dart, "dir")
package_dir = get_path_info(main_dir, "dir")
packages_path = "$package_dir/.packages"
}
sky_snapshot_label = "//flutter/snapshotter($host_toolchain)"
sky_snapshot_dir = get_label_info(sky_snapshot_label, "root_out_dir")
sky_snapshot = "$sky_snapshot_dir/sky_snapshot"
action(target_name) {
depfile = depfile_path
inputs = [
main_dart,
packages_path,
]
outputs = [
...
...
@@ -47,18 +70,26 @@ template("flx") {
script = "//flutter/build/package.py"
args = [
"--snapshotter", rebase_path(sky_snapshot),
"--main-dart", rebase_path(main_dart),
"--packages", rebase_path(packages_path),
"--bundle", rebase_path(bundle_path),
"--bundle-header", "#!mojo mojo:flutter_content_handler",
"--snapshot", rebase_path(snapshot_path),
"--depfile", rebase_path(depfile_path),
"--build-output", rebase_path(bundle_path, root_build_dir),
"--snapshotter",
rebase_path(flutter_snapshot),
"--main-dart",
rebase_path(main_dart),
"--packages",
rebase_path("$target_gen_dir/.packages"),
"--bundle",
rebase_path(bundle_path),
"--bundle-header",
"#!mojo mojo:flutter_content_handler",
"--snapshot",
rebase_path(snapshot_path),
"--depfile",
rebase_path(depfile_path),
"--build-output",
rebase_path(bundle_path, root_build_dir),
]
deps = [
sky
_snapshot_label,
flutter
_snapshot_label,
]
if (defined(invoker.deps)) {
...
...
examples/spinning_square/BUILD.gn
浏览文件 @
dcb02618
...
...
@@ -2,8 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//flutter/build/fl
x
.gni")
import("//flutter/build/fl
utter_app
.gni")
fl
x
("spinning_square") {
fl
utter_app
("spinning_square") {
main_dart = "lib/main.dart"
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录