what_works.sh 3.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/usr/bin/env bash

###############################################################################
# Copyright 2020 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.
###############################################################################
# For development only! Will remove before merging to master!
19 20 21 22
# Testing steps:
# 1. Start container: ./docker/scripts/dev_start.sh
# 2. Login to container: ./docker/scripts/dev_into.sh
# 3. Run this script.
23 24 25 26 27
###############################################################################

cd "$( dirname "${BASH_SOURCE[0]}" )"
cp WORKSPACE.in WORKSPACE

28 29 30
# Fail on first failure.
set -e

31 32
./bootstrap.sh --noninteractive

33 34 35 36 37 38 39 40
function bazel_build_with_dist_cache() {
    bazel build --distdir=/apollo/.cache/distdir $@
}

function bazel_test_with_dist_cache() {
    bazel test --distdir=/apollo/.cache/distdir $@
}

41
# Working parts.
42
bazel_build_with_dist_cache \
X
Xiangquan Xiao 已提交
43 44 45 46
    //cyber/... \
    //modules/bridge/... \
    //modules/canbus/... \
    //modules/common/... \
47
    //modules/map/...    \
X
Xiangquan Xiao 已提交
48
    //modules/control/... \
X
Xiangquan Xiao 已提交
49
    //modules/data/... \
X
Xiangquan Xiao 已提交
50 51 52
    //modules/monitor/... \
    //modules/routing/... \
    //modules/storytelling/... \
S
storypku 已提交
53
    //modules/transform/... \
54
    //modules/v2x/... \
S
storypku 已提交
55 56
    //modules/dreamview/... \
    //modules/guardian/...
X
Xiangquan Xiao 已提交
57

58
bazel_test_with_dist_cache \
X
Xiangquan Xiao 已提交
59 60 61 62
    //cyber/... \
    //modules/bridge/... \
    //modules/canbus/... \
    //modules/common/... \
63
    //modules/map/...    \
X
Xiangquan Xiao 已提交
64
    //modules/control/... \
X
Xiangquan Xiao 已提交
65
    //modules/data/... \
X
Xiangquan Xiao 已提交
66 67 68
    //modules/monitor/... \
    //modules/routing/... \
    //modules/storytelling/... \
S
storypku 已提交
69
    //modules/transform/... \
70
    //modules/v2x/... \
S
storypku 已提交
71 72
    //modules/dreamview/... \
    //modules/guardian/...
S
storypku 已提交
73

S
storypku 已提交
74
bash scripts/install_esdcan_library.sh install
75 76
bazel_build_with_dist_cache //modules/drivers/...
bazel_test_with_dist_cache //modules/drivers/...
S
storypku 已提交
77
bash scripts/install_esdcan_library.sh uninstall
78

79
bazel_build_with_dist_cache //modules/tools/...
80
# Note(storypku): bazel test works except some lint errors in cyber_visualizer.
S
storypku 已提交
81
# Check cyber_visualizer's functionality once stablized.
82
bazel_test_with_dist_cache $(bazel query //modules/tools/... except //modules/tools/visualizer/...)
83 84
# bazel_build_with_dist_cache $(bazel query //modules/planning/... except //modules/planning/tools:inference_demo)

85 86 87

# In-progress parts. Feel free to claim by adding your name in TODO and move it

S
storypku 已提交
88
# TODO(?): bazel build //modules/contrib/...
89
# TODO(storypku): bazel test //modules/planning/...
Carollf's avatar
Carollf 已提交
90
# TODO(liufeng): bazel build //modules/localization/...
91
# TODO(?): bazel build //modules/perception/...
92
# TODO(changsh726): bazel build //modules/prediction/...
93
# TODO(?): bazel build //modules/third_party_perception/...
X
Xiangquan Xiao 已提交
94 95 96 97 98 99 100 101 102 103
# TODO(?): apollo.sh build
# TODO(?): apollo.sh test
# TODO(?): apollo.sh lint
# TODO(?): apollo.sh check
# TODO(?): bstart; apollo.sh check
# TODO(?): replay-engine image which is compatible with docker_dev branch.
# TODO(?): Integrate pycodestyle (or similar) into "apollo.sh lint" to lint python code.
#          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
104
# TODO(storypku): no break for cpu only build
S
storypku 已提交
105
# TODO(storypku): cyber.aarch64 docker image
106
# TODO(storypku): tools/workspace.bzl to re-org WORKSPACE.in