blob: 791618f8eb238db29da5bf1f9320726d6efe8cb2 [file] [log] [blame]
Vince Harron8e110ed2015-06-04 16:35:57 -07001#!/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
6PROJ=ninja
Colin Cross11c3a542015-11-11 17:55:23 -08007VER=master
8BASE_VER=v1.6.0
Vince Harron8e110ed2015-06-04 16:35:57 -07009MSVS=2013
10
11source $(dirname "$0")/build-common.sh build-common.sh
12
13# needed for cygwin
14export PATH="$PATH":.
15
16# ninja specific steps
17cd $RD
Colin Cross11c3a542015-11-11 17:55:23 -080018git clone https://android.googlesource.com/platform/external/ninja.git src
Vince Harron8e110ed2015-06-04 16:35:57 -070019cd src
Colin Cross11c3a542015-11-11 17:55:23 -080020git remote add upstream https://github.com/martine/ninja.git
21git fetch upstream
22git checkout $VER
23INSTALL_VER=${INSTALL_VER/${VER}/${VER}-$(git rev-parse --short=12 HEAD)}
Vince Harron8e110ed2015-06-04 16:35:57 -070024if [[ "$OS" == "windows" ]] ; then
25 PLATFORM="--platform=msvc"
26fi
27./configure.py --bootstrap $PLATFORM
28
29# install
30cp $RD/src/ninja $INSTALL
31
Colin Cross11c3a542015-11-11 17:55:23 -080032EXTRA_FILE="LICENSE MODULE_LICENSE_APL"
33EXTRA_COMMIT_MSG=$(echo -e "\n\nChanges since ${BASE_VER}:" && git log --oneline --abbrev=12 ${BASE_VER}..HEAD)
34
Vince Harron8e110ed2015-06-04 16:35:57 -070035commit_and_push