Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Build Lite
提交
d26fe11a
B
Build Lite
项目概览
OpenHarmony
/
Build Lite
9 个月 前同步成功
通知
22
Star
24
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
Build Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
d26fe11a
编写于
12月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!638 delete patch_ohos_para function
Merge pull request !638 from chenmudan/cherry-pick-1670393845
上级
bbf58927
15aa3971
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
36 deletion
+4
-36
hb_internal/build/build.py
hb_internal/build/build.py
+1
-1
hb_internal/build/build_process.py
hb_internal/build/build_process.py
+2
-1
hb_internal/common/misc.py
hb_internal/common/misc.py
+1
-34
未找到文件。
hb_internal/build/build.py
浏览文件 @
d26fe11a
...
@@ -131,7 +131,7 @@ def add_options(parser):
...
@@ -131,7 +131,7 @@ def add_options(parser):
default
=
'default'
)
default
=
'default'
)
parser
.
add_argument
(
'--build-variant'
,
parser
.
add_argument
(
'--build-variant'
,
help
=
'specifies device operating mode'
,
help
=
'specifies device operating mode'
,
default
=
'
user
'
)
default
=
'
root
'
)
parser
.
add_argument
(
'--share-ccache'
,
parser
.
add_argument
(
'--share-ccache'
,
default
=
""
,
default
=
""
,
help
=
'It is customized path to place ccache, which allow'
help
=
'It is customized path to place ccache, which allow'
...
...
hb_internal/build/build_process.py
浏览文件 @
d26fe11a
...
@@ -158,7 +158,6 @@ class Build():
...
@@ -158,7 +158,6 @@ class Build():
else
:
else
:
if
not
cmd_args
.
get
(
'disable_post_build'
):
if
not
cmd_args
.
get
(
'disable_post_build'
):
post_build
=
PostBuild
(
self
.
config
)
post_build
=
PostBuild
(
self
.
config
)
post_build
.
patch_ohos_para
(
cmd_args
)
if
not
cmd_args
.
get
(
'disable_package_image'
):
if
not
cmd_args
.
get
(
'disable_package_image'
):
post_build
.
package_image
()
post_build
.
package_image
()
if
not
disable_post_build_args
or
'output_part_rom_status'
not
in
disable_post_build_args
:
if
not
disable_post_build_args
or
'output_part_rom_status'
not
in
disable_post_build_args
:
...
@@ -236,6 +235,8 @@ class Build():
...
@@ -236,6 +235,8 @@ class Build():
os_level
=
self
.
config
.
os_level
os_level
=
self
.
config
.
os_level
if
cmd_args
.
get
(
'build_variant'
):
if
cmd_args
.
get
(
'build_variant'
):
self
.
register_args
(
'build_variant'
,
cmd_args
.
get
(
'build_variant'
))
self
.
register_args
(
'build_variant'
,
cmd_args
.
get
(
'build_variant'
))
if
cmd_args
.
get
(
'device_type'
):
self
.
register_args
(
'device_type'
,
cmd_args
.
get
(
'device_type'
))
gn_cmd
=
[
gn_cmd
=
[
gn_path
,
gn_path
,
'gen'
,
'gen'
,
...
...
hb_internal/common/misc.py
浏览文件 @
d26fe11a
...
@@ -20,7 +20,7 @@ import os
...
@@ -20,7 +20,7 @@ import os
import
subprocess
import
subprocess
from
datetime
import
datetime
from
datetime
import
datetime
from
distutils.spawn
import
find_executable
from
distutils.spawn
import
find_executable
from
hb_internal.common.utils
import
OHOSException
,
exec_command
from
hb_internal.common.utils
import
exec_command
from
hb_internal.common.utils
import
hb_warning
from
hb_internal.common.utils
import
hb_warning
...
@@ -109,39 +109,6 @@ class PostBuild:
...
@@ -109,39 +109,6 @@ class PostBuild:
self
.
get_warning_list
()
self
.
get_warning_list
()
if
not
disable_post_build_args
or
'compute_overlap_rate'
not
in
disable_post_build_args
:
if
not
disable_post_build_args
or
'compute_overlap_rate'
not
in
disable_post_build_args
:
self
.
compute_overlap_rate
()
self
.
compute_overlap_rate
()
def
patch_ohos_para
(
self
,
cmd_args
):
ohos_para_data
=
[]
ohos_para_file_path
=
os
.
path
.
join
(
self
.
_out_path
,
'packages/phone/system/etc/param/ohos.para'
)
if
not
os
.
path
.
exists
(
ohos_para_file_path
):
return
with
open
(
ohos_para_file_path
,
'r'
,
encoding
=
'utf-8'
)
as
ohos_para_file
:
for
line
in
ohos_para_file
:
ohos_para_data
.
append
(
line
)
if
cmd_args
.
get
(
'device_type'
)
and
cmd_args
.
get
(
'device_type'
)
!=
'default'
:
for
i
,
line
in
enumerate
(
ohos_para_data
):
if
ohos_para_data
[
i
].
__contains__
(
'const.build.characteristics'
):
ohos_para_data
[
i
]
=
'const.build.characteristics='
+
cmd_args
.
get
(
'device_type'
)
+
'
\n
'
break
if
cmd_args
.
get
(
'build_variant'
):
if
cmd_args
.
get
(
'build_variant'
)
!=
'user'
and
cmd_args
.
get
(
'build_variant'
)
!=
'root'
:
raise
OHOSException
(
'Error: --build-variant support user or root mode currently'
)
for
i
,
line
in
enumerate
(
ohos_para_data
):
if
ohos_para_data
[
i
].
__contains__
(
'const.secure'
):
if
cmd_args
.
get
(
'build_variant'
)
==
'user'
:
ohos_para_data
[
i
]
=
'const.secure=1
\n
'
else
:
ohos_para_data
[
i
]
=
'const.secure=0
\n
'
if
ohos_para_data
[
i
].
__contains__
(
'const.debuggable'
):
if
cmd_args
.
get
(
'build_variant'
)
==
'user'
:
ohos_para_data
[
i
]
=
'const.debuggable=0
\n
'
else
:
ohos_para_data
[
i
]
=
'const.debuggable=1
\n
'
data
=
''
for
line
in
ohos_para_data
:
data
+=
line
with
open
(
ohos_para_file_path
,
'w'
,
encoding
=
'utf-8'
)
as
ohos_para_file
:
ohos_para_file
.
write
(
data
)
def
package_image
(
self
):
def
package_image
(
self
):
image_path
=
os
.
path
.
join
(
self
.
_out_path
,
'packages/phone/images/'
)
image_path
=
os
.
path
.
join
(
self
.
_out_path
,
'packages/phone/images/'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录