2020-05-06 23:03:26 +02:00
|
|
|
#!/bin/bash -e
|
2020-02-28 10:04:25 +01:00
|
|
|
|
|
|
|
# Non exhaustive list of modules where we want prebuilts. More can be added as
|
|
|
|
# needed.
|
|
|
|
MAINLINE_MODULES=(
|
2020-10-12 16:10:36 +02:00
|
|
|
com.android.art
|
2020-02-28 10:04:25 +01:00
|
|
|
com.android.art.debug
|
|
|
|
com.android.art.testing
|
|
|
|
com.android.conscrypt
|
2020-10-12 16:10:36 +02:00
|
|
|
com.android.i18n
|
2021-02-17 22:00:41 +01:00
|
|
|
com.android.os.statsd
|
2020-02-28 10:04:25 +01:00
|
|
|
com.android.runtime
|
|
|
|
com.android.tzdata
|
|
|
|
)
|
|
|
|
|
|
|
|
# List of SDKs and module exports we know of.
|
|
|
|
MODULES_SDK_AND_EXPORTS=(
|
|
|
|
art-module-sdk
|
|
|
|
art-module-test-exports
|
2020-11-11 13:49:03 +01:00
|
|
|
conscrypt-module-host-exports
|
2020-02-28 10:04:25 +01:00
|
|
|
conscrypt-module-sdk
|
|
|
|
conscrypt-module-test-exports
|
2020-11-11 13:49:03 +01:00
|
|
|
i18n-module-host-exports
|
2020-06-18 16:33:18 +02:00
|
|
|
i18n-module-sdk
|
2020-11-11 13:49:03 +01:00
|
|
|
i18n-module-test-exports
|
2020-06-26 15:44:32 +02:00
|
|
|
platform-mainline-sdk
|
2020-08-05 16:56:09 +02:00
|
|
|
platform-mainline-test-exports
|
2020-11-11 13:49:03 +01:00
|
|
|
runtime-module-host-exports
|
|
|
|
runtime-module-sdk
|
2021-02-11 03:06:32 +01:00
|
|
|
statsd-module-sdk
|
2021-02-20 02:19:30 +01:00
|
|
|
statsd-module-sdk-for-art
|
2021-01-11 10:45:57 +01:00
|
|
|
tzdata-module-test-exports
|
2020-06-26 15:44:32 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# List of libraries installed on the platform that are needed for ART chroot
|
|
|
|
# testing.
|
|
|
|
PLATFORM_LIBRARIES=(
|
2021-03-09 18:13:51 +01:00
|
|
|
heapprofd_client_api
|
2020-06-26 15:44:32 +02:00
|
|
|
libartpalette-system
|
2021-03-09 18:13:51 +01:00
|
|
|
liblog
|
2020-02-28 10:04:25 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# We want to create apex modules for all supported architectures.
|
|
|
|
PRODUCTS=(
|
2020-05-06 23:03:26 +02:00
|
|
|
aosp_arm
|
|
|
|
aosp_arm64
|
|
|
|
aosp_x86
|
|
|
|
aosp_x86_64
|
2020-02-28 10:04:25 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
if [ ! -e "build/make/core/Makefile" ]; then
|
2020-05-06 23:03:26 +02:00
|
|
|
echo "$0 must be run from the top of the tree"
|
|
|
|
exit 1
|
2020-02-28 10:04:25 +01:00
|
|
|
fi
|
|
|
|
|
2020-05-06 23:03:26 +02:00
|
|
|
echo_and_run() {
|
|
|
|
echo "$*"
|
|
|
|
"$@"
|
|
|
|
}
|
|
|
|
|
2020-07-31 16:36:39 +02:00
|
|
|
lib_dir() {
|
|
|
|
case $1 in
|
|
|
|
(aosp_arm|aosp_x86) echo "lib";;
|
|
|
|
(aosp_arm64|aosp_x86_64) echo "lib64";;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2021-02-02 17:20:45 +01:00
|
|
|
# Make sure this build builds from source, regardless of the default.
|
|
|
|
export SOONG_CONFIG_art_module_source_build=true
|
|
|
|
|
2020-02-28 10:04:25 +01:00
|
|
|
OUT_DIR=$(source build/envsetup.sh > /dev/null; TARGET_PRODUCT= get_build_var OUT_DIR)
|
|
|
|
DIST_DIR=$(source build/envsetup.sh > /dev/null; TARGET_PRODUCT= get_build_var DIST_DIR)
|
|
|
|
|
|
|
|
for product in "${PRODUCTS[@]}"; do
|
2020-05-06 23:03:26 +02:00
|
|
|
echo_and_run build/soong/soong_ui.bash --make-mode $@ \
|
|
|
|
TARGET_PRODUCT=${product} \
|
2020-06-26 15:44:32 +02:00
|
|
|
${MAINLINE_MODULES[@]} \
|
|
|
|
${PLATFORM_LIBRARIES[@]}
|
2020-02-28 10:04:25 +01:00
|
|
|
|
2020-05-06 23:03:26 +02:00
|
|
|
PRODUCT_OUT=$(source build/envsetup.sh > /dev/null; TARGET_PRODUCT=${product} get_build_var PRODUCT_OUT)
|
|
|
|
TARGET_ARCH=$(source build/envsetup.sh > /dev/null; TARGET_PRODUCT=${product} get_build_var TARGET_ARCH)
|
|
|
|
rm -rf ${DIST_DIR}/${TARGET_ARCH}/
|
|
|
|
mkdir -p ${DIST_DIR}/${TARGET_ARCH}/
|
|
|
|
for module in "${MAINLINE_MODULES[@]}"; do
|
|
|
|
echo_and_run cp ${PWD}/${PRODUCT_OUT}/system/apex/${module}.apex ${DIST_DIR}/${TARGET_ARCH}/
|
|
|
|
done
|
2020-06-26 15:44:32 +02:00
|
|
|
for library in "${PLATFORM_LIBRARIES[@]}"; do
|
2020-07-31 16:36:39 +02:00
|
|
|
libdir=$(lib_dir $product)
|
|
|
|
echo_and_run cp ${PWD}/${PRODUCT_OUT}/system/${libdir}/${library}.so ${DIST_DIR}/${TARGET_ARCH}/
|
2020-06-26 15:44:32 +02:00
|
|
|
done
|
2020-02-28 10:04:25 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
# Create multi-archs SDKs in a different out directory. The multi-arch script
|
2021-01-29 16:14:42 +01:00
|
|
|
# uses Soong in --skip-make mode which cannot use the same directory as normal
|
2020-05-06 23:03:26 +02:00
|
|
|
# mode with make.
|
|
|
|
export OUT_DIR=${OUT_DIR}/aml
|
2021-01-29 16:14:42 +01:00
|
|
|
echo_and_run build/soong/scripts/build-aml-prebuilts.sh ${MODULES_SDK_AND_EXPORTS[@]}
|
2020-02-28 10:04:25 +01:00
|
|
|
|
|
|
|
rm -rf ${DIST_DIR}/mainline-sdks
|
2020-05-06 23:03:26 +02:00
|
|
|
echo_and_run cp -R ${OUT_DIR}/soong/mainline-sdks ${DIST_DIR}
|