Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
b1c75534
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,发现更多精彩内容 >>
未验证
提交
b1c75534
编写于
11月 23, 2020
作者:
J
Jenn Magder
提交者:
GitHub
11月 23, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Generate XCFramework in recipe package script (#22664)
上级
cf15225f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
10 deletion
+33
-10
sky/tools/create_ios_framework.py
sky/tools/create_ios_framework.py
+27
-7
sky/tools/create_xcframework.py
sky/tools/create_xcframework.py
+6
-3
未找到文件。
sky/tools/create_ios_framework.py
浏览文件 @
b1c75534
...
...
@@ -9,12 +9,13 @@ import shutil
import
sys
import
os
from
create_xcframework
import
create_xcframework
DSYMUTIL
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'..'
,
'..'
,
'buildtools'
,
'mac-x64'
,
'clang'
,
'bin'
,
'dsymutil'
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
'Creates Flutter.framework'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'Creates Flutter.framework
and Flutter.xcframework
'
)
parser
.
add_argument
(
'--dst'
,
type
=
str
,
required
=
True
)
parser
.
add_argument
(
'--arm64-out-dir'
,
type
=
str
,
required
=
True
)
...
...
@@ -66,8 +67,24 @@ def main():
shutil
.
rmtree
(
fat_framework
,
True
)
shutil
.
copytree
(
arm64_framework
,
fat_framework
)
linker_out
=
os
.
path
.
join
(
fat_framework
,
'Flutter'
)
fat_framework_binary
=
os
.
path
.
join
(
fat_framework
,
'Flutter'
)
# Create the arm-only fat framework.
subprocess
.
check_call
([
'lipo'
,
arm64_dylib
,
armv7_dylib
,
'-create'
,
'-output'
,
fat_framework_binary
])
process_framework
(
args
,
fat_framework
,
fat_framework_binary
)
# Create XCFramework from the arm-only fat framework and the simulator framework.
xcframeworks
=
[
simulator_framework
,
fat_framework
]
create_xcframework
(
location
=
args
.
dst
,
name
=
'Flutter'
,
frameworks
=
xcframeworks
)
# Add the simulator into the fat framework.
subprocess
.
check_call
([
'lipo'
,
arm64_dylib
,
...
...
@@ -75,22 +92,25 @@ def main():
simulator_dylib
,
'-create'
,
'-output'
,
linker_out
fat_framework_binary
])
process_framework
(
args
,
fat_framework
,
fat_framework_binary
)
def
process_framework
(
args
,
fat_framework
,
fat_framework_binary
):
if
args
.
strip_bitcode
:
subprocess
.
check_call
([
'xcrun'
,
'bitcode_strip'
,
'-r'
,
linker_out
,
'-o'
,
linker_out
])
subprocess
.
check_call
([
'xcrun'
,
'bitcode_strip'
,
'-r'
,
fat_framework_binary
,
'-o'
,
fat_framework_binary
])
if
args
.
dsym
:
dsym_out
=
os
.
path
.
splitext
(
fat_framework
)[
0
]
+
'.dSYM'
subprocess
.
check_call
([
DSYMUTIL
,
'-o'
,
dsym_out
,
linker_out
])
subprocess
.
check_call
([
DSYMUTIL
,
'-o'
,
dsym_out
,
fat_framework_binary
])
if
args
.
strip
:
# copy unstripped
unstripped_out
=
os
.
path
.
join
(
args
.
dst
,
'Flutter.unstripped'
)
shutil
.
copyfile
(
linker_out
,
unstripped_out
)
shutil
.
copyfile
(
fat_framework_binary
,
unstripped_out
)
subprocess
.
check_call
([
"strip"
,
"-x"
,
"-S"
,
linker_out
])
subprocess
.
check_call
([
"strip"
,
"-x"
,
"-S"
,
fat_framework_binary
])
if
__name__
==
'__main__'
:
...
...
sky/tools/create_xcframework.py
浏览文件 @
b1c75534
...
...
@@ -25,8 +25,11 @@ def main():
args
=
parser
.
parse_args
()
output_dir
=
os
.
path
.
abspath
(
args
.
location
)
output_xcframework
=
os
.
path
.
join
(
output_dir
,
'%s.xcframework'
%
args
.
name
)
create_xcframework
(
args
.
location
,
args
.
name
,
args
.
frameworks
)
def
create_xcframework
(
location
,
name
,
frameworks
):
output_dir
=
os
.
path
.
abspath
(
location
)
output_xcframework
=
os
.
path
.
join
(
output_dir
,
'%s.xcframework'
%
name
)
if
not
os
.
path
.
exists
(
output_dir
):
os
.
makedirs
(
output_dir
)
...
...
@@ -41,7 +44,7 @@ def main():
'-quiet'
,
'-create-xcframework'
]
for
framework
in
args
.
frameworks
:
for
framework
in
frameworks
:
command
.
extend
([
'-framework'
,
os
.
path
.
abspath
(
framework
)])
command
.
extend
([
'-output'
,
output_xcframework
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录