提交 16128aca 编写于 作者: S storypku 提交者: Liu Jiaming

Script: variable renaming for readability

上级 7c0bc5e8
......@@ -68,15 +68,15 @@ function _determine_map_disabled() {
function determine_disabled_build_targets() {
DISABLED_TARGETS=""
local compo="$1"
if [ -z "${compo}" ]; then
local component="$1"
if [ -z "${component}" ]; then
_determine_drivers_disabled
_determine_localization_disabled
_determine_perception_disabled
_determine_planning_disabled
_determine_map_disabled
else
case "${compo}" in
case "${component}" in
drivers)
_determine_drivers_disabled
;;
......@@ -112,20 +112,20 @@ function determine_build_targets() {
return
fi
for compo in $@; do
for component in $@; do
local build_targets
local exceptions
if [[ "${compo}" == "cyber" ]]; then
if [[ "${component}" == "cyber" ]]; then
if [[ "${ARCH}" == "x86_64" ]]; then
build_targets="//cyber/... union //modules/tools/visualizer/..."
else
build_targets="//cyber/..."
fi
elif [[ -d "${APOLLO_ROOT_DIR}/modules/${compo}" ]]; then
exceptions="$(determine_disabled_build_targets ${compo})"
build_targets="//modules/${compo}/... ${exceptions}"
elif [[ -d "${APOLLO_ROOT_DIR}/modules/${component}" ]]; then
exceptions="$(determine_disabled_build_targets ${component})"
build_targets="//modules/${component}/... ${exceptions}"
else
error "Oops, no such component '${compo}' under <APOLLO_ROOT_DIR>/modules/ . Exiting ..."
error "Oops, no such component '${component}' under <APOLLO_ROOT_DIR>/modules/ . Exiting ..."
exit 1
fi
if [ -z "${targets_all}" ]; then
......@@ -207,7 +207,7 @@ function build_simulator() {
else
fail "Building Apollo simulator failed."
fi
popd > /dev/null
popd >/dev/null
fi
}
......
......@@ -76,15 +76,15 @@ function determine_disabled_targets() {
fi
local disabled=
for compo in $@; do
if [[ "${compo}" == "drivers" ]]; then
for component in $@; do
if [[ "${component}" == "drivers" ]]; then
if ! ${USE_ESD_CAN}; then
warning "ESD CAN library supplied by ESD Electronics doesn't exist."
warning "If you need ESD CAN, please refer to:"
warning " third_party/can_card_library/esd_can/README.md"
disabled="${disabled} except //modules/drivers/canbus/can_client/esd/..."
fi
elif [[ "${compo}" == "localization" ]]; then
elif [[ "${component}" == "localization" ]]; then
if [[ "${ARCH}" != "x86_64" ]]; then
disabled="${disabled} except //modules/localization/msf/..."
fi
......@@ -103,14 +103,14 @@ function determine_test_targets() {
return
fi
for compo in $@; do
for component in $@; do
local test_targets
if [[ "${compo}" == "cyber" ]]; then
if [[ "${component}" == "cyber" ]]; then
test_targets="//cyber/..."
elif [[ -d "${APOLLO_ROOT_DIR}/modules/${compo}" ]]; then
test_targets="//modules/${compo}/..."
elif [[ -d "${APOLLO_ROOT_DIR}/modules/${component}" ]]; then
test_targets="//modules/${component}/..."
else
error "Oops, no such component '${compo}' under <APOLLO_ROOT_DIR>/modules/ . Exiting ..."
error "Oops, no such component '${component}' under <APOLLO_ROOT_DIR>/modules/ . Exiting ..."
exit 1
fi
if [ -z "${targets_all}" ]; then
......
......@@ -87,23 +87,23 @@ function determine_disabled_targets() {
return
fi
for compo in $@; do
case "${compo}" in
drivers)
_determine_drivers_disabled
;;
localization)
_determine_localization_disabled
;;
perception)
_determine_perception_disabled
;;
planning)
_determine_planning_disabled
;;
map)
_determine_map_disabled
;;
for component in $@; do
case "${component}" in
drivers)
_determine_drivers_disabled
;;
localization)
_determine_localization_disabled
;;
perception)
_determine_perception_disabled
;;
planning)
_determine_planning_disabled
;;
map)
_determine_map_disabled
;;
esac
done
......@@ -118,14 +118,14 @@ function determine_test_targets() {
return
fi
for compo in $@; do
for component in $@; do
local test_targets
if [[ "${compo}" == "cyber" ]]; then
if [[ "${component}" == "cyber" ]]; then
test_targets="//cyber/..."
elif [[ -d "${APOLLO_ROOT_DIR}/modules/${compo}" ]]; then
test_targets="//modules/${compo}/..."
elif [[ -d "${APOLLO_ROOT_DIR}/modules/${component}" ]]; then
test_targets="//modules/${component}/..."
else
error "Oops, no such component '${compo}' under <APOLLO_ROOT_DIR>/modules/ . Exiting ..."
error "Oops, no such component '${component}' under <APOLLO_ROOT_DIR>/modules/ . Exiting ..."
exit 1
fi
if [ -z "${targets_all}" ]; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册