From a84c15e7e9a1597a6e2f23715c891dfa4247e808 Mon Sep 17 00:00:00 2001 From: storypku Date: Thu, 18 Jun 2020 17:52:09 +0800 Subject: [PATCH] Scripts: configurator for apollo6.sh --- apollo6.sh | 3 +++ scripts/apollo_buildify.sh | 4 ++-- scripts/apollo_clean.sh | 6 +++--- scripts/apollo_docs.sh | 4 ++-- scripts/apollo_lint.sh | 4 ++-- scripts/configurator.sh | 10 ++++------ what_works.sh | 1 + 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/apollo6.sh b/apollo6.sh index 4a5bedce32..f70673823f 100755 --- a/apollo6.sh +++ b/apollo6.sh @@ -108,6 +108,9 @@ function main() { doc) ${APOLLO_ROOT_DIR}/scripts/apollo_docs.sh "$@" ;; + configurator) # Consult Kecheng Xu + ${APOLLO_ROOT_DIR}/scripts/configurator.sh "$@" + ;; usage) _usage ;; diff --git a/scripts/apollo_buildify.sh b/scripts/apollo_buildify.sh index d58ae5e65a..37a98c44c7 100755 --- a/scripts/apollo_buildify.sh +++ b/scripts/apollo_buildify.sh @@ -2,8 +2,8 @@ set -e -TOPDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" -source "${TOPDIR}/scripts/apollo.bashrc" +TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +source "${TOP_DIR}/scripts/apollo.bashrc" function buildify() { local stage="${1:-dev}" diff --git a/scripts/apollo_clean.sh b/scripts/apollo_clean.sh index 0248208e46..331759dc03 100755 --- a/scripts/apollo_clean.sh +++ b/scripts/apollo_clean.sh @@ -1,8 +1,8 @@ #! /usr/bin/env bash set -e -TOPDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" -source "${TOPDIR}/scripts/apollo.bashrc" +TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +source "${TOP_DIR}/scripts/apollo.bashrc" function clean() { local stage="$1"; shift @@ -13,7 +13,7 @@ function clean() { fi bazel clean --async - docs_sh="${TOPDIR}/scripts/apollo_docs.sh" + docs_sh="${TOP_DIR}/scripts/apollo_docs.sh" if [ -f "${docs_sh}" ]; then bash "${docs_sh}" clean "${stage}" fi diff --git a/scripts/apollo_docs.sh b/scripts/apollo_docs.sh index ef038255a2..f31524afe5 100755 --- a/scripts/apollo_docs.sh +++ b/scripts/apollo_docs.sh @@ -1,8 +1,8 @@ #! /usr/bin/env bash set -e -TOPDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" -source "${TOPDIR}/scripts/apollo.bashrc" +TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +source "${TOP_DIR}/scripts/apollo.bashrc" APOLLO_DOCS_CFG="${APOLLO_ROOT_DIR}/apollo.doxygen" APOLLO_DOCS_DIR="${APOLLO_ROOT_DIR}/.cache/docs" diff --git a/scripts/apollo_lint.sh b/scripts/apollo_lint.sh index 2a42b19fef..efcac3fe3c 100755 --- a/scripts/apollo_lint.sh +++ b/scripts/apollo_lint.sh @@ -1,8 +1,8 @@ #! /usr/bin/env bash set -e -TOPDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" -source "${TOPDIR}/scripts/apollo.bashrc" +TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +source "${TOP_DIR}/scripts/apollo.bashrc" function cpp_lint() { info "running cpp_lint ..." diff --git a/scripts/configurator.sh b/scripts/configurator.sh index a2ba3ec098..b10d82666e 100755 --- a/scripts/configurator.sh +++ b/scripts/configurator.sh @@ -16,11 +16,9 @@ # limitations under the License. ############################################################################### +set -e -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +source "${TOP_DIR}/scripts/apollo.bashrc" -cd "${DIR}/.." - -source "${DIR}/apollo_base.sh" - -python modules/tools/configurator/configurator.py +python3 "${TOP_DIR}/modules/tools/configurator/configurator.py" diff --git a/what_works.sh b/what_works.sh index 50582dc647..ad17dc266f 100755 --- a/what_works.sh +++ b/what_works.sh @@ -159,6 +159,7 @@ echo "########################### All check passed! ###########################" # See https://pypi.org/project/pycodestyle/ # TODO(?): Use py_library, py_binary, py_test to manage python code: # See https://docs.bazel.build/versions/master/be/python.html +# TODO(Kecheng Xu): modules/tools/configurator/configurator.py: 2to3 # TODO(storypku): cyber.aarch64 docker image # TODO(storypku): tools/workspace.bzl to re-org WORKSPACE.in # TODO(?): no break for cpu only build -- GitLab