You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2013/11/10 07:32:08 UTC

git commit: Merge pull request #147 from JoshRosen/fix-java-api-completeness-checker

Updated Branches:
  refs/heads/branch-0.8 1d52b5081 -> 5ce6c7567


Merge pull request #147 from JoshRosen/fix-java-api-completeness-checker

Add spark-tools assembly to spark-class'ss classpath

This commit adds an assembly for `spark-tools` and adds it to `spark-class`'s classpath, allowing the JavaAPICompletenessChecker to be run against Spark 0.8+ with

    ./spark-class org.apache.spark.tools.JavaAPICompletenessChecker

Previously, this tool was run through the `run` script.  I chose to add this to `run-example` because I didn't want to duplicate code in a `run-tool` script.

(cherry picked from commit 3efc0195625977335914f0a18cf32bd4e9b1d6d4)
Signed-off-by: Reynold Xin <rx...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/5ce6c756
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/5ce6c756
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/5ce6c756

Branch: refs/heads/branch-0.8
Commit: 5ce6c756793d0da421e45fadd50c5b0511406f1c
Parents: 1d52b50
Author: Matei Zaharia <ma...@eecs.berkeley.edu>
Authored: Sat Nov 9 17:53:49 2013 -0800
Committer: Reynold Xin <rx...@apache.org>
Committed: Sat Nov 9 22:31:59 2013 -0800

----------------------------------------------------------------------
 project/SparkBuild.scala |  2 +-
 spark-class              | 13 +++++++++++++
 spark-class2.cmd         |  7 +++++++
 3 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/5ce6c756/project/SparkBuild.scala
----------------------------------------------------------------------
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index f6cbc1d..ae5506a 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -257,7 +257,7 @@ object SparkBuild extends Build {
 
   def toolsSettings = sharedSettings ++ Seq(
     name := "spark-tools"
-  )
+  ) ++ assemblySettings ++ extraAssemblySettings
 
   def bagelSettings = sharedSettings ++ Seq(
     name := "spark-bagel"

http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/5ce6c756/spark-class
----------------------------------------------------------------------
diff --git a/spark-class b/spark-class
index fb9d1a4..bbeca7f 100755
--- a/spark-class
+++ b/spark-class
@@ -110,8 +110,21 @@ if [ ! -f "$FWDIR/RELEASE" ]; then
   fi
 fi
 
+TOOLS_DIR="$FWDIR"/tools
+SPARK_TOOLS_JAR=""
+if [ -e "$TOOLS_DIR"/target/scala-$SCALA_VERSION/*assembly*[0-9Tg].jar ]; then
+  # Use the JAR from the SBT build
+  export SPARK_TOOLS_JAR=`ls "$TOOLS_DIR"/target/scala-$SCALA_VERSION/*assembly*[0-9Tg].jar`
+fi
+if [ -e "$TOOLS_DIR"/target/spark-tools*[0-9Tg].jar ]; then
+  # Use the JAR from the Maven build
+  # TODO: this also needs to become an assembly!
+  export SPARK_TOOLS_JAR=`ls "$TOOLS_DIR"/target/spark-tools*[0-9Tg].jar`
+fi
+
 # Compute classpath using external script
 CLASSPATH=`$FWDIR/bin/compute-classpath.sh`
+CLASSPATH="$SPARK_TOOLS_JAR:$CLASSPATH"
 export CLASSPATH
 
 if [ "$SPARK_PRINT_LAUNCH_COMMAND" == "1" ]; then

http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/5ce6c756/spark-class2.cmd
----------------------------------------------------------------------
diff --git a/spark-class2.cmd b/spark-class2.cmd
index d4d853e..3869d07 100644
--- a/spark-class2.cmd
+++ b/spark-class2.cmd
@@ -65,10 +65,17 @@ if "%FOUND_JAR%"=="0" (
 )
 :skip_build_test
 
+set TOOLS_DIR=%FWDIR%tools
+set SPARK_TOOLS_JAR=
+for %%d in ("%TOOLS_DIR%\target\scala-%SCALA_VERSION%\spark-tools*assembly*.jar") do (
+  set SPARK_TOOLS_JAR=%%d
+)
+
 rem Compute classpath using external script
 set DONT_PRINT_CLASSPATH=1
 call "%FWDIR%bin\compute-classpath.cmd"
 set DONT_PRINT_CLASSPATH=0
+set CLASSPATH=%SPARK_TOOLS_JAR%;%CLASSPATH%
 
 rem Figure out where java is.
 set RUNNER=java