-
Notifications
You must be signed in to change notification settings - Fork 2
/
pants_from_sources
executable file
·46 lines (34 loc) · 1.22 KB
/
pants_from_sources
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
#!/usr/bin/env bash
# Copyright 2020 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
# Runs pants from sources. Useful for debugging.
# Assumes you have the pantsbuild/pants repo checked out in a sibling dir of this dir,
# named 'pants' but overridable using PANTS_SOURCE.
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"
PANTS_SOURCE="${PANTS_SOURCE:-../pants-peek}"
# When running pants from sources you are likely to be modifying those sources, so
# you won't want pantsd running. You can override this by setting ENABLE_PANTSD=true.
ENABLE_PANTSD="${ENABLE_PANTSD:-false}"
# backend_packages=(
# )
# pythonpath=(
# "pants-plugins"
# )
# plugins=(
# )
function string_list() {
eval local -r list_variable="\${$1[@]}"
echo -n "["
for item in ${list_variable}; do
echo -n "\"${item}\","
done
echo -n "]"
}
export PANTS_VERSION="$(cat "${PANTS_SOURCE}/src/python/pants/VERSION")"
# export PANTS_PLUGINS="$(string_list plugins)"
# export PANTS_PYTHONPATH="+$(string_list pythonpath)"
# export PANTS_BACKEND_PACKAGES="+$(string_list backend_packages)"
export PANTS_PANTSD="${ENABLE_PANTSD}"
export no_proxy="*"
exec "${PANTS_SOURCE}/pants" "--no-verify-config" "$@"