Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
22c3add9
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
22c3add9
编写于
8月 25, 2020
作者:
S
storypku
提交者:
Calvin Miao
8月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Scripts: non-interactive clean
上级
8a9cee52
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
63 addition
and
17 deletion
+63
-17
apollo.sh
apollo.sh
+2
-2
scripts/apollo_clean.sh
scripts/apollo_clean.sh
+61
-15
未找到文件。
apollo.sh
浏览文件 @
22c3add9
...
...
@@ -121,7 +121,7 @@ function _usage() {
${
BLUE
}
build_teleop
${
NO_COLOR
}
: run build with teleop enabled.
${
BLUE
}
build_prof [module]
${
NO_COLOR
}
: build with perf profiling support. Not implemented yet.
${
BLUE
}
doc
${
NO_COLOR
}
: generate doxygen document
${
BLUE
}
clean
${
NO_COLOR
}
: cleanup bazel output
s
and log/coredump files
${
BLUE
}
clean
${
NO_COLOR
}
: cleanup bazel output and log/coredump files
${
BLUE
}
usage
${
NO_COLOR
}
: show this message
"
}
...
...
@@ -193,7 +193,7 @@ function main() {
env
${
APOLLO_ENV
}
bash
"
${
APOLLO_ROOT_DIR
}
/scripts/apollo_lint.sh"
cpp
;;
clean
)
env
${
APOLLO_ENV
}
bash
"
${
APOLLO_ROOT_DIR
}
/scripts/apollo_clean.sh"
"
$@
"
env
${
APOLLO_ENV
}
bash
"
${
APOLLO_ROOT_DIR
}
/scripts/apollo_clean.sh"
"
-a
"
;;
doc
)
env
${
APOLLO_ENV
}
bash
"
${
APOLLO_ROOT_DIR
}
/scripts/apollo_docs.sh"
"
$@
"
...
...
scripts/apollo_clean.sh
浏览文件 @
22c3add9
...
...
@@ -24,7 +24,11 @@ source "${TOP_DIR}/scripts/apollo.bashrc"
CORE_DIR
=
"
${
TOP_DIR
}
/data/core"
LOG_DIR
=
"
${
TOP_DIR
}
/data/log"
function
_clean_cache
()
{
BAZEL_CLEAN_EXPUNGE
=
0
CORE_DUMP_CLEANUP
=
0
LOG_FILES_CLEANUP
=
0
function
_clean_bazel_cache
()
{
local
opt
=
"--async"
if
[
"
$1
"
==
"--expunge"
]
;
then
opt
=
"--expunge_async"
...
...
@@ -34,9 +38,9 @@ function _clean_cache() {
# Remove bazel cache in associated directories
if
[
-d
/apollo-simulator
]
;
then
pushd
/apollo-simulator
>
/dev/null
pushd
/apollo-simulator
>
/dev/null
bazel clean
${
opt
}
popd
>
/dev/null
popd
>
/dev/null
fi
}
...
...
@@ -66,33 +70,75 @@ function _clean_docs() {
function
_print_usage
()
{
echo
-e
"Usage:
\n
$0
[options]
\n
Options:"
echo
"
${
TAB
}
--bazel Remove bazel output"
echo
"
${
TAB
}
--core Remove coredump files"
echo
"
${
TAB
}
--log Remove log files"
echo
"
${
TAB
}
-a, --all Equivalent to
\"
--bazel --core --log
\"
"
echo
"
${
TAB
}
--expunge Run
\"
bazel clean --expunge
\"
"
echo
"
${
TAB
}
-h, --help Show this message"
}
function
parse_arguments
()
{
while
[
$#
-gt
0
]
;
do
local
opt
=
"
$1
"
shift
case
"
${
opt
}
"
in
--bazel
)
[
"
${
BAZEL_CLEAN_EXPUNGE
}
"
-eq
0
]
&&
BAZEL_CLEAN_EXPUNGE
=
1
;;
--core
)
CORE_DUMP_CLEANUP
=
1
;;
--log
)
LOG_FILES_CLEANUP
=
1
;;
--expunge
)
BAZEL_CLEAN_EXPUNGE
=
2
;;
-a
|
--all
)
CORE_DUMP_CLEANUP
=
1
LOG_FILES_CLEANUP
=
1
[
"
${
BAZEL_CLEAN_EXPUNGE
}
"
-eq
0
]
&&
BAZEL_CLEAN_EXPUNGE
=
1
;;
-h
|
--help
)
_print_usage
exit
1
;;
*
)
_print_usage
exit
1
;;
esac
done
}
function
main
()
{
if
[
"
$1
"
=
"-h"
]
||
[
"
$1
"
=
"--help"
]
;
then
_print_usage
exit
1
fi
parse_arguments
"
$@
"
if
!
"
${
APOLLO_IN_DOCKER
}
"
;
then
error
"The clean operation should be run from within docker container"
exit
1
fi
_clean_cache
"
$@
"
if
[
"
${
BAZEL_CLEAN_EXPUNGE
}
"
-eq
2
]
;
then
info
"Clean bazel cache, opcode=
${
BAZEL_CLEAN_EXPUNGE
}
"
_clean_bazel_cache
"--expunge"
elif
[
"
${
BAZEL_CLEAN_EXPUNGE
}
"
-eq
1
]
;
then
info
"Clean bazel cache, opcode=
${
BAZEL_CLEAN_EXPUNGE
}
"
_clean_bazel_cache
fi
_clean_config
_clean_docs
local
answer
typeset
-l
answer
warning
"Do you want to remove all log files under
\"
${
LOG_DIR
}
\"
"
\
"and core dump files under
\"
${
CORE_DIR
}
\"
(Y/n)?"
answer
=
$(
read_one_char_from_stdin
)
info
"Your choice is:
${
answer
}
"
if
[
"
${
answer
}
"
==
"y"
]
;
then
if
[
"
${
CORE_DUMP_CLEANUP
}
"
-eq
1
]
;
then
info
"Cleanup core dump files under data/core/ ..."
_clean_core
fi
if
[
"
${
LOG_FILES_CLEANUP
}
"
-eq
1
]
;
then
info
"Cleanup log files under data/log/ ..."
_clean_log
fi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录