@@ -64,7 +64,6 @@ main() {
64
64
python \
65
65
python3 \
66
66
xz-utils
67
- purge_list+=(default-jre)
68
67
69
68
curl --retry 3 -sSfL https://storage.googleapis.com/git-repo-downloads/repo -O
70
69
chmod +x repo
@@ -128,30 +127,40 @@ main() {
128
127
popd
129
128
130
129
rm -rf " ${td} "
130
+ rm -rf " ${PYTHON_TMPDIR} "
131
131
rm " ${0} "
132
132
}
133
133
134
+ # java isn't required for the build, but the build expects to
135
+ # find a java compiler. the supported android versions are:
136
+ # https://source.android.com/docs/setup/start/older-versions
137
+ # Android 7: OpenJDK-8
134
138
fake_java () {
139
+ local java_type=
135
140
local java_version=
136
- local icedtea_version=
141
+ local jre_info=
142
+ local build_info=
143
+
137
144
case " ${MAJOR_VERSION} " in
138
145
5|6)
146
+ java_type=java
139
147
java_version=1.7.0
140
- icedtea_version=2.6.9
148
+ jre_info=" IcedTea 2.6.9"
149
+ build_info=" build 24.131-b00, mixed mode"
141
150
;;
142
151
* )
143
- java_version=1.8.0
144
- icedtea_version=2.6.9
152
+ java_type=openjdk
153
+ java_version=1.8.0_342
154
+ jre_info=" build 1.8.0_342-8u342-b07-0ubuntu1~20.04-b07"
155
+ build_info=" build 25.342-b07, mixed mode"
145
156
;;
146
157
esac
147
158
148
- # fake java and javac, it is not necessary for what we build, but the build
149
- # script asks for it
150
159
cat << EOF > /usr/bin/java
151
160
#!/usr/bin/env bash
152
- echo "java version \"${java_version} \""
153
- echo "OpenJDK Runtime Environment (IcedTea ${icedtea_version } )"
154
- echo "OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode )"
161
+ echo "${java_type} version \"${java_version} \""
162
+ echo "OpenJDK Runtime Environment (${jre_info } )"
163
+ echo "OpenJDK 64-Bit Server VM (${build_info} )"
155
164
EOF
156
165
157
166
cat << EOF > /usr/bin/javac
164
173
165
174
# more faking
166
175
export ANDROID_JAVA_HOME=/tmp
167
- mkdir /tmp/lib/
176
+ mkdir -p /tmp/lib/
168
177
touch /tmp/lib/tools.jar
169
178
}
170
179
@@ -225,6 +234,7 @@ android_repo_v5() {
225
234
sync external/libselinux
226
235
sync external/mksh
227
236
sync external/openssl
237
+ sync external/pcre
228
238
sync external/stlport
229
239
sync prebuilts/clang/linux-x86/host/3.5
230
240
sync system/core
@@ -262,9 +272,11 @@ android_repo_v6() {
262
272
sync external/compiler-rt
263
273
sync external/libcxx
264
274
sync external/libcxxabi
275
+ sync external/libselinux
265
276
sync external/elfutils
266
277
sync external/jemalloc
267
278
sync external/mksh
279
+ sync external/pcre
268
280
sync external/safe-iop
269
281
sync external/zlib
270
282
sync libnativehelper
@@ -300,6 +312,7 @@ android_repo_v6() {
300
312
301
313
# tested on 7.0.0_r36 (SDK 24)
302
314
# tested on 7.1.2_r39 (SDK 25, not supported)
315
+ # API level 25, requires for Android 7.1, is not provided in NDKs
303
316
android_repo_v7 () {
304
317
sync bionic
305
318
sync build
@@ -321,6 +334,7 @@ android_repo_v7() {
321
334
sync prebuilts/clang/host/linux-x86
322
335
sync prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
323
336
sync prebuilts/misc
337
+ sync prebuilts/ndk
324
338
sync prebuilts/ninja/linux-x86
325
339
sync system/core
326
340
@@ -349,12 +363,26 @@ android_repo_v7() {
349
363
# the unittests from it is a bit of work.
350
364
rm bionic/tools/relocation_packer/Android.mk
351
365
352
- ANDROID_MAJOR=7 python3 /remove_android_tests.py
366
+ remove_tests
353
367
}
354
368
355
369
# TODO: tested on 8.0.0_r51 (SDK 26)
356
- # TODO: tested on 8.1.0_r81 (SDK 2278.0.0_r516)
370
+ # Currently failing due to libLLVM/libclang issues
371
+ # TODO: tested on 8.1.0_r81 (SDK 27)
357
372
android_repo_v8 () {
373
+ # external/compiler-rt/lib/sanitizer_common/tests/Android.bp:37:1
374
+ # name: "san_test-Nolibc"
375
+ #
376
+ # libnativehelper/Android.bp
377
+ # subdirs = ["tests"]
378
+ #
379
+ # system/core/bootstat/Android.bp
380
+ # whole_static_libs: ["libgtest_prod"],
381
+ #
382
+ # external/compiler-rt/lib/asan/Android.bp
383
+ # name: "libasan_noinst_test",
384
+ #
385
+
358
386
sync bionic
359
387
sync build
360
388
sync build/make
@@ -363,34 +391,42 @@ android_repo_v8() {
363
391
sync external/boringssl
364
392
sync external/clang
365
393
sync external/compiler-rt
394
+ sync external/elfutils
366
395
sync external/jemalloc
367
396
sync external/libcxx
368
397
sync external/libcxxabi
369
- sync external/libnl
398
+ # TODO(ahuszagh) Remove?
399
+ # sync external/libnl
400
+ sync external/libevent
370
401
sync external/libunwind
371
402
sync external/libunwind_llvm
372
403
sync external/llvm
373
404
sync external/lzma
374
405
sync external/mksh
375
406
sync external/pcre
407
+ sync external/safe-iop
376
408
sync external/selinux
377
409
sync external/zlib
378
- sync hardware/interfaces
379
- sync hardware/libhardware
380
- sync frameworks/native
410
+ # TODO(ahuszagh) Remove?
411
+ # sync hardware/interfaces
412
+ # sync hardware/libhardware
413
+ # sync frameworks/native
381
414
sync libnativehelper
382
415
sync prebuilts/build-tools
383
416
sync prebuilts/clang/host/linux-x86
417
+ # TODO(ahuszagh) clang-tools isn't available till 9.0
384
418
sync prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
385
419
sync prebuilts/go/linux-x86
386
- # needed for libnativehelper_compat_libc++
387
420
sync prebuilts/ndk
388
421
sync system/core
389
- sync system/libfmq
390
- sync system/libhidl
391
- sync system/libhwbinder
392
- sync system/media
393
- sync system/tools/hidl
422
+ sync toolchain/binutils
423
+
424
+ # TODO(ahuszagh) See if I can remove all of these
425
+ # sync system/libfmq
426
+ # sync system/libhidl
427
+ # sync system/libhwbinder
428
+ # sync system/media
429
+ # sync system/tools/hidl
394
430
# TODO(ahuszagh) Android 8 is a mess
395
431
396
432
# avoid build tests
@@ -399,26 +435,21 @@ android_repo_v8() {
399
435
rm bionic/tests/Android.bp
400
436
rm bionic/benchmarks/Android.bp
401
437
rm bionic/tests/libs/Android.bp
402
- rm hardware/interfaces/tests/Android.bp
403
- rm system/tools/hidl/test/Android.bp
438
+ # TODO(ahuszagh) Can probably remove this
439
+ # rm hardware/interfaces/tests/Android.bp
440
+ # rm system/tools/hidl/test/Android.bp
404
441
# we don't need the relocation packer, and removing
405
442
# the unittests from it is a bit of work.
406
443
rm bionic/tools/relocation_packer/Android.bp
407
444
rm bionic/tools/relocation_packer/Android.mk
445
+ rm system/core/libgrallocusage/Android.bp
446
+ rm system/core/libmemtrack/Android.bp
447
+ rm system/core/libsysutils/Android.bp
448
+
449
+ # avoid java dependencies
450
+ rm external/lzma/Java/Tukaani/Android.mk
408
451
409
- # extra utilities we don't need
410
- rm frameworks/native/libs/vr/Android.bp
411
- rm frameworks/native/services/Android.bp
412
- rm frameworks/native/services/* /Android.bp
413
- rm hardware/interfaces/automotive/Android.bp
414
- rm hardware/interfaces/camera/Android.bp
415
- rm system/libhidl/transport/Android.bp
416
- rm system/media/alsa_utils/Android.bp
417
- rm system/media/audio_route/Android.bp
418
- rm system/media/audio_utils/tests/Android.bp
419
- # TODO(ahuszagh) Need to remove the tests here
420
-
421
- ANDROID_MAJOR=8 python3 /remove_android_tests.py
452
+ remove_tests
422
453
}
423
454
424
455
# tested on 9.0.0_r1 (SDK 28)
@@ -482,7 +513,7 @@ android_repo_v9() {
482
513
rm bionic/tests/headers/Android.bp
483
514
rm bionic/tests/headers/posix/Android.bp
484
515
485
- ANDROID_MAJOR=9 python3 /remove_android_tests.py
516
+ remove_tests
486
517
}
487
518
488
519
# tested on 10.0.0_r47 (SDK 29)
@@ -553,7 +584,19 @@ android_repo_v10() {
553
584
rm bionic/tests/headers/Android.bp
554
585
rm bionic/tests/headers/posix/Android.bp
555
586
556
- ANDROID_MAJOR=10 python3 /remove_android_tests.py
587
+ remove_tests
588
+ }
589
+
590
+ remove_tests () {
591
+ install_packages python3-pip
592
+
593
+ export PYTHONPATH=" ${PYTHON_TMPDIR} /lib/python3.8/site-packages/" :" ${PYTHONPATH} "
594
+ mkdir -p " ${PYTHON_TMPDIR} "
595
+ python3 -m pip install sly==0.4.0 --prefix " ${PYTHON_TMPDIR} "
596
+
597
+ # TODO(ahuszagh) Need to change this
598
+ # Need a custom entrypoint
599
+ ANDROID_MAJOR=" ${MAJOR_VERSION} " python3 " ${PYTHON_TMPDIR} /remove_tests.py"
557
600
}
558
601
559
602
sync () {
0 commit comments