提交 72b18f2c 编写于 作者: S storypku

Scripts: move apollo_clean out of crowded new_apollo.sh

上级 4fc9075d
...@@ -84,21 +84,6 @@ function apollo_env_setup() { ...@@ -84,21 +84,6 @@ function apollo_env_setup() {
info "${TAB}STAGE: ${STAGE}" info "${TAB}STAGE: ${STAGE}"
} }
function run_cleanup() {
if ! "${APOLLO_IN_DOCKER}" ; then
error "The clean operation must be run from within docker container"
exit 1
fi
bazel clean --async
# Remove bazel cache in associated directories
if [ -d /apollo-simulator ]; then
pushd /apollo-simulator >/dev/null
bazel clean --async
popd >/dev/null
fi
}
function _usage() { function _usage() {
warning "Usage: Not implemented yet" warning "Usage: Not implemented yet"
} }
...@@ -111,9 +96,6 @@ function main() { ...@@ -111,9 +96,6 @@ function main() {
fi fi
local cmd="$1"; shift local cmd="$1"; shift
case "${cmd}" in case "${cmd}" in
doc)
${APOLLO_ROOT_DIR}/scripts/apollo_docs.sh "$@"
;;
buildify) buildify)
${APOLLO_ROOT_DIR}/scripts/apollo_buildify.sh "${STAGE}" ${APOLLO_ROOT_DIR}/scripts/apollo_buildify.sh "${STAGE}"
;; ;;
...@@ -121,7 +103,10 @@ function main() { ...@@ -121,7 +103,10 @@ function main() {
${APOLLO_ROOT_DIR}/scripts/apollo_lint.sh "${STAGE}" ${APOLLO_ROOT_DIR}/scripts/apollo_lint.sh "${STAGE}"
;; ;;
clean) clean)
run_cleanup ${APOLLO_ROOT_DIR}/scripts/apollo_clean.sh "${STAGE}"
;;
doc)
${APOLLO_ROOT_DIR}/scripts/apollo_docs.sh "$@"
;; ;;
usage) usage)
_usage _usage
......
#! /usr/bin/env bash
set -e
TOPDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
source "${TOPDIR}/scripts/apollo.bashrc"
function clean() {
local stage="$1"; shift
if ! "${APOLLO_IN_DOCKER}" ; then
error "The clean operation must be run from within docker container"
exit 1
fi
bazel clean --async
docs_sh="${TOPDIR}/scripts/apollo_docs.sh"
if [ -f "${docs_sh}" ]; then
bash "${docs_sh}" clean "${stage}"
fi
if [ "${stage}" != "dev" ]; then
success "Apollo cleanup done."
return
fi
# Remove bazel cache in associated directories
if [ -d /apollo-simulator ]; then
pushd /apollo-simulator >/dev/null
bazel clean --async
popd >/dev/null
fi
success "Done $0 ${stage}."
}
function main() {
local stage="${1:-dev}"
clean "${stage}"
}
main "$@"
...@@ -44,7 +44,7 @@ function generate_docs() { ...@@ -44,7 +44,7 @@ function generate_docs() {
if ! $gendoc ; then if ! $gendoc ; then
return return
fi fi
info "Generating Apollo Docs..." info "Generating Apollo docs..."
local doxygen_cmd="$(command -v doxygen)" local doxygen_cmd="$(command -v doxygen)"
if [ -z "${doxygen_cmd}" ]; then if [ -z "${doxygen_cmd}" ]; then
error "Command 'doxygen' not found. Please install it manually." error "Command 'doxygen' not found. Please install it manually."
...@@ -72,7 +72,7 @@ function clean_docs() { ...@@ -72,7 +72,7 @@ function clean_docs() {
rm -rf "${APOLLO_DOCS_DIR}" rm -rf "${APOLLO_DOCS_DIR}"
success "Done cleanup apollo docs in ${APOLLO_DOCS_DIR}" success "Done cleanup apollo docs in ${APOLLO_DOCS_DIR}"
else else
success "Docs directory '${APOLLO_DOCS_DIR}' empty. Do nothing." success "Nothing to do for empty directory '${APOLLO_DOCS_DIR}'."
fi fi
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册