Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
f267ef58
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,发现更多精彩内容 >>
未验证
提交
f267ef58
编写于
6月 26, 2020
作者:
R
Robert Ancell
提交者:
GitHub
6月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a flag to enable dart:mirrors (#19112)
Fixes
https://github.com/flutter/flutter/issues/59233
上级
760366b4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
64 addition
and
0 deletion
+64
-0
shell/platform/linux/fl_dart_project.cc
shell/platform/linux/fl_dart_project.cc
+14
-0
shell/platform/linux/fl_dart_project_test.cc
shell/platform/linux/fl_dart_project_test.cc
+9
-0
shell/platform/linux/fl_engine.cc
shell/platform/linux/fl_engine.cc
+14
-0
shell/platform/linux/public/flutter_linux/fl_dart_project.h
shell/platform/linux/public/flutter_linux/fl_dart_project.h
+27
-0
未找到文件。
shell/platform/linux/fl_dart_project.cc
浏览文件 @
f267ef58
...
...
@@ -9,6 +9,7 @@
struct
_FlDartProject
{
GObject
parent_instance
;
gboolean
enable_mirrors
;
gchar
*
aot_library_path
;
gchar
*
assets_path
;
gchar
*
icu_data_path
;
...
...
@@ -60,6 +61,19 @@ G_MODULE_EXPORT FlDartProject* fl_dart_project_new() {
return
self
;
}
G_MODULE_EXPORT
void
fl_dart_project_set_enable_mirrors
(
FlDartProject
*
self
,
gboolean
enable_mirrors
)
{
g_return_if_fail
(
FL_IS_DART_PROJECT
(
self
));
self
->
enable_mirrors
=
enable_mirrors
;
}
G_MODULE_EXPORT
gboolean
fl_dart_project_get_enable_mirrors
(
FlDartProject
*
self
)
{
g_return_val_if_fail
(
FL_IS_DART_PROJECT
(
self
),
FALSE
);
return
self
->
enable_mirrors
;
}
G_MODULE_EXPORT
const
gchar
*
fl_dart_project_get_aot_library_path
(
FlDartProject
*
self
)
{
g_return_val_if_fail
(
FL_IS_DART_PROJECT
(
self
),
nullptr
);
...
...
shell/platform/linux/fl_dart_project_test.cc
浏览文件 @
f267ef58
...
...
@@ -24,3 +24,12 @@ TEST(FlDartProjectTest, GetPaths) {
EXPECT_STREQ
(
fl_dart_project_get_icu_data_path
(
project
),
expected_icu_data_path
);
}
TEST
(
FlDartProjectTest
,
EnableMirrors
)
{
g_autoptr
(
FlDartProject
)
project
=
fl_dart_project_new
();
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
EXPECT_FALSE
(
fl_dart_project_get_enable_mirrors
(
project
));
fl_dart_project_set_enable_mirrors
(
project
,
TRUE
);
EXPECT_TRUE
(
fl_dart_project_get_enable_mirrors
(
project
));
G_GNUC_END_IGNORE_DEPRECATIONS
}
shell/platform/linux/fl_engine.cc
浏览文件 @
f267ef58
...
...
@@ -274,10 +274,24 @@ gboolean fl_engine_start(FlEngine* self, GError** error) {
custom_task_runners
.
struct_size
=
sizeof
(
FlutterCustomTaskRunners
);
custom_task_runners
.
platform_task_runner
=
&
platform_task_runner
;
g_autoptr
(
GPtrArray
)
command_line_args
=
g_ptr_array_new_with_free_func
(
g_free
);
g_ptr_array_add
(
command_line_args
,
g_strdup
(
"flutter"
));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gboolean
enable_mirrors
=
fl_dart_project_get_enable_mirrors
(
self
->
project
);
G_GNUC_END_IGNORE_DEPRECATIONS
if
(
enable_mirrors
)
{
g_ptr_array_add
(
command_line_args
,
g_strdup
(
"--dart-flags=--enable_mirrors=true"
));
}
FlutterProjectArgs
args
=
{};
args
.
struct_size
=
sizeof
(
FlutterProjectArgs
);
args
.
assets_path
=
fl_dart_project_get_assets_path
(
self
->
project
);
args
.
icu_data_path
=
fl_dart_project_get_icu_data_path
(
self
->
project
);
args
.
command_line_argc
=
command_line_args
->
len
;
args
.
command_line_argv
=
reinterpret_cast
<
const
char
*
const
*>
(
command_line_args
->
pdata
);
args
.
platform_message_callback
=
fl_engine_platform_message_cb
;
args
.
custom_task_runners
=
&
custom_task_runners
;
args
.
shutdown_dart_vm_when_done
=
true
;
...
...
shell/platform/linux/public/flutter_linux/fl_dart_project.h
浏览文件 @
f267ef58
...
...
@@ -35,6 +35,33 @@ G_DECLARE_FINAL_TYPE(FlDartProject, fl_dart_project, FL, DART_PROJECT, GObject)
*/
FlDartProject
*
fl_dart_project_new
();
/**
* fl_dart_project_set_enable_mirrors:
* @project: an #FlDartProject.
* @enable_mirrors: %TRUE if the dart:mirrors library should be used.
*
* Sets if this Flutter project can use the dart:mirrors library.
*
* Deprecated: This function is temporary and will be removed in a future
* release.
*/
void
fl_dart_project_set_enable_mirrors
(
FlDartProject
*
project
,
gboolean
enable_mirrors
)
G_DEPRECATED
;
/**
* fl_dart_project_get_enable_mirrors:
* @project: an #FlDartProject.
*
* Gets if this Flutter project can use the dart:mirrors library.
*
* Returns: %TRUE if the dart:mirrors library can be used.
*
* Deprecated: This function is temporary and will be removed in a future
* release.
*/
gboolean
fl_dart_project_get_enable_mirrors
(
FlDartProject
*
project
)
G_DEPRECATED
;
/**
* fl_dart_project_get_aot_library_path:
* @project: an #FlDartProject.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录