You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@toree.apache.org by ch...@apache.org on 2016/06/07 01:35:08 UTC
incubator-toree git commit: Moving from a Build.scala file to a
build.sbt file.
Repository: incubator-toree
Updated Branches:
refs/heads/master 834f8c226 -> 30dffb8b8
Moving from a Build.scala file to a build.sbt file.
Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/30dffb8b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/30dffb8b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/30dffb8b
Branch: refs/heads/master
Commit: 30dffb8b8774526243c2eda55b5d4bb5780bd084
Parents: 834f8c2
Author: Liam Fisk <li...@orionhealth.com>
Authored: Fri Jun 3 20:38:46 2016 +1200
Committer: Liam Fisk <li...@orionhealth.com>
Committed: Tue Jun 7 08:47:43 2016 +1200
----------------------------------------------------------------------
Makefile | 7 +-
build.sbt | 107 +++++++
communication/build.sbt | 6 +-
.../src/main/scala/org/apache/toree/Main.scala | 2 +-
macros/build.sbt | 2 +-
macros/project/plugins.sbt | 2 +-
plugins/build.sbt | 15 +-
project/Build.scala | 288 -------------------
project/Common.scala | 228 ---------------
project/common.scala | 264 +++++++++++++++++
project/plugins.sbt | 2 +-
protocol/build.sbt | 10 +-
12 files changed, 396 insertions(+), 537 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 2eb9200..2da903f 100644
--- a/Makefile
+++ b/Makefile
@@ -99,7 +99,7 @@ dev-binder: .binder-image
target/scala-2.10/$(ASSEMBLY_JAR): VM_WORKDIR=/src/toree-kernel
target/scala-2.10/$(ASSEMBLY_JAR): ${shell find ./*/src/main/**/*}
target/scala-2.10/$(ASSEMBLY_JAR): ${shell find ./*/build.sbt}
-target/scala-2.10/$(ASSEMBLY_JAR): dist/toree-legal project/build.properties project/Build.scala project/Common.scala project/plugins.sbt
+target/scala-2.10/$(ASSEMBLY_JAR): dist/toree-legal project/build.properties build.sbt project/common.scala project/plugins.sbt
$(call RUN,$(ENV_OPTS) sbt toree/assembly)
build: target/scala-2.10/$(ASSEMBLY_JAR)
@@ -191,9 +191,9 @@ system-test: pip-release
################################################################################
publish-jars:
@$(ENV_OPTS) GPG_PASSWORD='$(GPG_PASSWORD)' GPG=$(GPG) sbt publish-signed
-
+
################################################################################
-# PIP PACKAGE
+# PIP PACKAGE
################################################################################
dist/toree-pip/toree-$(BASE_VERSION).tar.gz: DOCKER_WORKDIR=/srv/toree/dist/toree-pip
dist/toree-pip/toree-$(BASE_VERSION).tar.gz: dist/toree
@@ -282,4 +282,3 @@ all-travis: clean test system-test audit-licenses
clean-travis:
find $(HOME)/.sbt -name "*.lock" | xargs rm
find $(HOME)/.ivy2 -name "ivydata-*.properties" | xargs rm
-
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/build.sbt
----------------------------------------------------------------------
diff --git a/build.sbt b/build.sbt
new file mode 100644
index 0000000..a3d1f2a
--- /dev/null
+++ b/build.sbt
@@ -0,0 +1,107 @@
+/*
+ * 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
+ */
+
+import Common._
+import sbtunidoc.Plugin.UnidocKeys._
+import sbtunidoc.Plugin._
+import com.typesafe.sbt.SbtGit.{GitKeys => git}
+import com.typesafe.sbt.SbtSite.site
+
+lazy val root = ToreeProject("toree", ".", doFork=false, needsSpark=true).
+ settings(unidocSettings:_*).
+ settings(site.settings:_*).
+ settings(
+ test in assembly := {},
+ assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false),
+ scalacOptions in (ScalaUnidoc, unidoc) += "-Ymacro-no-expand",
+ git.gitRemoteRepo := "git://git.apache.org/incubator-toree.git",
+ aggregate in assembly := false,
+ unmanagedResourceDirectories in Compile += { baseDirectory.value / "dist/toree-legal" }
+ ).aggregate(
+ macros,protocol,plugins,communication,kernelApi,client,scalaInterpreter,sqlInterpreter,pysparkInterpreter,sparkrInterpreter,kernel
+ ).dependsOn(
+ macros,protocol,communication,kernelApi,client,scalaInterpreter,sqlInterpreter,pysparkInterpreter,sparkrInterpreter,kernel
+ )
+
+/**
+ * Project representing macros in Scala that must be compiled separately from
+ * any other project using them.
+ */
+lazy val macros = ToreeProject("macros")
+
+/**
+ * Project representing the IPython kernel message protocol in Scala. Used
+ * by the client and kernel implementations.
+ */
+lazy val protocol = ToreeProject("protocol").dependsOn(macros).
+ enablePlugins(BuildInfoPlugin).settings(buildInfoSettings:_*)
+
+/**
+ * Project representing base plugin system for the Toree infrastructure.
+ */
+lazy val plugins = ToreeProject("plugins", doFork=true).dependsOn(macros)
+
+/**
+ * Project representing forms of communication used as input/output for the
+ * client/kernel.
+ */
+lazy val communication = ToreeProject("communication").dependsOn(macros, protocol)
+
+/**
+* Project representing the kernel-api code used by the Spark Kernel. Others can
+* import this to implement their own magics and plugins.
+*/
+lazy val kernelApi = ToreeProject("kernel-api", needsSpark=true).dependsOn(macros, plugins)
+
+/**
+* Project representing the client code for connecting to the kernel backend.
+*/
+lazy val client = ToreeProject("client").dependsOn(macros, protocol, communication)
+
+/**
+* Project represents the scala interpreter used by the Spark Kernel.
+*/
+lazy val scalaInterpreter = ToreeProject("scala-interpreter", needsSpark=true).dependsOn(plugins, protocol, kernelApi)
+
+/**
+* Project represents the SQL interpreter used by the Spark Kernel.
+*/
+lazy val sqlInterpreter = ToreeProject("sql-interpreter", needsSpark=true).dependsOn(plugins, protocol, kernelApi)
+
+/**
+* Project represents the Python interpreter used by the Spark Kernel.
+*/
+lazy val pysparkInterpreter = ToreeProject("pyspark-interpreter", needsSpark=true).dependsOn(plugins, protocol, kernelApi)
+
+/**
+* Project represents the R interpreter used by the Spark Kernel.
+*/
+lazy val sparkrInterpreter = ToreeProject("sparkr-interpreter", needsSpark=true).dependsOn(plugins, protocol, kernelApi)
+
+/**
+* Project representing the kernel code for the Spark Kernel backend.
+*/
+lazy val kernel = ToreeProject("kernel", doFork=true, needsSpark=true).dependsOn(
+ macros % "test->test;compile->compile",
+ protocol % "test->test;compile->compile",
+ communication % "test->test;compile->compile",
+ kernelApi % "test->test;compile->compile",
+ pysparkInterpreter % "test->test;compile->compile",
+ scalaInterpreter % "test->test;compile->compile",
+ sparkrInterpreter % "test->test;compile->compile",
+ sqlInterpreter % "test->test;compile->compile"
+)
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/communication/build.sbt
----------------------------------------------------------------------
diff --git a/communication/build.sbt b/communication/build.sbt
index 0e3794f..7e031c7 100644
--- a/communication/build.sbt
+++ b/communication/build.sbt
@@ -18,7 +18,7 @@
libraryDependencies ++= Seq(
// LGPL with static linking exception
"org.zeromq" % "jeromq" % "0.3.4",
- "com.typesafe.akka" %% "akka-actor" % "2.3.11",
- "com.typesafe.akka" %% "akka-slf4j" % "2.3.11",
- "com.typesafe.akka" %% "akka-testkit" % "2.3.11" % "test"
+ "com.typesafe.akka" %% "akka-actor" % "2.3.15",
+ "com.typesafe.akka" %% "akka-slf4j" % "2.3.15",
+ "com.typesafe.akka" %% "akka-testkit" % "2.3.15" % "test"
)
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/kernel/src/main/scala/org/apache/toree/Main.scala
----------------------------------------------------------------------
diff --git a/kernel/src/main/scala/org/apache/toree/Main.scala b/kernel/src/main/scala/org/apache/toree/Main.scala
index ace7bd6..5756336 100644
--- a/kernel/src/main/scala/org/apache/toree/Main.scala
+++ b/kernel/src/main/scala/org/apache/toree/Main.scala
@@ -28,7 +28,7 @@ object Main extends App {
options.printHelpOn(System.out)
} else if (options.version) {
println(s"Kernel Version: ${BuildInfo.version}")
- println(s"Build Date: ${BuildInfo.buildDate}")
+ println(s"Build Date: ${BuildInfo.builtAtString}")
println(s"Scala Version: ${BuildInfo.scalaVersion}")
println(s"Apache Spark Version: ${BuildInfo.sparkVersion}")
} else {
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/macros/build.sbt
----------------------------------------------------------------------
diff --git a/macros/build.sbt b/macros/build.sbt
index a980739..4083071 100644
--- a/macros/build.sbt
+++ b/macros/build.sbt
@@ -18,6 +18,6 @@
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
libraryDependencies ++= (
- if (scalaVersion.value.startsWith("2.10")) List("org.scalamacros" %% "quasiquotes" % "2.0.1")
+ if (scalaVersion.value.startsWith("2.10")) List("org.scalamacros" %% "quasiquotes" % "2.1.0")
else Nil
)
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/macros/project/plugins.sbt
----------------------------------------------------------------------
diff --git a/macros/project/plugins.sbt b/macros/project/plugins.sbt
index e21a163..982bb4e 100644
--- a/macros/project/plugins.sbt
+++ b/macros/project/plugins.sbt
@@ -16,4 +16,4 @@
*/
resolvers += Resolver.sonatypeRepo("releases")
-addCompilerPlugin("org.scalamacros" % "paradise" % "2.0.1" cross CrossVersion.full)
+addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/plugins/build.sbt
----------------------------------------------------------------------
diff --git a/plugins/build.sbt b/plugins/build.sbt
index 4ae25c3..04e50be 100644
--- a/plugins/build.sbt
+++ b/plugins/build.sbt
@@ -15,8 +15,15 @@
* limitations under the License
*/
-// BSD 3-clause license, used for detecting plugins
-libraryDependencies += "org.clapper" %% "classutil" % "1.0.3"
-
// Needed for type inspection
-libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
+libraryDependencies ++= Seq(
+ "org.scala-lang" % "scala-reflect" % scalaVersion.value,
+ // BSD 3-clause license, used for detecting plugins
+ "org.clapper" %% "classutil" % "1.0.3",
+ "org.slf4j" % "slf4j-api" % "1.7.21" // MIT
+)
+
+// Test dependencies
+libraryDependencies ++= Seq(
+ "org.scala-lang" % "scala-compiler" % scalaVersion.value % "test"
+)
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/project/Build.scala
----------------------------------------------------------------------
diff --git a/project/Build.scala b/project/Build.scala
deleted file mode 100644
index 90077fb..0000000
--- a/project/Build.scala
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * 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
- */
-
-import java.text.SimpleDateFormat
-import java.util.Calendar
-
-import com.typesafe.sbt.SbtSite.site
-import sbt.Keys._
-import sbt._
-import sbtbuildinfo.Plugin._
-import sbtunidoc.Plugin.UnidocKeys._
-import sbtunidoc.Plugin._
-import scoverage.ScoverageSbtPlugin
-import com.typesafe.sbt.SbtGit.{GitKeys => git}
-import sbtassembly.AssemblyKeys._
-
-object Build extends Build with Settings with SubProjects with TestTasks {
-
- /**
- * Project encapsulating all other child projects.
- */
- lazy val root = addTestTasksToProject(
- Project(
- id = "toree",
- base = file("."),
- settings = fullSettings ++ unidocSettings ++ site.settings ++ Seq(
- test in assembly := {},
- assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false),
- scalacOptions in (ScalaUnidoc, unidoc) += "-Ymacro-no-expand",
- git.gitRemoteRepo := "git://git.apache.org/incubator-toree.git",
- aggregate in assembly := false,
- unmanagedResourceDirectories in Compile += { baseDirectory.value / "dist/toree-legal" }
-
- )
- )
-).aggregate(
- client, kernel, kernel_api, communication, protocol, macros,
- pyspark_interpreter, scala_interpreter, sparkr_interpreter, sql_interpreter,
- plugins
- ).dependsOn(
- client % "compile", kernel % "compile", kernel_api % "compile",
- communication % "compile", protocol % "compile", macros % "compile",
- pyspark_interpreter % "compile", scala_interpreter % "compile",
- sparkr_interpreter % "compile", sql_interpreter % "compile",
- plugins % "compile"
- )
-}
-
-/**
- * Contains the settings to be used in all projects.
- */
-trait Settings {
- lazy val fullSettings =
- Common.settings ++ Seq(
- ScoverageSbtPlugin.ScoverageKeys.coverageHighlighting := false
- )
-}
-
-/**
- * Contains all projects used in the SparkKernel.
- */
-trait SubProjects extends Settings with TestTasks {
- /**
- * Project representing the client code for connecting to the kernel backend.
- */
- lazy val client = addTestTasksToProject(Project(
- id = "toree-client",
- base = file("client"),
- settings = fullSettings
- )) dependsOn(
- macros % "test->test;compile->compile",
- protocol % "test->test;compile->compile",
- communication % "test->test;compile->compile"
- )
-
- /**
- * Project representing the kernel code for the Spark Kernel backend.
- */
- lazy val kernel = addTestTasksToProject(Project(
- id = "toree-kernel",
- base = file("kernel"),
- settings = fullSettings
- // Enable forking to load correct classes with plugin loader during tests
- ), doFork = true) dependsOn(
- macros % "test->test;compile->compile",
- protocol % "test->test;compile->compile",
- communication % "test->test;compile->compile",
- kernel_api % "test->test;compile->compile",
- pyspark_interpreter % "test->test;compile->compile",
- scala_interpreter % "test->test;compile->compile",
- sparkr_interpreter % "test->test;compile->compile",
- sql_interpreter % "test->test;compile->compile"
- )
-
- /**
- * Project represents the pyspark interpreter used by the Spark Kernel.
- */
- lazy val pyspark_interpreter = addTestTasksToProject(Project(
- id = "toree-pyspark-interpreter",
- base = file("pyspark-interpreter"),
- settings = fullSettings
- )) dependsOn(
- plugins % "test->test;compile->compile",
- protocol % "test->test;compile->compile",
- kernel_api % "test->test;compile->compile"
- )
-
- /**
- * Project represents the scala interpreter used by the Spark Kernel.
- */
- lazy val scala_interpreter = addTestTasksToProject(Project(
- id = "toree-scala-interpreter",
- base = file("scala-interpreter"),
- settings = fullSettings
- )) dependsOn(
- plugins % "test->test;compile->compile",
- protocol % "test->test;compile->compile",
- kernel_api % "test->test;compile->compile"
- )
-
- /**
- * Project represents the scala interpreter used by the Spark Kernel.
- */
- lazy val sparkr_interpreter = addTestTasksToProject(Project(
- id = "toree-sparkr-interpreter",
- base = file("sparkr-interpreter"),
- settings = fullSettings
- )) dependsOn(
- plugins % "test->test;compile->compile",
- protocol % "test->test;compile->compile",
- kernel_api % "test->test;compile->compile"
- )
-
- /**
- * Project represents the sql interpreter used by the Spark Kernel.
- */
- lazy val sql_interpreter = addTestTasksToProject(Project(
- id = "toree-sql-interpreter",
- base = file("sql-interpreter"),
- settings = fullSettings
- )) dependsOn(
- plugins % "test->test;compile->compile",
- protocol % "test->test;compile->compile",
- kernel_api % "test->test;compile->compile"
- )
-
- /**
- * Project representing the kernel-api code used by the Spark Kernel. Others can
- * import this to implement their own magics and plugins.
- */
- lazy val kernel_api = addTestTasksToProject(Project(
- id = "toree-kernel-api",
- base = file("kernel-api"),
- settings = fullSettings
- )) dependsOn(
- plugins % "test->test;compile->compile",
- macros % "test->test;compile->compile"
- )
-
- /**
- * Required by the sbt-buildinfo plugin. Defines the following:
- * buildDate: Current date of build
- * version: Current kernel version (see buildVersion in Common.scala)
- * scalaVersion: Current Scala version (see buildScalaVersion in Common.scala)
- * sparkVersion: Current Spark version
- */
- lazy val buildSettings = Seq(
- sourceGenerators in Compile <+= buildInfo,
- buildInfoKeys ++= Seq[BuildInfoKey](
- version, scalaVersion,
- "sparkVersion" -> Common.sparkVersion,
- "buildDate" -> {
- val simpleDateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss")
- val now = Calendar.getInstance.getTime
- simpleDateFormat.format(now)
- }
- ),
- buildInfoPackage := "org.apache.toree.kernel"
- )
-
- /**
- * Project representing forms of communication used as input/output for the
- * client/kernel.
- */
- lazy val communication = addTestTasksToProject(Project(
- id = "toree-communication",
- base = file("communication"),
- settings = fullSettings
- )) dependsOn(
- macros % "test->test;compile->compile",
- protocol % "test->test;compile->compile"
- )
-
- /**
- * Project representing the IPython kernel message protocol in Scala. Used
- * by the client and kernel implementations.
- */
- lazy val protocol = addTestTasksToProject(Project(
- id = "toree-protocol",
- base = file("protocol"),
- settings = fullSettings ++ buildInfoSettings ++ buildSettings
- )) dependsOn(macros % "test->test;compile->compile")
-
- /**
- * Project representing base plugin system for the Toree infrastructure.
- */
- lazy val plugins = addTestTasksToProject(Project(
- id = "toree-plugins",
- base = file("plugins"),
- settings = fullSettings
- // Enable forking to load correct classes with plugin loader during tests
- ), doFork = true) dependsOn(
- macros % "test->test;compile->compile"
- )
-
- /**
- * Project representing macros in Scala that must be compiled separately from
- * any other project using them.
- */
- lazy val macros = addTestTasksToProject(Project(
- id = "toree-macros",
- base = file("macros"),
- settings = fullSettings
- ))
-}
-
-/**
- * Defines custom test tasks to run subsets of our tests.
- *
- * unit:test - runs unit-specific tests
- * integration:test - runs integration (component-to-component) tests
- * system:test - runs system-wide tests
- * scratch:test - runs temporary tests
- */
-trait TestTasks {
- def addTestTasksToProject(project: Project, doFork: Boolean = false): Project =
- project
- .configs( UnitTest )
- .configs( IntegrationTest )
- .configs( SystemTest )
- .configs( ScratchTest )
- .settings( inConfig(UnitTest)(Defaults.testTasks) : _*)
- .settings( inConfig(IntegrationTest)(Defaults.testTasks) : _*)
- .settings( inConfig(SystemTest)(Defaults.testTasks) : _*)
- .settings( inConfig(ScratchTest)(Defaults.testTasks) : _*)
- .settings(
- testOptions in UnitTest := Seq(Tests.Filter(unitFilter)),
- testOptions in IntegrationTest := Seq(Tests.Filter(intFilter)),
- testOptions in SystemTest := Seq(Tests.Filter(sysFilter)),
- testOptions in ScratchTest := Seq(Tests.Filter(scratchFilter))
- ).settings(
- fork in Test := doFork,
- fork in UnitTest := doFork,
- fork in IntegrationTest := doFork,
- fork in SystemTest := doFork,
- fork in ScratchTest := doFork
- )
-
- def scratchFilter(name: String): Boolean =
- (name endsWith "SpecForScratch") || (name startsWith "scratch.")
- def sysFilter(name: String): Boolean =
- (name endsWith "SpecForSystem") || (name startsWith "system.")
- def intFilter(name: String): Boolean =
- (name endsWith "SpecForIntegration") || (name startsWith "integration.")
- def unitFilter(name: String): Boolean =
- (name endsWith "Spec") && !intFilter(name) &&
- !sysFilter(name) && !scratchFilter(name)
-
- lazy val UnitTest = config("unit") extend Test
- lazy val IntegrationTest = config("integration") extend Test
- lazy val SystemTest = config("system") extend Test
- lazy val ScratchTest = config("scratch") extend Test
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/project/Common.scala
----------------------------------------------------------------------
diff --git a/project/Common.scala b/project/Common.scala
deleted file mode 100644
index 2d86773..0000000
--- a/project/Common.scala
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * 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
- */
-
-import org.apache.commons.io.FileUtils
-import sbt._
-import Keys._
-import coursier.Keys._
-import com.typesafe.sbt.pgp.PgpKeys._
-import scala.util.{Try, Properties}
-
-object Common {
- // Parameters for publishing to artifact repositories
- val versionNumber = Properties.envOrElse("VERSION", "0.0.0-dev")
- val snapshot = Properties.envOrElse("IS_SNAPSHOT","true").toBoolean
- val gpgLocation = Properties.envOrElse("GPG","/usr/local/bin/gpg")
- val gpgPassword = Properties.envOrElse("GPG_PASSWORD","")
-
- private val buildOrganization = "org.apache.toree"
- private val buildVersion =
- if (snapshot) s"$versionNumber-SNAPSHOT"
- else versionNumber
- private val buildScalaVersion = "2.10.4"
-
-
- // Global dependencies provided to all projects
- private var buildLibraryDependencies = Seq(
-
- // Needed to force consistent typesafe config with play json and spark
- "com.typesafe" % "config" % "1.2.1",
- "org.slf4j" % "slf4j-log4j12" % "1.7.5" % "test",
- "log4j" % "log4j" % "1.2.17" % "test",
- "org.scalatest" %% "scalatest" % "2.2.0" % "test", // Apache v2
- "org.scalactic" %% "scalactic" % "2.2.0" % "test", // Apache v2
- "org.mockito" % "mockito-all" % "1.9.5" % "test" // MIT
- )
-
- private val buildResolvers = Seq(
- "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
- )
-
- // The prefix used for our custom artifact names
- private val artifactPrefix = "ibm-spark"
- lazy val sparkVersion = {
- val sparkEnvironmentVariable = "APACHE_SPARK_VERSION"
- val defaultSparkVersion = "1.5.1"
-
- val _sparkVersion = Properties.envOrNone(sparkEnvironmentVariable)
-
- if (_sparkVersion.isEmpty) {
- scala.Console.out.println(
- s"""
- |[INFO] Using default Apache Spark $defaultSparkVersion!
- """.stripMargin.trim.replace('\n', ' '))
- defaultSparkVersion
- } else {
- val version = _sparkVersion.get
- scala.Console.out.println(
- s"""
- |[INFO] Using Apache Spark $version provided from
- |$sparkEnvironmentVariable!
- """.stripMargin.trim.replace('\n', ' '))
- version
- }
- }
-
- val settings: Seq[Def.Setting[_]] = Seq(
- organization := buildOrganization,
- useGpg := true,
- gpgCommand := gpgLocation,
- pgpPassphrase in Global := Some(gpgPassword.toArray),
- version := buildVersion,
- scalaVersion := buildScalaVersion,
- libraryDependencies ++= buildLibraryDependencies,
- isSnapshot := snapshot,
- resolvers ++= buildResolvers,
-
- pomExtra :=
- <parent>
- <groupId>org.apache</groupId>
- <artifactId>apache</artifactId>
- <version>10</version>
- </parent>
- <licenses>
- <license>
- <name>Apache 2</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- <url>http://toree.incubator.apache.org/</url>
- <scm>
- <connection>scm:git:git@github.com:apache/incubator-toree.git</connection>
- <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-toree.git</developerConnection>
- <url>scm:git:git@github.com:apache/incubator-toree.git</url>
- <tag>HEAD</tag>
- </scm>,
-
- mappings in packageBin in Compile += file("LICENSE") -> "LICENSE",
- mappings in packageBin in Compile += file("NOTICE") -> "NOTICE",
-
- coursierVerbosity := {
- val level = Try(Integer.valueOf(Properties.envOrElse(
- "TOREE_RESOLUTION_VERBOSITY", "1")
- ).toInt).getOrElse(1)
-
- scala.Console.out.println(
- s"[INFO] Toree Resolution Verbosity Level = $level"
- )
-
- level
- },
-
- scalacOptions in (Compile, doc) ++= Seq(
- // Ignore packages (for Scaladoc) not from our project
- "-skip-packages", Seq(
- "akka",
- "scala"
- ).mkString(":")
- ),
-
- // Scala-based options for compilation
- scalacOptions ++= Seq(
- "-deprecation", "-unchecked", "-feature",
- //"-Xlint", // Scala 2.11.x only
- "-Xfatal-warnings",
- "-Ywarn-all",
- "-language:reflectiveCalls",
- "-target:jvm-1.6"
- ),
-
- // Java-based options for compilation (all tasks)
- // NOTE: Providing a blank flag causes failures, only uncomment with options
- //javacOptions in Compile ++= Seq(""),
-
- // Java-based options for just the compile task
- javacOptions in (Compile, compile) ++= Seq(
- "-Xlint:all", // Enable all Java-based warnings
- "-Xlint:-path", // Suppress path warnings since we get tons of them
- "-Xlint:-options",
- "-Xlint:-processing",
- "-Werror", // Treat warnings as errors
- "-source", "1.6",
- "-target", "1.6"
- ),
-
- // Options provided to forked JVMs through sbt, based on our .jvmopts file
- javaOptions ++= Seq(
- "-Xms1024M", "-Xmx4096M", "-Xss2m", "-XX:MaxPermSize=1024M",
- "-XX:ReservedCodeCacheSize=256M", "-XX:+TieredCompilation",
- "-XX:+CMSPermGenSweepingEnabled", "-XX:+CMSClassUnloadingEnabled",
- "-XX:+UseConcMarkSweepGC", "-XX:+HeapDumpOnOutOfMemoryError"
- ),
-
- // Add additional test option to show time taken per test
- testOptions in Test += Tests.Argument("-oD"),
-
- // Add a global resource directory with compile/ and test/ for resources
- // in all projects
- unmanagedResourceDirectories in Compile +=
- (baseDirectory in Build.root).value / "resources/compile",
- unmanagedResourceDirectories in Test +=
- (baseDirectory in Build.root).value / "resources/test",
-
- // Publish Settings
- publishTo := {
- if (isSnapshot.value)
- Some("Apache Staging Repo" at "https://repository.apache.org/content/repositories/snapshots/")
- else
- Some("Apache Staging Repo" at "https://repository.apache.org/content/repositories/staging/")
- },
- credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
-
- // Add rebuild ivy xml to the following tasks
- compile <<= (compile in Compile) dependsOn (rebuildIvyXml dependsOn deliverLocal)
- ) ++ rebuildIvyXmlSettings // Include our rebuild ivy xml settings
-
- buildLibraryDependencies ++= Seq( "org.apache.spark" %% "spark-core" % sparkVersion % "provided" excludeAll( // Apache v2
-
- // Exclude netty (org.jboss.netty is for 3.2.2.Final only)
- ExclusionRule(
- organization = "org.jboss.netty",
- name = "netty"
- )
- ),
- "org.apache.spark" %% "spark-streaming" % sparkVersion % "provided",
- "org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
- "org.apache.spark" %% "spark-mllib" % sparkVersion % "provided",
- "org.apache.spark" %% "spark-graphx" % sparkVersion % "provided",
- "org.apache.spark" %% "spark-repl" % sparkVersion % "provided"
- )
-
- // ==========================================================================
- // = REBUILD IVY XML SETTINGS BELOW
- // ==========================================================================
-
- lazy val rebuildIvyXml = TaskKey[Unit](
- "rebuild-ivy-xml",
- "Rebuilds the ivy xml using deliver-local and copies it to src " +
- "resource directories"
- )
-
- // TODO: Figure out how to retrieve the configuration being used to avoid
- // this duplication
- lazy val rebuildIvyXmlSettings = Seq(
- rebuildIvyXml := {
- val s: TaskStreams = streams.value
- val inputFile = (crossTarget.value / s"ivy-${version.value}.xml").getAbsoluteFile
- val outputFile =
- ((resourceDirectory in Compile).value / s"${name.value}-ivy.xml").getAbsoluteFile
- s.log.info(s"Copying ${inputFile.getPath} to ${outputFile.getPath}")
- FileUtils.copyFile(inputFile, outputFile)
- }
- )
-}
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/project/common.scala
----------------------------------------------------------------------
diff --git a/project/common.scala b/project/common.scala
new file mode 100644
index 0000000..10f5a9a
--- /dev/null
+++ b/project/common.scala
@@ -0,0 +1,264 @@
+/*
+ * 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
+ */
+import org.apache.commons.io.FileUtils
+import sbt._
+import sbt.Keys._
+import sbtbuildinfo._
+import sbtbuildinfo.BuildInfoKeys._
+import scoverage.ScoverageSbtPlugin
+import coursier.Keys._
+import com.typesafe.sbt.pgp.PgpKeys._
+import scala.util.{Try, Properties}
+
+object Common {
+ // Parameters for publishing to artifact repositories
+ private val versionNumber = Properties.envOrElse("VERSION", "0.0.0-dev")
+ private val snapshot = Properties.envOrElse("IS_SNAPSHOT","true").toBoolean
+ private val gpgLocation = Properties.envOrElse("GPG","/usr/local/bin/gpg")
+ private val gpgPassword = Properties.envOrElse("GPG_PASSWORD","")
+ private val buildOrganization = "org.apache.toree.kernel"
+ private val buildVersion = if (snapshot) s"$versionNumber-SNAPSHOT" else versionNumber
+ private val buildScalaVersion = "2.10.4"
+
+ val buildInfoSettings = Seq(
+ buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion, "sparkVersion" -> sparkVersion),
+ buildInfoPackage := buildOrganization,
+ buildInfoOptions += BuildInfoOption.BuildTime
+ )
+
+ def ToreeProject(projectName: String, doFork: Boolean = false, needsSpark: Boolean = false):Project = (
+ ToreeProject(s"toree-$projectName", projectName, doFork, needsSpark)
+ )
+
+ def ToreeProject(projectName: String, projectDir: String, doFork: Boolean, needsSpark: Boolean):Project = (
+ Project(projectName, file(projectDir))
+ .configs( UnitTest )
+ .configs( IntegrationTest )
+ .configs( SystemTest )
+ .configs( ScratchTest )
+ .settings(commonSettings:_*)
+ .settings( inConfig(UnitTest)(Defaults.testTasks) : _*)
+ .settings( inConfig(IntegrationTest)(Defaults.testTasks) : _*)
+ .settings( inConfig(SystemTest)(Defaults.testTasks) : _*)
+ .settings( inConfig(ScratchTest)(Defaults.testTasks) : _*)
+ .settings(
+ testOptions in UnitTest := Seq(Tests.Filter(unitFilter)),
+ testOptions in IntegrationTest := Seq(Tests.Filter(intFilter)),
+ testOptions in SystemTest := Seq(Tests.Filter(sysFilter)),
+ testOptions in ScratchTest := Seq(Tests.Filter(scratchFilter))
+ ).settings(
+ fork in Test := doFork,
+ fork in UnitTest := doFork,
+ fork in IntegrationTest := doFork,
+ fork in SystemTest := doFork,
+ fork in ScratchTest := doFork,
+ libraryDependencies ++= (
+ if (needsSpark) sparkLibraries
+ else Nil
+ )
+ )
+ )
+
+ def scratchFilter(name: String): Boolean =
+ (name endsWith "SpecForScratch") || (name startsWith "scratch.")
+ def sysFilter(name: String): Boolean =
+ (name endsWith "SpecForSystem") || (name startsWith "system.")
+ def intFilter(name: String): Boolean =
+ (name endsWith "SpecForIntegration") || (name startsWith "integration.")
+ def unitFilter(name: String): Boolean =
+ (name endsWith "Spec") && !intFilter(name) &&
+ !sysFilter(name) && !scratchFilter(name)
+
+ lazy val UnitTest = config("unit") extend Test
+ lazy val IntegrationTest = config("integration") extend Test
+ lazy val SystemTest = config("system") extend Test
+ lazy val ScratchTest = config("scratch") extend Test
+
+ private lazy val sparkVersion = {
+ val sparkEnvironmentVariable = "APACHE_SPARK_VERSION"
+ val defaultSparkVersion = "1.6.1"
+
+ val _sparkVersion = Properties.envOrNone(sparkEnvironmentVariable)
+
+ if (_sparkVersion.isEmpty) {
+ scala.Console.out.println(
+ s"""
+ |[INFO] Using default Apache Spark $defaultSparkVersion!
+ """.stripMargin.trim.replace('\n', ' '))
+ defaultSparkVersion
+ } else {
+ val version = _sparkVersion.get
+ scala.Console.out.println(
+ s"""
+ |[INFO] Using Apache Spark $version provided from
+ |$sparkEnvironmentVariable!
+ """.stripMargin.trim.replace('\n', ' '))
+ version
+ }
+ }
+
+ private val sparkLibraries = Seq(
+ "org.apache.spark" %% "spark-core" % sparkVersion % "provided" excludeAll( // Apache v2
+ // Exclude netty (org.jboss.netty is for 3.2.2.Final only)
+ ExclusionRule(
+ organization = "org.jboss.netty",
+ name = "netty"
+ )
+ ),
+ "org.apache.spark" %% "spark-streaming" % sparkVersion % "provided",
+ "org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
+ "org.apache.spark" %% "spark-mllib" % sparkVersion % "provided",
+ "org.apache.spark" %% "spark-graphx" % sparkVersion % "provided",
+ "org.apache.spark" %% "spark-repl" % sparkVersion % "provided"
+ )
+
+ val commonSettings: Seq[Def.Setting[_]] = Seq(
+ organization := buildOrganization,
+ useGpg := true,
+ gpgCommand := gpgLocation,
+ pgpPassphrase in Global := Some(gpgPassword.toArray),
+ version := buildVersion,
+ scalaVersion := buildScalaVersion,
+ isSnapshot := snapshot,
+ resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
+ // Test dependencies
+ libraryDependencies ++= Seq(
+ "org.scalatest" %% "scalatest" % "2.2.6" % "test", // Apache v2
+ "org.mockito" % "mockito-all" % "1.10.19" % "test" // MIT
+ ),
+ ScoverageSbtPlugin.ScoverageKeys.coverageHighlighting := false,
+ pomExtra :=
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>10</version>
+ </parent>
+ <licenses>
+ <license>
+ <name>Apache 2</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <url>http://toree.incubator.apache.org/</url>
+ <scm>
+ <connection>scm:git:git@github.com:apache/incubator-toree.git</connection>
+ <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-toree.git</developerConnection>
+ <url>scm:git:git@github.com:apache/incubator-toree.git</url>
+ <tag>HEAD</tag>
+ </scm>,
+
+ mappings in packageBin in Compile += file("LICENSE") -> "LICENSE",
+ mappings in packageBin in Compile += file("NOTICE") -> "NOTICE",
+
+ coursierVerbosity := {
+ val level = Try(Integer.valueOf(Properties.envOrElse(
+ "TOREE_RESOLUTION_VERBOSITY", "1")
+ ).toInt).getOrElse(1)
+
+ scala.Console.out.println(
+ s"[INFO] Toree Resolution Verbosity Level = $level"
+ )
+
+ level
+ },
+
+ scalacOptions in (Compile, doc) ++= Seq(
+ // Ignore packages (for Scaladoc) not from our project
+ "-skip-packages", Seq(
+ "akka",
+ "scala"
+ ).mkString(":")
+ ),
+
+ // Scala-based options for compilation
+ scalacOptions ++= Seq(
+ "-deprecation", "-unchecked", "-feature",
+ //"-Xlint", // Scala 2.11.x only
+ "-Xfatal-warnings",
+ "-Ywarn-all",
+ "-language:reflectiveCalls",
+ "-target:jvm-1.6"
+ ),
+
+ // Java-based options for compilation (all tasks)
+ // NOTE: Providing a blank flag causes failures, only uncomment with options
+ //javacOptions in Compile ++= Seq(""),
+
+ // Java-based options for just the compile task
+ javacOptions in (Compile, compile) ++= Seq(
+ "-Xlint:all", // Enable all Java-based warnings
+ "-Xlint:-path", // Suppress path warnings since we get tons of them
+ "-Xlint:-options",
+ "-Xlint:-processing",
+ "-Werror", // Treat warnings as errors
+ "-source", "1.6",
+ "-target", "1.6"
+ ),
+
+ // Options provided to forked JVMs through sbt, based on our .jvmopts file
+ javaOptions ++= Seq(
+ "-Xms1024M", "-Xmx4096M", "-Xss2m", "-XX:MaxPermSize=1024M",
+ "-XX:ReservedCodeCacheSize=256M", "-XX:+TieredCompilation",
+ "-XX:+CMSPermGenSweepingEnabled", "-XX:+CMSClassUnloadingEnabled",
+ "-XX:+UseConcMarkSweepGC", "-XX:+HeapDumpOnOutOfMemoryError"
+ ),
+
+ // Add additional test option to show time taken per test
+ testOptions in Test += Tests.Argument("-oD"),
+
+ // Add a global resource directory with compile/ and test/ for resources in all projects
+ unmanagedResourceDirectories in Compile += file("resources/compile"),
+ unmanagedResourceDirectories in Test += file("resources/test"),
+
+ // Publish Settings
+ publishTo := {
+ if (isSnapshot.value)
+ Some("Apache Staging Repo" at "https://repository.apache.org/content/repositories/snapshots/")
+ else
+ Some("Apache Staging Repo" at "https://repository.apache.org/content/repositories/staging/")
+ },
+ credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
+
+ // Add rebuild ivy xml to the following tasks
+ compile <<= (compile in Compile) dependsOn (rebuildIvyXml dependsOn deliverLocal)
+ ) ++ rebuildIvyXmlSettings // Include our rebuild ivy xml settings
+
+ // ==========================================================================
+ // = REBUILD IVY XML SETTINGS BELOW
+ // ==========================================================================
+
+ lazy val rebuildIvyXml = TaskKey[Unit](
+ "rebuild-ivy-xml",
+ "Rebuilds the ivy xml using deliver-local and copies it to src " +
+ "resource directories"
+ )
+
+ // TODO: Figure out how to retrieve the configuration being used to avoid
+ // this duplication
+ lazy val rebuildIvyXmlSettings = Seq(
+ rebuildIvyXml := {
+ val s: TaskStreams = streams.value
+ val inputFile = (crossTarget.value / s"ivy-${version.value}.xml").getAbsoluteFile
+ val outputFile =
+ ((resourceDirectory in Compile).value / s"${name.value}-ivy.xml").getAbsoluteFile
+ s.log.info(s"Copying ${inputFile.getPath} to ${outputFile.getPath}")
+ FileUtils.copyFile(inputFile, outputFile)
+ }
+ )
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/project/plugins.sbt
----------------------------------------------------------------------
diff --git a/project/plugins.sbt b/project/plugins.sbt
index de26adf..357f8a6 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -35,7 +35,7 @@ addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.0")
// Provides a generated build info object to sync between build and application
-addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.2")
+addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1")
// Provides code coverage support
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.0.4")
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/30dffb8b/protocol/build.sbt
----------------------------------------------------------------------
diff --git a/protocol/build.sbt b/protocol/build.sbt
index 6586f96..731761a 100644
--- a/protocol/build.sbt
+++ b/protocol/build.sbt
@@ -14,23 +14,21 @@
* See the License for the specific language governing permissions and
* limitations under the License
*/
-resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
//
// JSON DEPENDENCIES
//
libraryDependencies ++= Seq(
- "com.typesafe.play" %% "play-json" % "2.3.6" excludeAll( // Apache v2
+ "com.typesafe.play" %% "play-json" % "2.3.10" excludeAll( // Apache v2
ExclusionRule(organization = "com.fasterxml.jackson.core")
),
- "org.slf4j" % "slf4j-api" % "1.7.5" // MIT
+ "org.slf4j" % "slf4j-api" % "1.7.21" // MIT
)
//
// TEST DEPENDENCIES
//
libraryDependencies ++= Seq(
- "org.scalatest" %% "scalatest" % "2.2.0" % "test", // Apache v2
- "org.scalactic" %% "scalactic" % "2.2.0" % "test", // Apache v2
- "org.mockito" % "mockito-all" % "1.9.5" % "test" // MIT
+ "org.scalactic" %% "scalactic" % "2.2.6" % "test", // Apache v2
+ "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.4" // Apache v2
)