Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2018 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
Martin Stjernholm | 1048bb7 | 2022-04-13 16:22:30 +0100 | [diff] [blame] | 17 | set -e |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 18 | |
| 19 | if [ ! -d art ]; then |
| 20 | echo "Script needs to be run at the root of the android tree" |
| 21 | exit 1 |
| 22 | fi |
| 23 | |
Martin Stjernholm | 6906910 | 2020-06-16 13:26:40 +0100 | [diff] [blame] | 24 | # Switch the build system to unbundled mode in the reduced manifest branch. |
Martin Stjernholm | 6906910 | 2020-06-16 13:26:40 +0100 | [diff] [blame] | 25 | if [ ! -d frameworks/base ]; then |
Martin Stjernholm | 0ef7c52 | 2022-04-13 19:34:36 +0100 | [diff] [blame] | 26 | export TARGET_BUILD_UNBUNDLED=true |
Martin Stjernholm | 6906910 | 2020-06-16 13:26:40 +0100 | [diff] [blame] | 27 | fi |
| 28 | |
Martin Stjernholm | 1048bb7 | 2022-04-13 16:22:30 +0100 | [diff] [blame] | 29 | vars="$(build/soong/soong_ui.bash --dumpvars-mode --vars="OUT_DIR HOST_OUT")" |
| 30 | # Assign to a variable and eval that, since bash ignores any error status from |
| 31 | # the command substitution if it's directly on the eval line. |
| 32 | eval $vars |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 33 | |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 34 | # First build all the targets still in .mk files (also build normal glibc host |
| 35 | # targets so we know what's needed to run the tests). |
Martin Stjernholm | 0ef7c52 | 2022-04-13 19:34:36 +0100 | [diff] [blame] | 36 | build/soong/soong_ui.bash --make-mode "$@" test-art-host-run-test-dependencies build-art-host-tests |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 37 | |
Martin Stjernholm | 0ef7c52 | 2022-04-13 19:34:36 +0100 | [diff] [blame] | 38 | # Next build the Linux host Bionic targets in --soong-only mode. |
| 39 | export TARGET_PRODUCT=linux_bionic |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 40 | |
Martin Stjernholm | 0ef7c52 | 2022-04-13 19:34:36 +0100 | [diff] [blame] | 41 | # Avoid Soong error about invalid dependencies on disabled libLLVM_android, |
| 42 | # which we get due to the --soong-only mode. (Another variant is to set |
| 43 | # SOONG_ALLOW_MISSING_DEPENDENCIES). |
| 44 | export FORCE_BUILD_LLVM_COMPONENTS=true |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 45 | |
Martin Stjernholm | 1048bb7 | 2022-04-13 16:22:30 +0100 | [diff] [blame] | 46 | soong_out=$OUT_DIR/soong/host/linux_bionic-x86 |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 47 | declare -a bionic_targets |
| 48 | # These are the binaries actually used in tests. Since some of the files are |
| 49 | # java targets or 32 bit we cannot just do the same find for the bin files. |
| 50 | # |
| 51 | # We look at what the earlier build generated to figure out what to ask soong to |
| 52 | # build since we cannot use the .mk defined phony targets. |
| 53 | bionic_targets=( |
| 54 | $soong_out/bin/dalvikvm |
| 55 | $soong_out/bin/dalvikvm64 |
| 56 | $soong_out/bin/dex2oat |
| 57 | $soong_out/bin/dex2oatd |
| 58 | $soong_out/bin/profman |
| 59 | $soong_out/bin/profmand |
| 60 | $soong_out/bin/hiddenapi |
| 61 | $soong_out/bin/hprof-conv |
Andreas Gampe | 148c160 | 2019-06-10 16:47:46 -0700 | [diff] [blame] | 62 | $soong_out/bin/signal_dumper |
Ivan Lozano | e3de71c | 2020-02-18 15:52:56 -0500 | [diff] [blame] | 63 | $soong_out/lib64/libclang_rt.ubsan_standalone-x86_64-android.so |
Martin Stjernholm | 1048bb7 | 2022-04-13 16:22:30 +0100 | [diff] [blame] | 64 | $(find $HOST_OUT/apex/com.android.art.host.zipapex -type f | sed "s:$HOST_OUT:$soong_out:g") |
| 65 | $(find $HOST_OUT/lib64 -type f | sed "s:$HOST_OUT:$soong_out:g") |
| 66 | $(find $HOST_OUT/nativetest64 -type f | sed "s:$HOST_OUT:$soong_out:g")) |
Alex Light | 680cbf2 | 2018-10-31 11:00:19 -0700 | [diff] [blame] | 67 | |
| 68 | echo building ${bionic_targets[*]} |
| 69 | |
Martin Stjernholm | 0ef7c52 | 2022-04-13 19:34:36 +0100 | [diff] [blame] | 70 | build/soong/soong_ui.bash --make-mode --soong-only "$@" ${bionic_targets[*]} |