Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
607d379c
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
607d379c
编写于
8月 11, 2016
作者:
J
John McCutchan
提交者:
GitHub
8月 11, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add --print-deps mode to sky_snapshot (#2903)
上级
d07eb002
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
37 addition
and
25 deletion
+37
-25
DEPS
DEPS
+1
-1
snapshotter/main.cc
snapshotter/main.cc
+36
-24
未找到文件。
DEPS
浏览文件 @
607d379c
...
...
@@ -55,7 +55,7 @@ deps = {
Var('fuchsia_git') + '/ftl' + '@' + '0bb3a02301c8a88b494e58c6636fa509525adaa8',
'src/lib/tonic':
Var('fuchsia_git') + '/tonic' + '@' + '
25b9fe6c5dfb0925794e754b7dc80d9c320e5082
',
Var('fuchsia_git') + '/tonic' + '@' + '
8e0776dc4aa1c7fab21b742279ef90527c59b216
',
'src/third_party/gtest':
Var('fuchsia_git') + '/third_party/gtest' + '@' + 'c00f82917331efbbd27124b537e4ccc915a02b72',
...
...
snapshotter/main.cc
浏览文件 @
607d379c
...
...
@@ -35,6 +35,7 @@ constexpr char kPackages[] = "packages";
constexpr
char
kSnapshot
[]
=
"snapshot"
;
constexpr
char
kDepfile
[]
=
"depfile"
;
constexpr
char
kBuildOutput
[]
=
"build-output"
;
constexpr
char
kPrintDeps
[]
=
"print-deps"
;
const
char
*
kDartArgs
[]
=
{
// clang-format off
...
...
@@ -181,21 +182,22 @@ int CreateSnapshot(const ftl::CommandLine& command_line) {
}
std
::
string
main_dart
=
args
[
0
];
const
bool
print_deps_mode
=
command_line
.
HasOption
(
kPrintDeps
,
nullptr
);
std
::
string
snapshot
;
std
::
string
depfile
;
std
::
string
build_output
;
if
(
!
print_deps_mode
)
{
if
(
!
command_line
.
GetOptionValue
(
kSnapshot
,
&
snapshot
))
{
std
::
cerr
<<
"error: Need --"
<<
kSnapshot
<<
"."
<<
std
::
endl
;
return
1
;
}
std
::
string
depfile
;
std
::
string
build_output
;
if
(
command_line
.
GetOptionValue
(
kDepfile
,
&
depfile
)
&&
!
command_line
.
GetOptionValue
(
kBuildOutput
,
&
build_output
))
{
std
::
cerr
<<
"error: Need --"
<<
kBuildOutput
<<
" if --"
<<
kDepfile
<<
" is specified."
<<
std
::
endl
;
return
1
;
}
}
InitDartVM
();
...
...
@@ -212,6 +214,15 @@ int CreateSnapshot(const ftl::CommandLine& command_line) {
DART_CHECK_VALID
(
Dart_LoadScript
(
ToDart
(
main_dart
),
Dart_Null
(),
ToDart
(
loader
.
Fetch
(
main_dart
)),
0
,
0
));
if
(
print_deps_mode
)
{
// The script has been loaded, print out the minimal dependencies to run.
for
(
const
auto
&
dep
:
loader
.
url_dependencies
())
{
std
::
string
file
=
dep
;
FTL_DCHECK
(
!
file
.
empty
());
std
::
cout
<<
file
<<
"
\n
"
;
}
}
else
{
// The script has been loaded, generate a snapshot.
std
::
vector
<
char
>
snapshot_blob
=
CreateSnapshot
();
if
(
!
snapshot
.
empty
()
&&
...
...
@@ -227,6 +238,7 @@ int CreateSnapshot(const ftl::CommandLine& command_line) {
<<
std
::
endl
;
return
1
;
}
}
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录