forked from apache/aurora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pants
executable file
·38 lines (36 loc) · 1.53 KB
/
pants
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
#!/usr/bin/env bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Wrapper script for self-bootstrapping pants.
set -e
HERE=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
PANTS_VERSION=0.0.24
# Pinned pants requirements - to upgrade pants change this file.
PANTS_REQUIREMENTS="$HERE/build-support/pants_requirements.txt"
if ! [ -f "$HERE/build-support/pants.venv/BOOTSTRAPPED" ] || \
[[ $(< "$HERE/build-support/pants.venv/BOOTSTRAPPED") != $PANTS_VERSION ]]; then
echo Bootstrapping pants @ $PANTS_VERSION
rm -fr "$HERE/build-support/pants.venv"
"$HERE/build-support/virtualenv" "$HERE/build-support/pants.venv"
# TODO(ksweeney): remove this hack when https://github.com/pantsbuild/pex/issues/21 is fixed.
rm -fr "$HERE/build-support/pants.venv/local"
source "$HERE/build-support/pants.venv/bin/activate"
pip install -r "$PANTS_REQUIREMENTS"
echo $PANTS_VERSION > "$HERE/build-support/pants.venv/BOOTSTRAPPED"
pushd $HERE
patch -p1 < local/pex_site_packages.diff
popd
fi
source "$HERE/build-support/pants.venv/bin/activate"
exec pants "$@"