@@ -9,8 +9,24 @@ set -euo pipefail
9
9
main () {
10
10
local arch=" ${1} "
11
11
local version=" ${ANDROID_VERSION} "
12
+ local major_version=" ${version// .*/ } "
12
13
local gcc_version=4.9
13
- local glibc_version=glibc2.15-4.8
14
+ local glibc_version
15
+ case " ${major_version} " in
16
+ 4)
17
+ glibc_version=glibc2.7-4.6
18
+ ;;
19
+ 5|6|7|8|9)
20
+ glibc_version=glibc2.15-4.8
21
+ ;;
22
+ 10|11|12|13)
23
+ glibc_version=glibc2.17-4.8
24
+ ;;
25
+ * )
26
+ # current master branch as of 9/15/2022
27
+ glibc_version=glibc2.19-4.9
28
+ ;;
29
+ esac
14
30
# FIXME: android is currently migrating from make to soong, so
15
31
# `platform/build/make` may be missing from a future version of
16
32
# android. version-gate this when make is removed.
70
86
python3 ./repo sync -c build/make
71
87
fi
72
88
python3 ./repo sync -c build/blueprint
73
- python3 ./repo sync -c build/soong
89
+ if [[ " ${major_version} " -ge 7 ]]; then
90
+ python3 ./repo sync -c build/soong
91
+ fi
74
92
python3 ./repo sync -c external/clang
75
93
python3 ./repo sync -c external/compiler-rt
76
94
python3 ./repo sync -c external/elfutils
82
100
python3 ./repo sync -c external/llvm
83
101
python3 ./repo sync -c external/lzma
84
102
python3 ./repo sync -c external/mksh
85
- python3 ./repo sync -c external/safe-iop
86
- python3 ./repo sync -c external/valgrind
87
- python3 ./repo sync -c external/vixl
103
+ if [[ " ${major_version} " -le 9 ]]; then
104
+ python3 ./repo sync -c external/safe-iop
105
+ python3 ./repo sync -c external/valgrind
106
+ fi
107
+ if [[ " ${major_version} " -ge 5 ]]; then
108
+ python3 ./repo sync -c external/vixl
109
+ fi
88
110
python3 ./repo sync -c external/zlib
89
111
python3 ./repo sync -c frameworks/hardware/interfaces
90
112
python3 ./repo sync -c hardware/interfaces
93
115
python3 ./repo sync -c prebuilts/clang/host/linux-x86
94
116
python3 ./repo sync -c prebuilts/clang-tools
95
117
python3 ./repo sync -c " prebuilts/gcc/linux-x86/host/x86_64-linux-${glibc_version} "
96
- python3 ./repo sync -c prebuilts/go/linux-x86
118
+ if [[ " ${major_version} " -ge 7 ]]; then
119
+ python3 ./repo sync -c prebuilts/go/linux-x86
120
+ fi
97
121
python3 ./repo sync -c prebuilts/misc
98
122
python3 ./repo sync -c prebuilts/sdk
99
123
python3 ./repo sync -c system/core
100
- python3 ./repo sync -c system/libhidl
101
- python3 ./repo sync -c system/tools/hidl
124
+ if [[ " ${major_version} " -ge 8 ]]; then
125
+ python3 ./repo sync -c system/libhidl
126
+ python3 ./repo sync -c system/tools/hidl
127
+ fi
102
128
103
129
case " ${arch} " in
104
130
arm)
@@ -116,14 +142,16 @@ EOF
116
142
;;
117
143
esac
118
144
119
- # avoid build tests
145
+ # avoid build tests. these can fail in newer versions, so allow failures.
146
+ set +e
120
147
rm bionic/linker/tests/Android.mk
121
148
rm bionic/tests/Android.mk
122
149
rm bionic/tests/Android.bp
123
150
rm bionic/benchmarks/Android.bp
124
151
rm bionic/tests/libs/Android.bp
125
152
rm bionic/tests/headers/Android.bp
126
153
rm bionic/tests/headers/posix/Android.bp
154
+ set -e
127
155
128
156
sed -i -z -e ' s/cc_test {.*}//g' bionic/libc/malloc_debug/Android.bp
129
157
sed -i -z -e ' s/cc_test {.*}//g' bionic/libc/malloc_hooks/Android.bp
0 commit comments