apollo.sh 15.9 KB
Newer Older
D
Dong Li 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/usr/bin/env bash

###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

#=================================================
#                   Utils
#=================================================

S
siyangy 已提交
23 24 25
function source_apollo_base() {
  DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  cd "${DIR}"
D
Dong Li 已提交
26

S
siyangy 已提交
27 28
  source "${DIR}/scripts/apollo_base.sh"
}
29 30 31

function apollo_check_system_config() {
  # check operating system
32
  OP_SYSTEM=$(uname -s)
33
  case $OP_SYSTEM in
34 35
    "Linux")
      echo "System check passed. Build continue ..."
36 37 38 39 40 41 42

      # check system configuration
      DEFAULT_MEM_SIZE="2.0"
      MEM_SIZE=$(free | grep Mem | awk '{printf("%0.2f", $2 / 1024.0 / 1024.0)}')
      if (( $(echo "$MEM_SIZE < $DEFAULT_MEM_SIZE" | bc -l) )); then
         warning "System memory [${MEM_SIZE}G] is lower than minimum required memory size [2.0G]. Apollo build could fail."
      fi
43 44 45 46
      ;;
    "Darwin")
      warning "Mac OS is not officially supported in the current version. Build could fail. We recommend using Ubuntu 14.04."
      ;;
47
    *)
48 49 50 51
      error "Unsupported system: ${OP_SYSTEM}."
      error "Please use Linux, we recommend Ubuntu 14.04."
      exit 1
      ;;
52 53 54
  esac
}

S
siyangy 已提交
55 56 57
function check_machine_arch() {
  # the machine type, currently support x86_64, aarch64
  MACHINE_ARCH=$(uname -m)
D
Dong Li 已提交
58

S
siyangy 已提交
59 60 61 62 63 64 65 66 67 68
  # Generate WORKSPACE file based on marchine architecture
  if [ "$MACHINE_ARCH" == 'x86_64' ]; then
    sed "s/MACHINE_ARCH/x86_64/g" WORKSPACE.in > WORKSPACE
  elif [ "$MACHINE_ARCH" == 'aarch64' ]; then
    sed "s/MACHINE_ARCH/aarch64/g" WORKSPACE.in > WORKSPACE
  else
    fail "Unknown machine architecture $MACHINE_ARCH"
    exit 1
  fi
}
D
Dong Li 已提交
69 70

function check_esd_files() {
S
siyangy 已提交
71 72
  CAN_CARD="fake_can"

D
Dong Li 已提交
73 74 75 76
  if [ -f ./third_party/can_card_library/esd_can/include/ntcan.h \
      -a -f ./third_party/can_card_library/esd_can/lib/libntcan.so.4 \
      -a -f ./third_party/can_card_library/esd_can/lib/libntcan.so.4.0.1 ]; then
      USE_ESD_CAN=true
L
Lei Wang 已提交
77
      CAN_CARD="esd_can"
D
Dong Li 已提交
78
  else
79
      warning "ESD CAN library supplied by ESD Electronics does not exist. If you need ESD CAN, please refer to third_party/can_card_library/esd_can/README.md."
D
Dong Li 已提交
80 81 82 83 84 85
      USE_ESD_CAN=false
  fi
}

function generate_build_targets() {
  BUILD_TARGETS=$(bazel query //... | grep -v "_test$" | grep -v "third_party" \
86
    | grep -v "_cpplint$" | grep -v "release" | grep -v "kernel")
C
Calvin Miao 已提交
87 88 89
  if [ $? -ne 0 ]; then
    fail 'Build failed!'
  fi
D
Dong Li 已提交
90 91 92 93 94
  if ! $USE_ESD_CAN; then
     BUILD_TARGETS=$(echo $BUILD_TARGETS |tr ' ' '\n' | grep -v "hwmonitor" | grep -v "esd")
  fi
}

W
weidezhang 已提交
95 96 97
function generate_test_targets_dbg() {
  #because of pcl seg fault of 1.7.2 exclude perception on debug build of test
  TEST_TARGETS=$(bazel query //... | grep "_test$" | grep -v "third_party" | grep -v "kernel" | grep -v "perception")
D
Dong Li 已提交
98 99 100 101 102
  if ! $USE_ESD_CAN; then
     TEST_TARGETS=$(echo $TEST_TARGETS| tr ' ' '\n' | grep -v "hwmonitor" | grep -v "esd")
  fi
}

W
weidezhang 已提交
103 104 105 106
function generate_test_targets_opt() {
  TEST_TARGETS=$(bazel query //... | grep "_test$" | grep "perception")
}

D
Dong Li 已提交
107 108 109 110 111
#=================================================
#              Build functions
#=================================================

function apollo_build() {
S
siyangy 已提交
112
  START_TIME=$(get_now)
D
Dong Li 已提交
113

114
  echo "Start building, please wait ..."
D
Dong Li 已提交
115 116 117
  generate_build_targets
  echo "Building on $MACHINE_ARCH, with targets:"
  echo "$BUILD_TARGETS"
118
  echo "$BUILD_TARGETS" | xargs bazel --batch --batch_cpu_scheduling build --jobs=10 --define ARCH="$MACHINE_ARCH" --define CAN_CARD=${CAN_CARD} --cxxopt=-DUSE_ESD_CAN=${USE_ESD_CAN} -c dbg
D
Dong Li 已提交
119 120 121 122 123
  if [ $? -eq 0 ]; then
    success 'Build passed!'
  else
    fail 'Build failed!'
  fi
L
Lei Wang 已提交
124
  #build python proto
125
  chmod -R +w bazel-genfiles/modules
L
Lei Wang 已提交
126 127
  PROTOC='./bazel-out/host/bin/external/com_google_protobuf/protoc'
  find modules/ -name "*.proto" | grep -v gnss | xargs ${PROTOC} --python_out=bazel-genfiles
D
Dong Li 已提交
128
  find bazel-genfiles/* -type d -exec touch "{}/__init__.py" \;
129 130
  if [ -d "/home/tmp/conf" ];then
    sudo cp -r /home/tmp/conf bazel-apollo/external/ros/share/gnss_driver/
131 132
    sudo chown -R ${DOCKER_USER}:${DOCKER_GRP} "bazel-apollo/external/ros/share/gnss_driver/conf"
  fi
D
Dong Li 已提交
133 134 135
}

function check() {
S
siyangy 已提交
136
  local check_start_time=$(get_now)
D
Dong Li 已提交
137 138 139 140 141 142 143 144 145 146 147 148 149
  apollo_build && run_test && run_lint

  START_TIME=$check_start_time
  if [ $? -eq 0 ]; then
    success 'Check passed!'
    return 0
  else
    fail 'Check failed!'
    return 1
  fi
}

function warn_proprietary_sw() {
150 151 152 153 154 155
  echo -e "${RED}The release built contains proprietary software provided by other parties.${NO_COLOR}"
  echo -e "${RED}Make sure you have obtained proper licensing agreement for redistribution${NO_COLOR}"
  echo -e "${RED}if you intend to publish the release package built.${NO_COLOR}"
  echo -e "${RED}Such licensing agreement is solely between you and the other parties,${NO_COLOR}"
  echo -e "${RED}and is not covered by the license terms of the apollo project${NO_COLOR}"
  echo -e "${RED}(see file license).${NO_COLOR}"
D
Dong Li 已提交
156 157 158 159
}

function release() {
  ROOT_DIR=$HOME/.cache/release
160 161 162 163
  if [ -d $ROOT_DIR ];then
    rm -rf $ROOT_DIR
  fi
  mkdir -p $ROOT_DIR
D
Dong Li 已提交
164

S
siyangy 已提交
165
  # modules
D
Dong Li 已提交
166 167
  MODULES_DIR=$ROOT_DIR/modules
  mkdir -p $MODULES_DIR
168
  for m in control canbus localization decision perception prediction planning routing
D
Dong Li 已提交
169 170 171 172 173 174 175 176
  do
    TARGET_DIR=$MODULES_DIR/$m
    mkdir -p $TARGET_DIR
    cp bazel-bin/modules/$m/$m $TARGET_DIR
    if [ -d modules/$m/conf ];then
        cp -r modules/$m/conf $TARGET_DIR
    fi
    if [ -d modules/$m/data ];then
177
        cp -r modules/$m/data $TARGET_DIR
D
Dong Li 已提交
178 179
    fi
  done
S
siyangy 已提交
180 181

  # control tools
D
Dong Li 已提交
182 183
  mkdir $MODULES_DIR/control/tools
  cp bazel-bin/modules/control/tools/pad_terminal $MODULES_DIR/control/tools
S
siyangy 已提交
184

D
Dong Li 已提交
185 186 187
  #remove all pyc file in modules/
  find modules/ -name "*.pyc" | xargs -I {} rm {}
  cp -r modules/tools $MODULES_DIR
S
siyangy 已提交
188 189

  # ros
190
  cp -Lr bazel-apollo/external/ros $ROOT_DIR/
S
siyangy 已提交
191 192

  # scripts
D
Dong Li 已提交
193
  cp -r scripts $ROOT_DIR
S
siyangy 已提交
194

D
Dong Li 已提交
195 196 197
  #dreamview
  cp -Lr bazel-bin/modules/dreamview/dreamview.runfiles/apollo/modules/dreamview $MODULES_DIR
  cp -r modules/dreamview/conf $MODULES_DIR/dreamview
S
siyangy 已提交
198

199 200 201 202
  # map
  mkdir $MODULES_DIR/map
  cp -r modules/map/data $MODULES_DIR/map

S
siyangy 已提交
203
  # common data
D
Dong Li 已提交
204 205
  mkdir $MODULES_DIR/common
  cp -r modules/common/data $MODULES_DIR/common
S
siyangy 已提交
206 207

  # hmi
208 209
  mkdir -p $MODULES_DIR/hmi/ros_bridge $MODULES_DIR/hmi/utils
  cp bazel-bin/modules/hmi/ros_bridge/ros_bridge $MODULES_DIR/hmi/ros_bridge/
D
Dong Li 已提交
210 211 212
  cp -r modules/hmi/conf $MODULES_DIR/hmi
  cp -r modules/hmi/web $MODULES_DIR/hmi
  cp -r modules/hmi/utils/*.py $MODULES_DIR/hmi/utils
S
siyangy 已提交
213

D
Dong Li 已提交
214 215 216 217
  # lib
  LIB_DIR=$ROOT_DIR/lib
  mkdir $LIB_DIR
  if $USE_ESD_CAN; then
L
Lei Wang 已提交
218
    warn_proprietary_sw
D
Dong Li 已提交
219 220 221 222
    for m in esd_can
    do
        cp third_party/can_card_library/$m/lib/* $LIB_DIR
    done
S
siyangy 已提交
223
    # hw check
D
Dong Li 已提交
224 225 226 227 228 229 230
    mkdir -p $MODULES_DIR/monitor/hwmonitor/hw_check/
    cp bazel-bin/modules/monitor/hwmonitor/hw_check/can_check $MODULES_DIR/monitor/hwmonitor/hw_check/
    cp bazel-bin/modules/monitor/hwmonitor/hw_check/gps_check $MODULES_DIR/monitor/hwmonitor/hw_check/
    mkdir -p $MODULES_DIR/monitor/hwmonitor/hw/tools/
    cp bazel-bin/modules/monitor/hwmonitor/hw/tools/esdcan_test_app $MODULES_DIR/monitor/hwmonitor/hw/tools/
  fi
  cp -r bazel-genfiles/* $LIB_DIR
231

D
Dong Li 已提交
232 233 234 235
  # doc
  cp -r docs $ROOT_DIR
  cp LICENSE $ROOT_DIR
  cp third_party/ACKNOWLEDGEMENT.txt $ROOT_DIR
S
siyangy 已提交
236 237

  # release info
D
Dong Li 已提交
238 239 240 241 242 243 244
  META=${ROOT_DIR}/meta.txt
  echo "Git commit: $(git show --oneline  -s | awk '{print $1}')" > $META
  echo "Build time: $TIME" >>  $META
}

function gen_coverage() {
  bazel clean
W
weidezhang 已提交
245
  generate_test_targets_dbg
D
Dong Li 已提交
246 247 248 249
  echo "$TEST_TARGETS" | xargs bazel test --define ARCH="$(uname -m)" --define CAN_CARD=${CAN_CARD} --cxxopt=-DUSE_ESD_CAN=${USE_ESD_CAN} -c dbg --config=coverage
  if [ $? -ne 0 ]; then
    fail 'run test failed!'
  fi
S
siyangy 已提交
250

W
weidezhang 已提交
251 252 253 254 255 256
  generate_test_targets_opt
  echo "$TEST_TARGETS" | xargs bazel test --define ARCH="$(uname -m)" --define CAN_CARD=${CAN_CARD} --cxxopt=-DUSE_ESD_CAN=${USE_ESD_CAN} -c opt --config=coverage
  if [ $? -ne 0 ]; then
    fail 'run test failed!'
  fi

D
Dong Li 已提交
257 258 259 260 261 262 263 264
  COV_DIR=data/cov
  rm -rf $COV_DIR
  files=$(find bazel-out/local-dbg/bin/modules/ -iname "*.gcda" -o -iname "*.gcno" | grep -v external)
  for f in $files; do
    target="$COV_DIR/objs/modules/${f##*modules}"
    mkdir -p "$(dirname "$target")"
    cp "$f" "$target"
  done
265 266 267 268 269 270 271 272

  files=$(find bazel-out/local-opt/bin/modules/ -iname "*.gcda" -o -iname "*.gcno" | grep -v external)
  for f in $files; do
    target="$COV_DIR/objs/modules/${f##*modules}"
    mkdir -p "$(dirname "$target")"
    cp "$f" "$target"
  done

D
Dong Li 已提交
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
  lcov --capture --directory "$COV_DIR/objs" --output-file "$COV_DIR/conv.info"
  if [ $? -ne 0 ]; then
    fail 'lcov failed!'
  fi
  lcov --remove "$COV_DIR/conv.info" \
      "external/*" \
      "/usr/*" \
      "bazel-out/*" \
      "*third_party/*" \
      "tools/*" \
      -o $COV_DIR/stripped_conv.info
  genhtml $COV_DIR/stripped_conv.info --output-directory $COV_DIR/report
  echo "Generated coverage report in $COV_DIR/report/index.html"
}

function run_test() {
S
siyangy 已提交
289
  START_TIME=$(get_now)
D
Dong Li 已提交
290

W
weidezhang 已提交
291 292 293
  # FIXME(all): when all unit test passed, switch back.
  # bazel test --config=unit_test -c dbg //...
  generate_test_targets_dbg
294
  echo "$TEST_TARGETS" | xargs bazel test --define "ARCH=$MACHINE_ARCH"  --define CAN_CARD=${CAN_CARD} --config=unit_test --cxxopt=-DUSE_ESD_CAN=${USE_ESD_CAN} -c dbg --test_verbose_timeout_warnings
W
weidezhang 已提交
295
  RES1=$?
296 297 298 299 300
  if [ $RES1 -ne 0 ]; then
      fail "Test failed!"
      return 1
  fi

W
weidezhang 已提交
301
  generate_test_targets_opt
302 303
  build_caffe_opt
  run_ldconfig
304
  echo "$TEST_TARGETS" | xargs bazel test --define "ARCH=$MACHINE_ARCH"  --define CAN_CARD=${CAN_CARD} --config=unit_test --cxxopt=-DUSE_ESD_CAN=${USE_ESD_CAN} -c opt --test_verbose_timeout_warnings
W
weidezhang 已提交
305
  RES2=$?
306
  if [ $RES2 -eq 0 ]; then
D
Dong Li 已提交
307 308 309 310 311 312 313 314 315 316 317 318 319
    success 'Test passed!'
    return 0
  else
    fail 'Test failed!'
    return 1
  fi
}

function run_cpp_lint() {
  bazel test --config=cpplint //...
}

function run_bash_lint() {
320
  FILES=$(find "${APOLLO_ROOT_DIR}" -type f -name "*.sh" | grep -v ros | grep -v kernel)
D
Dong Li 已提交
321 322 323 324
  echo "${FILES}" | xargs shellcheck
}

function run_lint() {
S
siyangy 已提交
325
  START_TIME=$(get_now)
D
Dong Li 已提交
326 327
  run_cpp_lint

C
Calvin Miao 已提交
328 329 330 331 332 333 334 335
  # Add cpplint rule to BUILD files that do not contain it.
  for file in $(find modules -name BUILD | \
    xargs grep -l -E 'cc_library|cc_test|cc_binary' | xargs grep -L 'cpplint()')
  do
    sed -i '1i\load("//tools:cpplint.bzl", "cpplint")\n' $file
    sed -i -e '$a\\ncpplint()' $file
  done

D
Dong Li 已提交
336 337 338 339 340 341 342 343
  if [ $? -eq 0 ]; then
    success 'Lint passed!'
  else
    fail 'Lint failed!'
  fi
}

function clean() {
344
  bazel clean --async
D
Dong Li 已提交
345 346 347
}

function buildify() {
348 349 350 351 352 353 354 355 356 357 358 359
  START_TIME=$(get_now)

  local buildifier_url=https://github.com/bazelbuild/buildtools/releases/download/0.4.5/buildifier
  wget $buildifier_url -O ~/.buildifier
  chmod +x ~/.buildifier
  find . -name BUILD -type f -exec ~/.buildifier -showlog -mode=fix {} +
  if [ $? -eq 0 ]; then
    success 'Buildify worked!'
  else
    fail 'Buildify failed!'
  fi
  rm ~/.buildifier
D
Dong Li 已提交
360 361
}

S
siyangy 已提交
362 363 364 365 366 367
function build_fe() {
  cd modules/dreamview/frontend
  yarn build
  cd -
}

D
Dong Li 已提交
368 369 370 371
function print_usage() {
  echo 'Usage:
  ./apollo.sh [OPTION]'
  echo 'Options:
S
siyangy 已提交
372
  build: run build only
S
siyangy 已提交
373
  build_fe: compile frontend javascript code, this requires all the node_modules to be installed already
D
Dong Li 已提交
374 375 376
  buildify: fix style of BUILD files
  check: run build/lint/test, please make sure it passes before checking in new code
  clean: runs Bazel clean
377
  config: run configurator tool
D
Dong Li 已提交
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399
  coverage: generate test coverage report
  doc: generate doxygen document
  lint: run code style check
  print_usage: prints this menu
  release: to build release version
  test: run all the unit tests
  version: current commit and date
  '
}

function gen_doc() {
  rm -rf docs/doxygen
  doxygen apollo.doxygen
}

function version() {
  commit=$(git log -1 --pretty=%H)
  date=$(git log -1 --pretty=%cd)
  echo "Commit: ${commit}"
  echo "Date: ${date}"
}

S
siyangy 已提交
400
function build_gnss() {
401
  CURRENT_PATH=$(pwd)
L
Lei Wang 已提交
402 403 404 405 406 407
  if [ -d "${CURRENT_PATH}/bazel-apollo/external/ros" ]; then
    ROS_PATH="${CURRENT_PATH}/bazel-apollo/external/ros"
  else
    warning "ROS not found. Run apolllo.sh build first."
    exit 1
  fi
408

L
Lei Wang 已提交
409
  source "${ROS_PATH}/setup.bash"
410 411 412 413 414 415 416 417 418 419 420

  protoc modules/common/proto/error_code.proto --cpp_out=./
  protoc modules/common/proto/header.proto --cpp_out=./
  protoc modules/common/proto/geometry.proto --cpp_out=./

  protoc modules/localization/proto/imu.proto --cpp_out=./
  protoc modules/localization/proto/gps.proto --cpp_out=./
  protoc modules/localization/proto/pose.proto --cpp_out=./

  protoc modules/drivers/gnss/proto/gnss.proto --cpp_out=./
  protoc modules/drivers/gnss/proto/imu.proto --cpp_out=./
F
fengkaiwen01 已提交
421
  protoc modules/drivers/gnss/proto/ins.proto --cpp_out=./ --python_out=./
422
  protoc modules/drivers/gnss/proto/config.proto --cpp_out=./
F
fengkaiwen01 已提交
423
  protoc modules/drivers/gnss/proto/gnss_status.proto --cpp_out=./ --python_out=./
424 425 426
  protoc modules/drivers/gnss/proto/gpgga.proto --cpp_out=./

  cd modules
F
fengkaiwen01 已提交
427
  catkin_make_isolated --install --source drivers/gnss \
L
Lei Wang 已提交
428
    --install-space "${ROS_PATH}" -DCMAKE_BUILD_TYPE=Release \
429
    --cmake-args --no-warn-unused-cli
L
Lei Wang 已提交
430
  find "${ROS_PATH}" -name "*.pyc" -print0 | xargs -0 rm -rf
431 432 433 434 435 436
  cd -

  rm -rf modules/common/proto/*.pb.cc
  rm -rf modules/common/proto/*.pb.h
  rm -rf modules/drivers/gnss/proto/*.pb.cc
  rm -rf modules/drivers/gnss/proto/*.pb.h
F
fengkaiwen01 已提交
437
  rm -rf modules/drivers/gnss/proto/*_pb2.py
438 439 440 441 442 443
  rm -rf modules/localization/proto/*.pb.cc
  rm -rf modules/localization/proto/*.pb.h

  rm -rf modules/.catkin_workspace
  rm -rf modules/build_isolated/
  rm -rf modules/devel_isolated/
D
Dong Li 已提交
444 445
}

F
fengkaiwen01 已提交
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468
function build_velodyne() {
  CURRENT_PATH=$(pwd)
  if [ -d "${CURRENT_PATH}/bazel-apollo/external/ros" ]; then
    ROS_PATH="${CURRENT_PATH}/bazel-apollo/external/ros"
  else
    warning "ROS not found. Run apolllo.sh build first."
    exit 1
  fi

  source "${ROS_PATH}/setup.bash"

  cd modules
  catkin_make_isolated --install --source drivers/velodyne \
    --install-space "${ROS_PATH}" -DCMAKE_BUILD_TYPE=Release \
    --cmake-args --no-warn-unused-cli
  find "${ROS_PATH}" -name "*.pyc" -print0 | xargs -0 rm -rf
  cd -

  rm -rf modules/.catkin_workspace
  rm -rf modules/build_isolated/
  rm -rf modules/devel_isolated/
}

469 470 471 472 473 474 475 476 477 478 479 480 481 482
function run_ldconfig() {
  sudo ldconfig
}

function build_caffe_opt() {
  echo "Build Caffe (opt model) ..."
  bazel build --define ARCH="$MACHINE_ARCH" --define CAN_CARD=${CAN_CARD} --cxxopt=-DUSE_ESD_CAN=${USE_ESD_CAN} -c opt @caffe//:lib
}

function build_caffe_dbg() {
  echo "Build Caffe (dbg model) ..."
  bazel build --define ARCH="$MACHINE_ARCH" --define CAN_CARD=${CAN_CARD} --cxxopt=-DUSE_ESD_CAN=${USE_ESD_CAN} -c dbg @caffe//:lib
}

483
function config() {
484
  ${APOLLO_ROOT_DIR}/scripts/configurator.sh
485 486
}

S
siyangy 已提交
487 488 489 490 491 492 493 494
function link_cpu_caffe_build() {
  echo "Link CPU version of caffe.BUILD ..."
  rm -f third_party/caffe.BUILD
  cd third_party
  ln -sf caffe_cpu.BUILD caffe.BUILD
  cd ..
}

S
siyangy 已提交
495 496 497 498 499
function main() {
  source_apollo_base
  apollo_check_system_config
  check_machine_arch
  check_esd_files
S
siyangy 已提交
500
  link_cpu_caffe_build
S
siyangy 已提交
501 502 503 504 505 506 507 508

  case $1 in
    check)
      check
      ;;
    build)
      apollo_build
      ;;
S
siyangy 已提交
509 510 511
    build_fe)
      build_fe
      ;;
S
siyangy 已提交
512 513 514 515 516 517
    buildify)
      buildify
      ;;
    buildgnss)
      build_gnss
      ;;
F
fengkaiwen01 已提交
518 519 520
    buildvelodyne)
      build_velodyne
      ;;
521 522 523
    config)
      config
      ;;
S
siyangy 已提交
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
    doc)
      gen_doc
      ;;
    lint)
      run_lint
      ;;
    test)
      run_test
      ;;
    release)
      release 1
      ;;
    release_noproprietary)
      release 0
      ;;
    coverage)
      gen_coverage
      ;;
    clean)
      clean
      ;;
    version)
      version
      ;;
    *)
      print_usage
      ;;
  esac
}

main $@