-
Notifications
You must be signed in to change notification settings - Fork 0
/
blueprint.bash
executable file
·54 lines (45 loc) · 1.69 KB
/
blueprint.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# This script is intented to wrap the execution of ninja so that we
# can do some checks before each ninja run.
#
# It can either be run with a standalone Blueprint checkout to generate
# the minibp binary, or can be used by another script as part of a custom
# Blueprint-based build system. When used by another script, the following
# environment variables can be set to configure this script, which are
# documented below:
#
# BUILDDIR
# NINJA
# SKIP_NINJA
#
# When run in a standalone Blueprint checkout, bootstrap.bash will install
# this script into the $BUILDDIR, where it may be executed.
#
# For embedding into a custom build system, the current directory when this
# script executes should be the same directory that $BOOTSTRAP should be
# called from.
set -e
# BUILDDIR should be set to the path to store build results. By default,
# this is the directory containing this script, but can be set explicitly
# if the custom build system only wants to install their own wrapper.
[ -z "$BUILDDIR" ] && BUILDDIR=`dirname "${BASH_SOURCE[0]}"`
# NINJA should be set to the path of the ninja executable. By default, this
# is just "ninja", and will be looked up in $PATH.
[ -z "$NINJA" ] && NINJA=ninja
if [ ! -f "${BUILDDIR}/.blueprint.bootstrap" ]; then
echo "Please run bootstrap.bash (.blueprint.bootstrap missing)" >&2
exit 1
fi
# .blueprint.bootstrap provides saved values from the bootstrap.bash script:
#
# BLUEPRINT_BOOTSTRAP_VERSION
# BLUEPRINTDIR
# SRCDIR
# GOROOT
#
source "${BUILDDIR}/.blueprint.bootstrap"
if [ -z "$BLUEPRINTDIR" ]; then
echo "Please run bootstrap.bash (.blueprint.bootstrap outdated)" >&2
exit 1
fi
source "${BLUEPRINTDIR}/blueprint_impl.bash"