@@ -43,12 +43,13 @@ install_mvn() {
4343
4444# Install zinc under the build/ folder
4545install_zinc () {
46- ZINC_INSTALL_FLAG=1
46+ local zinc_path=" zinc-0.3.5.3/bin/zinc"
47+ [ ! -f " ${zinc_path} " ] && ZINC_INSTALL_FLAG=1
4748 install_app \
4849 " http://downloads.typesafe.com/zinc/0.3.5.3" \
4950 " zinc-0.3.5.3.tgz" \
50- " zinc-0.3.5.3/bin/zinc "
51- ZINC_BIN=" ${_DIR} /zinc-0.3.5.3/bin/zinc "
51+ " ${zinc_path} "
52+ ZINC_BIN=" ${_DIR} /${ZINC_PATH} "
5253}
5354
5455# Determine the Scala version from the root pom.xml file, set the Scala URL,
@@ -74,12 +75,9 @@ print(minidom.parse('${_DIR}/../pom.xml').getElementsByTagName('scala.version')[
7475}
7576
7677# Determines if a given application is already installed. If not, will attempt
77- # to install if the -f (forced install) flag was set from the command line
78- # options.
79- # Leverages the build/packages directory for package install files which
80- # cater installation of a given application across various operating systems.
81- # - Current supported operating systems are Linux, Solaris, BSD, and OSX
78+ # to install
8279# # Arg1 - application name
80+ # # Arg2 - Alternate path to local install under build/ dir
8381check_and_install_app () {
8482 # create the local environment variable in uppercase
8583 local app_bin=" ` echo $1 | awk ' {print toupper(\$0)}' ` _BIN"
@@ -98,21 +96,21 @@ ZINC_PORT=${ZINC_PORT:-"3030"}
9896
9997# Check and install all applications necessary to build Spark
10098check_and_install_app " mvn"
101- check_and_install_app " zinc"
10299
103- # Check and download the proper version of Scala for the build
100+ # Install the proper version of Scala and Zinc for the build
101+ install_zinc
104102install_scala
105103
106104# Reset the current working directory
107105cd " ${_DIR} /.."
108106
109107# Now that zinc is ensured to be installed, check its status and, if its
110- # not running, start it
108+ # not running or just installed , start it
111109if [ -n " ${ZINC_INSTALL_FLAG} " -o -z " ` ${ZINC_BIN} -status` " ]; then
112110 ${ZINC_BIN} -shutdown
113111 ${ZINC_BIN} -start -port ${ZINC_PORT} \
114112 -scala-compiler " ${SCALA_COMPILER} " \
115- -scala-library " ${SCALA_LIBRARY} " & > /dev/null
113+ -scala-library " ${SCALA_LIBRARY} "
116114fi
117115
118116# Last, call the `mvn` command as usual
0 commit comments