| readonly BUILD_NUMBER="$3" |
| readonly SCRIPT_DIR="$(dirname "$0")" |
| NATIVE_LIBRARIES=${SCRIPT_DIR}"/../../out/host/darwin-x86/lib64" |
| # Find lipo command used to create and manipulate universal binaries |
| LIPO=$(/usr/bin/xcrun --find lipo) |
| # Split all universal binaries built for layoutlib into an ARM64 version and a X86_64 version |
| for f in ${NATIVE_LIBRARIES}/* |
| ${LIPO} $f -output ${OUT_DIR}/${ARM}/$(basename $f) -thin ${ARM} |
| ${LIPO} $f -output ${OUT_DIR}/${X86}/$(basename $f) -thin ${X86} |
| # Put the single architecture binaries inside the DIST folder to be accessible on ab/ |
| if [[ -d "${DIST_DIR}" ]]; then |
| cp -r ${OUT_DIR}/${ARM} ${DIST_DIR}/layoutlib_native/darwin |
| cp -r ${OUT_DIR}/${X86} ${DIST_DIR}/layoutlib_native/darwin |