Skip to content

Commit f914dea

Browse files
author
Brennon York
committed
Beginning final portions of localized scala home
1 parent 69c4e44 commit f914dea

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ third_party/libmesos.so
2020
third_party/libmesos.dylib
2121
build/apache-maven*
2222
build/zinc*
23+
build/scala*
2324
conf/java-opts
2425
conf/*.sh
2526
conf/*.cmd

build/mvn

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,31 @@ check_and_install_app() {
5555
# some black magic to set the generated app variable (i.e. MVN_BIN) into the
5656
# environment
5757
eval "${APP_BIN}=`which $1 2>/dev/null`"
58+
59+
# Check and source the package build file if present, else error out
60+
if [ -f "$resource" ]; then
61+
source "${_DIR}/packages/$1.sh"
62+
else
63+
echo "ERROR: Cannot find the $1.sh build file from within ${_DIR}/packages."
64+
echo " Ensure the file exists and is accesible."
65+
exit 1
66+
fi
67+
5868
if [ -z "`which $1 2>/dev/null`" ]; then
5969
# attempt to force install if flagged
6070
if [ -n "${FORCE_INSTALL}" ]; then
6171
local resource="${_DIR}/packages/$1.sh"
62-
if [ -f "$resource" ]; then
63-
source "${_DIR}/packages/$1.sh"
72+
6473
prep_install_for_${_OSTYPE}
6574
install_$1_for_${_OSTYPE}
66-
else
67-
echo "ERROR: Cannot find the $1.sh build file from within ${_DIR}/packages."
68-
echo " Ensure the file exists and is accesible."
69-
exit 1
70-
fi
75+
7176
# else exit with error message
7277
else
7378
echo "ERROR: $1 isn't installed; please install or automatically force install (-f)."
7479
exit 2
7580
fi
7681
fi
82+
postprocess_$1_for_${_OSTYPE}
7783
}
7884

7985
# Prints the help and usage for this script
@@ -143,16 +149,20 @@ ZINC_PORT=${ZINC_PORT:-"3030"}
143149
# Check and install all applications necessary to fully build Spark
144150
check_and_install_app "mvn"
145151
check_and_install_app "zinc"
152+
check_and_install_app "scala"
146153

147154
# Reset the current working directory
148155
cd "${_DIR}/.."
149156

150157
# Now that zinc is ensured to be installed, check its status and, if its
151158
# not running, start it
152-
if [ -z "`${ZINC_BIN} -status`" ]; then
153-
${ZINC_BIN} -start -port ${ZINC_PORT}
159+
if [ -n "`${ZINC_BIN} -status`" ]; then
160+
${ZINC_BIN} -shutdown
154161
fi
155162

163+
${ZINC_BIN} -start -port ${ZINC_PORT} -scala-home "${SCALA_HOME}"
164+
${ZINC_BIN} -status
165+
156166
# Determine the parameters pushed in from the command line and, if any are
157167
# present, use those within the maven
158168
if [ $# -gt 0 ]; then

build/packages/mvn.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ install_mvn_for_linux() {
2222
export MVN_BIN="${mvn_bin}"
2323
}
2424

25+
export_mvn_for_linux() {
26+
27+
}
28+
2529
install_mvn_for_osx() {
2630
brew install maven
2731
export MVN_BIN=`which mvn`

build/packages/scala.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ install_scala_for_linux() {
1919
cd "${dir}/.." && tar -xzf "${scala_loc}"
2020
rm -rf "${scala_loc}"
2121
fi
22-
export SCALA_BIN="${scala_bin}"
22+
export SCALA_HOME="$(dirname ${scala_bin})/.."
2323
}
2424

2525
install_scala_for_osx() {
2626
brew install scala
27-
export SCALA_BIN=`which scala`
27+
export SCALA_HOME="$(dirname "`brew --prefix`/Cellar/$(readlink `which scala`)")/../libexec"
2828
}

0 commit comments

Comments
 (0)