diff --git a/gradlew b/gradlew index b36faf64b..b919cbb66 100644 --- a/gradlew +++ b/gradlew @@ -102,6 +102,19 @@ if [ "${ARCH}" = "x86_64" ]; then esac fi +if [ -z "${HTTPS_PROXY}" -a -z "${https_proxy}" -a -z "${HTTP_PROXY}" -a -z "${http_proxy}" ]; then + # No HTTP(S) proxy configured via environment, check if configured via Git + if exists git; then + GIT_HTTP_PROXY="$(git config http.proxy || true)" + if [ ! -z "${GIT_HTTP_PROXY}" ]; then + export HTTPS_PROXY="${GIT_HTTP_PROXY}" + export https_proxy="${GIT_HTTP_PROXY}" + export HTTP_PROXY="${GIT_HTTP_PROXY}" + export http_proxy="${GIT_HTTP_PROXY}" + fi + fi +fi + if [ ! -z "${JDK_URL}" ]; then JDK_FILENAME="${DIR}/.jdk/$(basename ${JDK_URL})" if [ "${OS}" = "Linux" -o "${OS}" = "Darwin" ]; then