Skip to content

Commit

Permalink
Re-introduce selective build optimization to make publishing less slow
Browse files Browse the repository at this point in the history
  • Loading branch information
rshkv committed Jan 7, 2021
1 parent 9f349ba commit c549fb8
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions dev/make-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ DISTDIR="$SPARK_HOME/dist"
MAKE_TGZ=false
MAKE_PIP=false
MAKE_R=false
CLEAN=false
NAME=none
MVN="$SPARK_HOME/build/mvn"

Expand All @@ -43,7 +44,7 @@ function exit_with_usage {
echo "make-distribution.sh - tool for making binary distributions of Spark"
echo ""
echo "usage:"
cl_options="[--name] [--tgz] [--pip] [--r] [--mvn <mvn-command>]"
cl_options="[--name] [--tgz] [--pip] [--r] [--clean] [--mvn <mvn-command>]"
echo "make-distribution.sh $cl_options <maven build options>"
echo "See Spark's \"Building Spark\" doc for correct Maven options."
echo ""
Expand All @@ -62,6 +63,9 @@ while (( "$#" )); do
--r)
MAKE_R=true
;;
--clean)
CLEAN=true
;;
--mvn)
MVN="$2"
shift
Expand Down Expand Up @@ -163,13 +167,17 @@ export MAVEN_OPTS="${MAVEN_OPTS:--Xmx2g -XX:ReservedCodeCacheSize=1g}"
# Store the command as an array because $MVN variable might have spaces in it.
# Normal quoting tricks don't work.
# See: http://mywiki.wooledge.org/BashFAQ/050
BUILD_COMMAND=("$MVN" clean package -DskipTests $@)
if [[ -z "$DONT_BUILD" ]]; then
BUILD_COMMAND=("$MVN" clean package -DskipTests $@)

# Actually build the jar
echo -e "\nBuilding with..."
echo -e "\$ ${BUILD_COMMAND[@]}\n"
# Actually build the jar
echo -e "\nBuilding with..."
echo -e "\$ ${BUILD_COMMAND[@]}\n"

"${BUILD_COMMAND[@]}"
"${BUILD_COMMAND[@]}"
else
echo -e "\nNot running mvn package because \$DONT_BUILD was set"
fi

# Make directories
rm -rf "$DISTDIR"
Expand Down

0 comments on commit c549fb8

Please sign in to comment.