Add a script to regenerate build.ninja.in files

Add regen_build_ninja_in.sh to regenerate build.ninja.in and
tests/test_tree/build.ninja.in.

Change-Id: Ib196576fb39eb1adf4ed660b7aa2d24c84aed077
This commit is contained in:
Colin Cross 2017-07-13 10:46:04 -07:00
parent d317b06164
commit 26c141fe68
2 changed files with 33 additions and 0 deletions

32
regen_build_ninja_in.sh Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash
SRC=$(cd $(dirname $0) && pwd)
OUT=/tmp/blueprint.$$
rm -rf ${OUT}
mkdir ${OUT}
(
cd ${OUT}
${SRC}/bootstrap.bash
./blueprint.bash
${SRC}/bootstrap.bash -r
)
rm -rf ${OUT}
mkdir ${OUT}
(
cd ${OUT}
cp -r ${SRC}/tests/test_tree test_tree
ln -s ${SRC} test_tree/blueprint
mkdir out
cd out
export SRCDIR=../test_tree
${SRCDIR}/blueprint/bootstrap.bash
./blueprint.bash
cp .minibootstrap/build.ninja.in ${SRC}/tests/test_tree/build.ninja.in
)
rm -rf ${OUT}

View file

@ -23,6 +23,7 @@ ${SRCDIR}/blueprint/bootstrap.bash
if ! cmp -s ${SRCDIR}/build.ninja.in .minibootstrap/build.ninja.in; then
echo "tests/test_tree/build.ninja.in and .minibootstrap/build.ninja.in should be the same" >&2
echo "run regen_build_ninja_in.sh" >&2
exit 1
fi