Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
f3d04a98
E
engine
项目概览
weixin_43355755
/
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,发现更多精彩内容 >>
未验证
提交
f3d04a98
编写于
10月 03, 2019
作者:
D
Dan Field
提交者:
GitHub
10月 03, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Build AOT and test targets, generate FARs when building Fuchsia (#12761)
上级
62e58c5d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
62 addition
and
85 deletion
+62
-85
.cirrus.yml
.cirrus.yml
+0
-1
ci/build_flutter_runner_tests.sh
ci/build_flutter_runner_tests.sh
+0
-17
shell/platform/fuchsia/BUILD.gn
shell/platform/fuchsia/BUILD.gn
+5
-2
shell/platform/fuchsia/dart_runner/BUILD.gn
shell/platform/fuchsia/dart_runner/BUILD.gn
+2
-2
shell/platform/fuchsia/flutter/BUILD.gn
shell/platform/fuchsia/flutter/BUILD.gn
+5
-5
tools/fuchsia/build_fuchsia_artifacts.py
tools/fuchsia/build_fuchsia_artifacts.py
+4
-30
tools/fuchsia/fuchsia_archive.gni
tools/fuchsia/fuchsia_archive.gni
+34
-6
tools/fuchsia/gather_flutter_runner_artifacts.py
tools/fuchsia/gather_flutter_runner_artifacts.py
+1
-16
tools/fuchsia/gen_package.py
tools/fuchsia/gen_package.py
+11
-6
未找到文件。
.cirrus.yml
浏览文件 @
f3d04a98
...
...
@@ -84,7 +84,6 @@ task:
cd $ENGINE_PATH/src
./flutter/tools/fuchsia/build_fuchsia_artifacts.py --engine-version HEAD --runtime-mode debug --no-lto --archs x64
cd $ENGINE_PATH/src/flutter
./ci/build_flutter_runner_tests.sh
# WINDOWS
task
:
...
...
ci/build_flutter_runner_tests.sh
已删除
100755 → 0
浏览文件 @
62e58c5d
#!/bin/bash
set
-ex
PATH
=
"
$HOME
/depot_tools:
$PATH
"
cd
..
# Build the flutter runner tests far directory
flutter/tools/gn
--fuchsia
--no-lto
--runtime-mode
debug
ninja
-C
out/fuchsia_debug_x64 flutter/shell/platform/fuchsia/flutter:flutter_runner_tests
# Generate the far package
flutter/tools/fuchsia/gen_package.py
\
--pm-bin
$PWD
/fuchsia/sdk/linux/tools/pm
\
--package-dir
$PWD
/out/fuchsia_debug_x64/flutter_runner_tests_far
\
--signing-key
$PWD
/flutter/tools/fuchsia/development.key
\
--far-name
flutter_runner_tests
shell/platform/fuchsia/BUILD.gn
浏览文件 @
f3d04a98
...
...
@@ -6,20 +6,23 @@ import("//build/fuchsia/sdk.gni")
import("$flutter_root/common/config.gni")
if (using_fuchsia_sdk) {
testonly = true
product_suffix = ""
if (flutter_runtime_mode == "release") {
product_suffix = "product_"
}
flutter_runner_target = "flutter_jit_${product_suffix}runner"
dart_runner_target = "dart_jit_${product_suffix}runner"
group("fuchsia") {
deps = [
"dart:kernel_compiler",
"dart_runner:$dart_runner_target",
"flutter:$flutter_runner_target",
"flutter:flutter_aot_${product_suffix}runner",
"flutter:flutter_jit_${product_suffix}runner",
"flutter:flutter_runner_tests",
]
}
}
shell/platform/fuchsia/dart_runner/BUILD.gn
浏览文件 @
f3d04a98
...
...
@@ -8,7 +8,7 @@ import("//build/fuchsia/sdk.gni")
import("$flutter_root/common/fuchsia_config.gni")
import("$flutter_root/tools/fuchsia/common_libs.gni")
import("$flutter_root/tools/fuchsia/dart.gni")
import("$flutter_root/tools/fuchsia/
package_dir
.gni")
import("$flutter_root/tools/fuchsia/
fuchsia_archive
.gni")
template("runner") {
assert(defined(invoker.product), "The parameter 'product' must be defined")
...
...
@@ -100,7 +100,7 @@ template("jit_runner_package") {
product_suffix = "_product"
}
package_dir
(target_name) {
fuchsia_archive
(target_name) {
deps = [
":dart_jit${product_suffix}_runner_bin",
"kernel:kernel_core_snapshot${product_suffix}",
...
...
shell/platform/fuchsia/flutter/BUILD.gn
浏览文件 @
f3d04a98
...
...
@@ -9,7 +9,7 @@ import("$flutter_root/common/config.gni")
import("$flutter_root/shell/gpu/gpu.gni")
import("$flutter_root/tools/fuchsia/common_libs.gni")
import("$flutter_root/tools/fuchsia/dart.gni")
import("$flutter_root/tools/fuchsia/
package_dir
.gni")
import("$flutter_root/tools/fuchsia/
fuchsia_archive
.gni")
import("engine_flutter_runner.gni")
shell_gpu_configuration("fuchsia_gpu_configuration") {
...
...
@@ -89,7 +89,7 @@ template("jit_runner") {
product_suffix = "_product"
}
package_dir
(target_name) {
fuchsia_archive
(target_name) {
snapshot_label = "kernel:kernel_core_snapshot${product_suffix}"
snapshot_gen_dir = get_label_info(snapshot_label, "target_gen_dir")
...
...
@@ -174,7 +174,7 @@ template("aot_runner") {
product_suffix = "_product"
}
package_dir
(target_name) {
fuchsia_archive
(target_name) {
deps = [
":aot${product_suffix}",
]
...
...
@@ -258,7 +258,7 @@ executable("flutter_runner_unittests") {
]
}
package_dir
("flutter_runner_tests") {
fuchsia_archive
("flutter_runner_tests") {
testonly = true
deps = [
...
...
@@ -273,7 +273,7 @@ package_dir("flutter_runner_tests") {
meta = [
{
path =
"meta/$target_name.cmx"
path =
rebase_path("meta/$target_name.cmx")
dest = "$target_name.cmx"
},
]
...
...
tools/fuchsia/build_fuchsia_artifacts.py
浏览文件 @
f3d04a98
...
...
@@ -15,8 +15,7 @@ import subprocess
import
sys
import
tempfile
from
gather_flutter_runner_artifacts
import
CreateMetaPackage
,
CopyPath
from
gen_package
import
CreateFarPackage
from
gather_flutter_runner_artifacts
import
CopyPath
_script_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
realpath
(
__file__
),
'..'
))
_src_root_dir
=
os
.
path
.
join
(
_script_dir
,
'..'
,
'..'
,
'..'
)
...
...
@@ -25,28 +24,6 @@ _bucket_directory = os.path.join(_out_dir, 'fuchsia_bucket')
_fuchsia_base
=
'flutter/shell/platform/fuchsia'
def
IsLinux
():
return
platform
.
system
()
==
'Linux'
def
IsMac
():
return
platform
.
system
()
==
'Darwin'
def
GetPMBinPath
():
# host_os references the gn host_os
# https://gn.googlesource.com/gn/+/master/docs/reference.md#var_host_os
host_os
=
''
if
IsLinux
():
host_os
=
'linux'
elif
IsMac
():
host_os
=
'mac'
else
:
host_os
=
'windows'
return
os
.
path
.
join
(
_src_root_dir
,
'fuchsia'
,
'sdk'
,
host_os
,
'tools'
,
'pm'
)
def
RunExecutable
(
command
):
subprocess
.
check_call
(
command
,
cwd
=
_src_root_dir
)
...
...
@@ -116,18 +93,15 @@ def CopyToBucketWithMode(source, destination, aot, product, runner_type):
mode
=
'aot'
if
aot
else
'jit'
product_suff
=
'_product'
if
product
else
''
runner_name
=
'%s_%s%s_runner'
%
(
runner_type
,
mode
,
product_suff
)
far_dir_name
=
'%s_far'
%
runner_name
source_root
=
os
.
path
.
join
(
_out_dir
,
source
)
far_base
=
os
.
path
.
join
(
source_root
,
far_dir_name
)
CreateMetaPackage
(
far_base
,
runner_name
)
pm_bin
=
GetPMBinPath
()
key_path
=
os
.
path
.
join
(
_script_dir
,
'development.key'
)
destination
=
os
.
path
.
join
(
_bucket_directory
,
destination
,
mode
)
CreateFarPackage
(
pm_bin
,
far_base
,
key_path
,
destination
)
patched_sdk_dirname
=
'%s_runner_patched_sdk'
%
runner_type
patched_sdk_dir
=
os
.
path
.
join
(
source_root
,
patched_sdk_dirname
)
dest_sdk_path
=
os
.
path
.
join
(
destination
,
patched_sdk_dirname
)
far_name
=
'%s-0.far'
%
runner_name
far_file
=
os
.
path
.
join
(
source_root
,
far_name
)
CopyPath
(
far_file
,
os
.
path
.
join
(
destination
,
far_name
))
if
not
os
.
path
.
exists
(
dest_sdk_path
):
CopyPath
(
patched_sdk_dir
,
dest_sdk_path
)
CopyGenSnapshotIfExists
(
source_root
,
destination
)
...
...
tools/fuchsia/
package_dir
.gni
→
tools/fuchsia/
fuchsia_archive
.gni
浏览文件 @
f3d04a98
...
...
@@ -2,10 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Creates a package dir that we will them use pm to package.
#
# This currently ignores the CMX files and does minimal validation.
template("package_dir") {
# Creates a Fuchsia archive (.far) file using PM from the Fuchsia SDK.
template("fuchsia_archive") {
assert(defined(invoker.binary), "package must define binary")
assert(defined(invoker.meta_dir), "package must define meta_dir")
...
...
@@ -67,12 +65,42 @@ template("package_dir") {
]
}
action(target_name) {
write_file("${far_base_dir}/meta/package",
{
name = pkg.package_name
version = pkg.package_version
},
"json")
pkg_dir_deps = pkg.deps + [ ":$cmx_target" ]
action("${target_name}_dir") {
script = "$flutter_root/tools/fuchsia/copy_path.py"
response_file_contents = rebase_path(copy_sources + copy_outputs)
deps = pkg
.deps + [ ":$cmx_target" ]
deps = pkg
_dir_deps
args = [ "--file-list={{response_file_name}}" ]
outputs = copy_outputs
testonly = pkg_testonly
}
action(target_name) {
script = "$flutter_root/tools/fuchsia/gen_package.py"
deps = pkg_dir_deps + [ ":${target_name}_dir" ]
sources = copy_outputs
args = [
"--pm-bin",
rebase_path("//fuchsia/sdk/$host_os/tools/pm"),
"--package-dir",
rebase_path(far_base_dir),
"--signing-key",
rebase_path("//flutter/tools/fuchsia/development.key"),
"--far-name",
target_name,
]
outputs = [
"${far_base_dir}.manifest",
"$root_out_dir/${target_name}.far",
]
testonly = pkg_testonly
}
}
tools/fuchsia/gather_flutter_runner_artifacts.py
浏览文件 @
f3d04a98
...
...
@@ -40,19 +40,7 @@ def CopyPath(src, dst):
raise
def
CreateMetaPackage
(
dst_root
,
far_name
):
meta
=
os
.
path
.
join
(
dst_root
,
'meta'
)
if
not
os
.
path
.
isdir
(
meta
):
os
.
makedirs
(
meta
)
content
=
{}
content
[
'name'
]
=
far_name
content
[
'version'
]
=
'0'
package
=
os
.
path
.
join
(
meta
,
'package'
)
with
open
(
package
,
'w'
)
as
out_file
:
json
.
dump
(
content
,
out_file
)
def
GatherArtifacts
(
src_root
,
dst_root
,
create_meta_package
=
True
):
def
GatherArtifacts
(
src_root
,
dst_root
):
if
not
os
.
path
.
exists
(
dst_root
):
os
.
makedirs
(
dst_root
)
else
:
...
...
@@ -66,9 +54,6 @@ def GatherArtifacts(src_root, dst_root, create_meta_package=True):
sys
.
exit
(
1
)
CopyPath
(
src_full
,
dst_full
)
if
create_meta_package
:
CreateMetaPackage
(
dst_root
,
'flutter_runner'
)
def
main
():
parser
=
argparse
.
ArgumentParser
()
...
...
tools/fuchsia/gen_package.py
浏览文件 @
f3d04a98
...
...
@@ -13,8 +13,6 @@ import os
import
subprocess
import
sys
from
gather_flutter_runner_artifacts
import
CreateMetaPackage
# Generates the manifest and returns the file.
def
GenerateManifest
(
package_dir
):
...
...
@@ -42,11 +40,18 @@ def CreateFarPackage(pm_bin, package_dir, signing_key, dst_dir):
]
# Build the package
subprocess
.
check_call
(
pm_command_base
+
[
'build'
])
try
:
subprocess
.
check_output
(
pm_command_base
+
[
'build'
])
except
subprocess
.
CalledProcessError
as
e
:
print
(
"pm output: "
+
e
.
output
)
raise
# Archive the package
subprocess
.
check_call
(
pm_command_base
+
[
'archive'
])
try
:
subprocess
.
check_output
(
pm_command_base
+
[
'archive'
])
except
subprocess
.
CalledProcessError
as
e
:
print
(
"pm output: "
+
e
.
output
)
raise
return
0
...
...
@@ -71,7 +76,7 @@ def main():
pkg_dir
=
args
.
package_dir
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
pkg_dir
,
'meta'
,
'package'
)):
CreateMetaPackage
(
pkg_dir
,
args
.
far_name
)
raise
Exception
(
'Expected to find meta/package directory!'
)
manifest_file
=
None
if
args
.
manifest_file
is
not
None
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录