Add a script to build the NDK prebuilts.

Test: OUT_DIR=ndk-out DIST_DIR=ndk-dist \
          ./build/soong/scripts/build-ndk-prebuilts.sh
Bug: None

Change-Id: I3c930d2ec4d73196e355b90766eb14f0f0361460
This commit is contained in:
Dan Albert
2016-10-19 14:17:19 -07:00
parent 4098deb0b8
commit 65780b2c24

25
scripts/build-ndk-prebuilts.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash -ex
if [ -z "${OUT_DIR}" ]; then
echo Must set OUT_DIR
exit 1
fi
TOP=$(pwd)
SOONG_OUT=${OUT_DIR}/soong
SOONG_NDK_OUT=${OUT_DIR}/soong/ndk
rm -rf ${SOONG_OUT}
mkdir -p ${SOONG_OUT}
cat > ${SOONG_OUT}/soong.config << EOF
{
"Ndk_abis": true
}
EOF
BUILDDIR=${SOONG_OUT} ./bootstrap.bash
${SOONG_OUT}/soong ${SOONG_OUT}/ndk.timestamp
if [ -n "${DIST_DIR}" ]; then
mkdir -p ${DIST_DIR} || true
tar cjf ${DIST_DIR}/ndk_platform.tar.bz2 -C ${SOONG_OUT} ndk
fi