1 #!/bin/bash -ex 2 # Download & build ninja on the local machine 3 # works on Linux, OSX, and Windows (Git Bash) 4 # leaves output in /tmp/prebuilts/ninja/$OS-x86/ 5 6 PROJ=ninja 7 VER=master 8 BASE_VER=v1.6.0 9 MSVS=2013 10 11 source $(dirname "$0")/build-common.sh build-common.sh 12 13 # needed for cygwin 14 export PATH="$PATH":. 15 16 # ninja specific steps 17 cd $RD 18 git clone https://android.googlesource.com/platform/external/ninja.git src 19 cd src 20 git remote add upstream https://github.com/martine/ninja.git 21 git fetch upstream 22 git checkout $VER 23 INSTALL_VER=${INSTALL_VER/${VER}/${VER}-$(git rev-parse --short=12 HEAD)} 24 if [[ "$OS" == "windows" ]] ; then 25 PLATFORM="--platform=msvc" 26 fi 27 ./configure.py --bootstrap $PLATFORM 28 29 # install 30 cp $RD/src/ninja $INSTALL 31 32 EXTRA_FILE="LICENSE MODULE_LICENSE_APL" 33 EXTRA_COMMIT_MSG=$(echo -e "\n\nChanges since ${BASE_VER}:" && git log --oneline --abbrev=12 ${BASE_VER}..HEAD) 34 35 commit_and_push 36