2020-05-07 05:03:26 +08:00
|
|
|
#!/bin/bash -e
|
2020-02-28 17:04:25 +08:00
|
|
|
|
|
|
|
# Non exhaustive list of modules where we want prebuilts. More can be added as
|
|
|
|
# needed.
|
|
|
|
MAINLINE_MODULES=(
|
|
|
|
com.android.art.debug
|
|
|
|
com.android.art.release
|
|
|
|
com.android.art.testing
|
|
|
|
com.android.conscrypt
|
|
|
|
com.android.runtime
|
|
|
|
com.android.tzdata
|
|
|
|
com.android.i18n
|
|
|
|
)
|
|
|
|
|
|
|
|
# List of SDKs and module exports we know of.
|
|
|
|
MODULES_SDK_AND_EXPORTS=(
|
|
|
|
art-module-sdk
|
|
|
|
art-module-test-exports
|
|
|
|
conscrypt-module-sdk
|
|
|
|
conscrypt-module-test-exports
|
2020-04-23 16:35:45 +08:00
|
|
|
conscrypt-module-host-exports
|
2020-05-12 07:23:22 +08:00
|
|
|
runtime-module-sdk
|
2020-02-28 17:04:25 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# We want to create apex modules for all supported architectures.
|
|
|
|
PRODUCTS=(
|
2020-05-07 05:03:26 +08:00
|
|
|
aosp_arm
|
|
|
|
aosp_arm64
|
|
|
|
aosp_x86
|
|
|
|
aosp_x86_64
|
2020-02-28 17:04:25 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if [ ! -e "build/make/core/Makefile" ]; then
|
2020-05-07 05:03:26 +08:00
|
|
|
echo "$0 must be run from the top of the tree"
|
|
|
|
exit 1
|
2020-02-28 17:04:25 +08:00
|
|
|
fi
|
|
|
|
|
2020-05-07 05:03:26 +08:00
|
|
|
echo_and_run() {
|
|
|
|
echo "$*"
|
|
|
|
"$@"
|
|
|
|
}
|
|
|
|
|
2020-02-28 17:04:25 +08: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-07 05:03:26 +08:00
|
|
|
echo_and_run build/soong/soong_ui.bash --make-mode $@ \
|
|
|
|
TARGET_PRODUCT=${product} \
|
|
|
|
${MAINLINE_MODULES[@]}
|
2020-02-28 17:04:25 +08:00
|
|
|
|
2020-05-07 05:03:26 +08: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-02-28 17:04:25 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Create multi-archs SDKs in a different out directory. The multi-arch script
|
2020-05-07 05:03:26 +08:00
|
|
|
# uses Soong in --skip-make mode which cannot use the same directory as normal
|
|
|
|
# mode with make.
|
|
|
|
export OUT_DIR=${OUT_DIR}/aml
|
|
|
|
echo_and_run build/soong/scripts/build-aml-prebuilts.sh ${MODULES_SDK_AND_EXPORTS[@]}
|
2020-02-28 17:04:25 +08:00
|
|
|
|
|
|
|
rm -rf ${DIST_DIR}/mainline-sdks
|
2020-05-07 05:03:26 +08:00
|
|
|
echo_and_run cp -R ${OUT_DIR}/soong/mainline-sdks ${DIST_DIR}
|