Skip to content

Commit

Permalink
Bump up sbt version to 0.13 and remove SCALA_HOME
Browse files Browse the repository at this point in the history
sbt jars are fetched if not found, similar to what Spark does
  • Loading branch information
harveyfeng committed Apr 9, 2014
1 parent eb3cada commit 5414a9d
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 382 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lib_managed/
TempStatsStore
work/
run-tests-from-scratch-workspace/

sbt/*.jar
conf/shark-env.sh

# Compiled Source
Expand Down
20 changes: 1 addition & 19 deletions bin/dev/run-tests-from-scratch
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ Required Options:
Optional configuration environment variables:
SHARK_PROJ_DIR (default: "$SHARK_PROJ_DIR_DEFAULT")
SCALA_HOME (default: Scala version ${SCALA_VERSION} will be downloaded and used)
SBT_OPTS (default: "$SBT_OPTS_DEFAULT")
SPARK_MEM (default: $SPARK_MEM_DEFAULT)
SHARK_MASTER_MEM (default: $SHARK_MASTER_MEM_DEFAULT)
Expand Down Expand Up @@ -196,15 +195,6 @@ export HIVE_HOME="$HIVE_DEV_HOME/build/dist"
# exit -1
# fi

if [ "x$SCALA_HOME" != "x" ] ; then
# User already specified SCALA_HOME. Make sure the correct version of Scala installed.
SCALA_HOME_VERSION=`${SCALA_HOME}/bin/scala -version 2>&1|awk '{print $5}'`
if [ "$SCALA_HOME_VERSION" != "$SCALA_VERSION" ] ; then
echo "Your SCALA_HOME is version ${SCALA_HOME_VERSION}, but ${SCALA_VERSION} is required."
exit -1
fi
fi

# Kill this whole process group when Control-C is pressed. This ensures any child processes
# aren't left running (this was happening before with Ant/Java processes).
this_pgid=`ps -o pid -o pgid | grep $$ | awk '{print $2}'`
Expand All @@ -224,16 +214,8 @@ if [ -e "${SHARK_PROJ_DIR}/conf/shark-env.sh" ] ; then
fi

####################################################################
# Download Scala if SCALA_HOME is not specified.
# Download Hadoop if necessary.
####################################################################
if [ "x$SCALA_HOME" == "x" ] ; then
rm -rf ./scala*tgz
wget $SCALA_DOWNLOAD_PATH
tar xvfz scala*tgz
export SCALA_HOME="$WORKSPACE/scala-$SCALA_VERSION"
fi
echo "SCALA_HOME is $SCALA_HOME"

if $SKIP_HADOOP ; then
if [ ! -e "hadoop-${SPARK_HADOOP_VERSION}" ] ; then
echo "hadoop-${SPARK_HADOOP_VERSION} must exist when skipping Hadoop download and build stage."
Expand Down
11 changes: 1 addition & 10 deletions bin/dev/test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -44,12 +44,6 @@ if [ -z $HADOOP_HOME ] ; then
exit 1
fi

# Check for SCALA_HOME
if [ -z $SCALA_HOME ] ; then
echo "No SCALA_HOME specified. Please set SCALA_HOME"
exit 1
fi

if [ -n "$TEST_FILE" ] ; then
TEST_FILE=`get_abs_path $TEST_FILE`
export TEST_FILE
Expand Down Expand Up @@ -81,9 +75,6 @@ export TEST_JAVA_OPTS
cd ${HIVE_DEV_HOME}/ql

if [ "$TEST_WITH_ANT" == "1" ] ; then
CLASSPATH+=":$SCALA_HOME/lib/scala-library.jar"
CLASSPATH+=":$SCALA_HOME/lib/scala-compiler.jar"
CLASSPATH+=":$SCALA_HOME/lib/jline.jar"
export CLASSPATH
export RUNNER="ant -noclasspath -nouserlib -f $FWDIR/bin/dev/build_test.xml test"
exec $FWDIR/run "$@"
Expand Down
3 changes: 0 additions & 3 deletions conf/shark-env.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ export SPARK_MEM=1g
# (Required) Set the master program's memory
export SHARK_MASTER_MEM=1g

# (Required) Point to your Scala installation.
export SCALA_HOME=""

# (Optional) Specify the location of Hive's configuration directory. By default,
# Shark run scripts will point it to $SHARK_HOME/conf
#export HIVE_CONF_DIR=""
Expand Down
9 changes: 6 additions & 3 deletions project/SharkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ object SharkBuild extends Build {
val excludeServlet = ExclusionRule(organization = "javax.servlet")
val excludeXerces = ExclusionRule(organization = "xerces")

val scalaArtifacts = Seq("jline", "scala-compiler", "scala-library", "scala-reflect")
val scalaDependencies = scalaArtifacts.map ( artifactId =>
"org.scala-lang" % artifactId % SCALA_VERSION)

// TODO(harvey): These should really be in a SharkHive project, but that requires re-organizing
// all of our settings. Should be done for v0.9.1. Also, we might not need some
// of these jars.
// all of our settings. Also, we might not need some of these jars.
val hiveArtifacts = Seq(
"hive-anttasks",
"hive-beeline",
Expand Down Expand Up @@ -189,7 +192,7 @@ object SharkBuild extends Build {
unmanagedJars in Test ++= Seq(
file(System.getenv("HIVE_DEV_HOME")) / "build" / "ql" / "test" / "classes"
),
libraryDependencies ++= hiveDependencies ++ tachyonDependency ++ yarnDependency,
libraryDependencies ++= hiveDependencies ++ scalaDependencies ++ tachyonDependency ++ yarnDependency,
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % SPARK_VERSION,
"org.apache.spark" %% "spark-repl" % SPARK_VERSION,
Expand Down
19 changes: 18 additions & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
sbt.version=0.12.3
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
sbt.version=0.13.1

22 changes: 13 additions & 9 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,27 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
scalaVersion := "2.10.3"

addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.1.1")
resolvers += Resolver.url(
"sbt-plugin-releases",
new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)

resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/"

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.3.2")
addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.1.2")

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.4.0")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0")

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.4.0")
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1")

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.4")

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.9.2")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.10.2")

addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3")

resolvers += Resolver.url(
"sbt-plugin-releases",
new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.alpinenow" % "junit_xml_listener" % "0.5.0")

resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/"
26 changes: 0 additions & 26 deletions project/project/build.scala

This file was deleted.

15 changes: 0 additions & 15 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ if [ -e $SHARK_HOME/conf/shark-env.sh ] ; then
. $SHARK_HOME/conf/shark-env.sh
fi

if [ "x$SCALA_HOME" == "x" ] ; then
echo "No SCALA_HOME specified. Please set SCALA_HOME."
exit 1
fi

if [ ! -f "$SCALA_HOME/lib/scala-library.jar" ] ; then
echo "Cannot find $SCALA_HOME/lib/scala-library.jar."
echo "Are you sure your SCALA_HOME is set correctly?"
echo "SCALA_HOME = $SCALA_HOME"
exit 1
fi

if [ -n "$MASTER" ] ; then
if [ -z $SPARK_HOME ] ; then
echo "No SPARK_HOME specified. Please set SPARK_HOME for cluster mode."
Expand Down Expand Up @@ -136,9 +124,6 @@ export JAVA_OPTS
export ANT_OPTS=$JAVA_OPTS

if [ "x$RUNNER" == "x" ] ; then
CLASSPATH+=":$SCALA_HOME/lib/scala-library.jar"
CLASSPATH+=":$SCALA_HOME/lib/scala-compiler.jar"
CLASSPATH+=":$SCALA_HOME/lib/jline.jar"
if [ -n "$JAVA_HOME" ]; then
RUNNER="${JAVA_HOME}/bin/java"
else
Expand Down
Loading

0 comments on commit 5414a9d

Please sign in to comment.