what_works.sh 4.2 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
###############################################################################

cd "$( dirname "${BASH_SOURCE[0]}" )"
26 27 28 29 30 31 32

if dpkg -l |grep -q "libpython2.7-dev"; then
	echo "libpython2.7-dev is already installed"
else
	sudo apt-get -y update
	sudo apt-get -y install libpython2.7-dev
fi
33

34 35
cp WORKSPACE.in WORKSPACE

36 37 38
# Fail on first failure.
set -e

39 40
./bootstrap.sh --noninteractive

41
function bazel_build_with_dist_cache() {
L
Liu Jiaming 已提交
42
    bazel build --distdir=/apollo/.cache/distdir "$@"
43 44 45
}

function bazel_test_with_dist_cache() {
L
Liu Jiaming 已提交
46
    bazel test --distdir=/apollo/.cache/distdir "$@"
47 48
}

49
# Working parts.
50
bazel_build_with_dist_cache \
X
Xiangquan Xiao 已提交
51 52 53 54
    //cyber/... \
    //modules/bridge/... \
    //modules/canbus/... \
    //modules/common/... \
55
    //modules/map/...    \
X
Xiangquan Xiao 已提交
56
    //modules/control/... \
X
Xiangquan Xiao 已提交
57
    //modules/data/... \
X
Xiangquan Xiao 已提交
58 59 60
    //modules/monitor/... \
    //modules/routing/... \
    //modules/storytelling/... \
S
storypku 已提交
61
    //modules/transform/... \
62
    //modules/v2x/... \
S
storypku 已提交
63
    //modules/dreamview/... \
64
    //modules/guardian/... \
65
    //modules/localization/... \
66
    //modules/prediction/... \
67
    //modules/contrib/... \
68
    //modules/third_party_perception/...
X
Xiangquan Xiao 已提交
69

70
bazel_test_with_dist_cache \
X
Xiangquan Xiao 已提交
71 72 73 74 75
    //cyber/... \
    //modules/bridge/... \
    //modules/canbus/... \
    //modules/common/... \
    //modules/control/... \
X
Xiangquan Xiao 已提交
76
    //modules/data/... \
X
Xiangquan Xiao 已提交
77 78 79
    //modules/monitor/... \
    //modules/routing/... \
    //modules/storytelling/... \
S
storypku 已提交
80
    //modules/transform/... \
81
    //modules/v2x/... \
S
storypku 已提交
82
    //modules/dreamview/... \
83
    //modules/guardian/... \
84
    //modules/map/... \
85
    //modules/contrib/... \
86
    //modules/third_party_perception/...
S
storypku 已提交
87

S
storypku 已提交
88
bash scripts/install_esdcan_library.sh install
89 90
bazel_build_with_dist_cache //modules/drivers/...
bazel_test_with_dist_cache //modules/drivers/...
S
storypku 已提交
91
bash scripts/install_esdcan_library.sh uninstall
92

93
bazel_build_with_dist_cache //modules/tools/...
94
bazel build //modules/tools/...
95
# Note(storypku): bazel test works except some lint errors in cyber_visualizer.
S
storypku 已提交
96
# Check cyber_visualizer's functionality once stablized.
97
bazel_test_with_dist_cache $(bazel query //modules/tools/... except //modules/tools/visualizer/...)
98 99
# bazel_build_with_dist_cache $(bazel query //modules/planning/... except //modules/planning/tools:inference_demo)

100
bazel_test_with_dist_cache $(bazel query //modules/localization/... \
101 102 103
    except //modules/localization/ndt/ndt_locator/... \
    except //modules/localization/msf/local_pyramid_map/pyramid_map/... \
)
104

105 106
echo "########################### All check passed! ###########################"

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

109
# TODO(storypku): bazel build //modules/perception/...
110
# TODO(?): bazel test //modules/prediction/...
X
Xiangquan Xiao 已提交
111 112 113 114 115 116 117 118 119 120
# 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
S
storypku 已提交
121
# TODO(storypku): cyber.aarch64 docker image
122
# TODO(storypku): tools/workspace.bzl to re-org WORKSPACE.in
123
# TODO(?): no break for cpu only build