2015-01-27 01:30:13 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-07-14 09:39:06 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# Switch to the build directory
|
|
|
|
cd $(dirname "${BASH_SOURCE[0]}")
|
2015-03-25 22:09:02 +01:00
|
|
|
|
2017-08-05 00:06:27 +02:00
|
|
|
if [ -z "$NO_DEPRECATION_WARNING" ]; then
|
|
|
|
echo '== WARNING: bootstrap.bash & ./soong are deprecated ==' >&2
|
|
|
|
echo 'Use `m --skip-make` with a standalone OUT_DIR instead.' >&2
|
|
|
|
echo 'Without envsetup.sh, use:' >&2
|
|
|
|
echo ' build/soong/soong_ui.bash --make-mode --skip-make' >&2
|
|
|
|
echo '======================================================' >&2
|
|
|
|
fi
|
|
|
|
|
2015-03-25 22:09:02 +01:00
|
|
|
# The source directory path and operating system will get written to
|
|
|
|
# .soong.bootstrap by the bootstrap script.
|
|
|
|
|
2015-07-14 09:39:06 +02:00
|
|
|
BOOTSTRAP=".soong.bootstrap"
|
2015-04-11 00:45:15 +02:00
|
|
|
if [ ! -f "${BOOTSTRAP}" ]; then
|
2015-03-25 22:09:02 +01:00
|
|
|
echo "Error: soong script must be located in a directory created by bootstrap.bash"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-04-11 00:45:15 +02:00
|
|
|
source "${BOOTSTRAP}"
|
2015-01-27 01:30:13 +01:00
|
|
|
|
2015-07-14 09:39:06 +02:00
|
|
|
# Now switch to the source directory so that all the relative paths from
|
|
|
|
# $BOOTSTRAP are correct
|
|
|
|
cd ${SRCDIR_FROM_BUILDDIR}
|
2015-01-27 01:30:13 +01:00
|
|
|
|
2015-03-25 22:43:57 +01:00
|
|
|
# Ninja can't depend on environment variables, so do a manual comparison
|
|
|
|
# of the relevant environment variables from the last build using the
|
|
|
|
# soong_env tool and trigger a build manifest regeneration if necessary
|
2015-04-11 00:45:15 +02:00
|
|
|
ENVFILE="${BUILDDIR}/.soong.environment"
|
|
|
|
ENVTOOL="${BUILDDIR}/.bootstrap/bin/soong_env"
|
|
|
|
if [ -f "${ENVFILE}" ]; then
|
|
|
|
if [ -x "${ENVTOOL}" ]; then
|
|
|
|
if ! "${ENVTOOL}" "${ENVFILE}"; then
|
2015-03-25 22:43:57 +01:00
|
|
|
echo "forcing build manifest regeneration"
|
2015-04-11 00:45:15 +02:00
|
|
|
rm -f "${ENVFILE}"
|
2015-03-25 22:43:57 +01:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Missing soong_env tool, forcing build manifest regeneration"
|
2015-04-11 00:45:15 +02:00
|
|
|
rm -f "${ENVFILE}"
|
2015-03-25 22:43:57 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-08-14 01:47:45 +02:00
|
|
|
BUILDDIR="${BUILDDIR}" NINJA="prebuilts/build-tools/${PREBUILTOS}/bin/ninja" build/blueprint/blueprint.bash "$@"
|