Colin Cross | 7cae023 | 2015-07-29 15:08:35 -0700 | [diff] [blame] | 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 |
Colin Cross | b147d6f | 2015-11-11 17:55:23 -0800 | [diff] [blame] | 7 | VER=master |
| 8 | BASE_VER=v1.6.0 |
Colin Cross | 7cae023 | 2015-07-29 15:08:35 -0700 | [diff] [blame] | 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 |
Colin Cross | b147d6f | 2015-11-11 17:55:23 -0800 | [diff] [blame] | 18 | git clone https://android.googlesource.com/platform/external/ninja.git src |
Colin Cross | 7cae023 | 2015-07-29 15:08:35 -0700 | [diff] [blame] | 19 | cd src |
Colin Cross | b147d6f | 2015-11-11 17:55:23 -0800 | [diff] [blame] | 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)} |
Colin Cross | 7cae023 | 2015-07-29 15:08:35 -0700 | [diff] [blame] | 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 | |
Colin Cross | b147d6f | 2015-11-11 17:55:23 -0800 | [diff] [blame] | 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 | |
Colin Cross | 7cae023 | 2015-07-29 15:08:35 -0700 | [diff] [blame] | 35 | commit_and_push |