Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Build Lite
提交
a0b56e08
B
Build Lite
项目概览
OpenHarmony
/
Build Lite
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
a0b56e08
编写于
7月 05, 2021
作者:
O
openharmony_ci
提交者:
Gitee
7月 05, 2021
浏览文件
操作
浏览文件
下载
差异文件
!174 hb 编译流程优化
Merge pull request !174 from pilipala195/master
上级
8ec33c68
59a95679
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
3 deletion
+22
-3
build_ext_components.py
build_ext_components.py
+4
-0
hb/__init__.py
hb/__init__.py
+1
-1
hb/build/build_process.py
hb/build/build_process.py
+8
-0
hb/common/utils.py
hb/common/utils.py
+2
-1
hb/set/set.py
hb/set/set.py
+7
-1
未找到文件。
build_ext_components.py
浏览文件 @
a0b56e08
...
...
@@ -22,9 +22,11 @@ import argparse
import
shlex
from
tempfile
import
NamedTemporaryFile
from
shutil
import
copyfile
from
datetime
import
datetime
def
cmd_exec
(
command
,
temp_file
,
error_log_path
):
start_time
=
datetime
.
now
().
replace
(
microsecond
=
0
)
cmd
=
shlex
.
split
(
command
)
proc
=
subprocess
.
Popen
(
cmd
,
...
...
@@ -40,6 +42,8 @@ def cmd_exec(command, temp_file, error_log_path):
os
.
remove
(
temp_file
.
name
)
return
ret_code
end_time
=
datetime
.
now
().
replace
(
microsecond
=
0
)
temp_file
.
write
(
f
'cmd:
{
command
}
\n
cost time:
{
end_time
-
start_time
}
\n
'
)
return
ret_code
...
...
hb/__init__.py
浏览文件 @
a0b56e08
...
...
@@ -42,4 +42,4 @@ CONFIG_STRUCT = {
"device_path"
:
None
,
"patch_cache"
:
None
}
VERSION
=
'0.4.
1
'
VERSION
=
'0.4.
2
'
hb/build/build_process.py
浏览文件 @
a0b56e08
...
...
@@ -26,6 +26,7 @@ from hb.common.utils import remove_path
from
hb.common.utils
import
hb_info
from
hb.common.utils
import
hb_warning
from
hb.common.utils
import
OHOSException
from
hb.common.utils
import
get_current_time
from
hb.common.config
import
Config
from
hb.cts.cts
import
CTS
from
hb.common.device
import
Device
...
...
@@ -34,6 +35,7 @@ from hb.build.fs_process import Packer
from
hb.build.patch_process
import
Patch
from
distutils.spawn
import
find_executable
class
Build
():
def
__init__
(
self
,
component
=
None
):
self
.
config
=
Config
()
...
...
@@ -45,6 +47,7 @@ class Build():
self
.
_test
=
None
self
.
target
=
component
self
.
start_time
=
get_current_time
()
self
.
check_in_device
()
@
property
...
...
@@ -102,6 +105,10 @@ class Build():
else
:
raise
OHOSException
(
'Error: wrong input of test'
)
@
property
def
build_time
(
self
):
return
get_current_time
()
-
self
.
start_time
def
register_args
(
self
,
args_name
,
args_value
,
quota
=
True
):
quota
=
False
if
args_value
in
[
'true'
,
'false'
]
else
quota
if
quota
:
...
...
@@ -129,6 +136,7 @@ class Build():
exec_cmd
(
cmd_args
)
hb_info
(
f
'
{
os
.
path
.
basename
(
self
.
config
.
out_path
)
}
build success'
)
hb_info
(
f
'cost time:
{
self
.
build_time
}
'
)
return
0
def
get_cmd
(
self
,
full_compile
,
patch
,
ninja
):
...
...
hb/common/utils.py
浏览文件 @
a0b56e08
...
...
@@ -183,11 +183,12 @@ def args_factory(args_dict):
return
args
def
get_current_time
(
type
=
'
timestamp
'
):
def
get_current_time
(
type
=
'
default
'
):
if
type
==
'timestamp'
:
return
int
(
datetime
.
utcnow
().
timestamp
()
*
1000
)
if
type
==
'datetime'
:
return
datetime
.
now
().
strftime
(
'%Y-%m-%d %H:%M:%S'
)
return
datetime
.
now
().
replace
(
microsecond
=
0
)
def
hb_info
(
msg
):
...
...
hb/set/set.py
浏览文件 @
a0b56e08
...
...
@@ -20,6 +20,8 @@ import os
from
hb.common.config
import
Config
from
hb.common.utils
import
get_input
from
hb.common.utils
import
OHOSException
from
hb.common.utils
import
hb_info
from
hb.common.product
import
Product
from
hb.common.device
import
Device
...
...
@@ -47,7 +49,11 @@ def exec_command(args):
def
set_root_path
(
root_path
=
None
):
config
=
Config
()
if
root_path
is
None
:
root_path
=
get_input
(
'[OHOS INFO] Input code path: '
)
try
:
hb_info
(
f
'hb root path:
{
config
.
root_path
}
'
)
return
0
except
OHOSException
:
root_path
=
get_input
(
'[OHOS INFO] Input code path: '
)
config
.
root_path
=
root_path
return
0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录