Skip to content

Commit

Permalink
update sbt to 1.2.0, update plugin deps, re-sync sbt syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
erikerlandson committed Aug 7, 2018
1 parent a0282e0 commit 10b24f2
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 58 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ https://isarn.github.io/isarn-sketches-spark/latest/api/#org.isarnproject.sketch
``` scala
// Note that the version of spark and python is part of the release name.
// This example is for spark 2.2 and python 2.7:
libraryDependencies += "org.isarnproject" %% "isarn-sketches-spark" % "0.2.0-sp2.2-py2.7"
libraryDependencies += "org.isarnproject" %% "isarn-sketches-spark" % "0.3.1-sp2.2-py2.7"
```

** Currently supported: python 2.7, 3.6 X spark 2.2, 2.3 X scala 2.11 **

// currently supported: python 2.7, 3.5, spark 2.1, 2.2, scala 2.10, 2.11
If you are interested in a python/spark/scala build that is not listed above, please contact me and/or file an issue!

This package builds against some `% Provided` Apache Spark dependencies:
```scala
libraryDependencies += "org.apache.spark" %% "spark-core" % sparkVersion
libraryDependencies += "org.apache.spark" %% "spark-sql" % sparkVersion
libraryDependencies += "org.apache.spark" %% "spark-mllib" % sparkVersion
```

## Examples
Expand Down
90 changes: 44 additions & 46 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
// xsbt clean unidoc previewSite
// xsbt clean unidoc ghpagesPushSite
// xsbt -Dsbt.global.base=/home/eje/.sbt/sonatype +publish
// make sure sparkVersion and pythonVersion are set as you want them prior to +publish

import scala.sys.process._

name := "isarn-sketches-spark"

organization := "org.isarnproject"

bintrayOrganization := Some("isarn")
val packageVersion = "0.3.1"

val packageVersion = "0.4.0-SNAPSHOT"

val sparkVersion = "2.2.0"
val sparkVersion = "2.2.2"

val pythonVersion = "2.7"

Expand All @@ -18,11 +23,9 @@ val pythonCMD = s"""python${pythonVersion.split('.').head}"""

version := s"${packageVersion}-${sparkSuffix}-${pythonSuffix}"

scalaVersion := "2.11.8"

crossScalaVersions := Seq("2.10.6", "2.11.8")
scalaVersion := "2.11.12"

useGpg := true
crossScalaVersions := Seq("2.11.12") // scala 2.12 when spark supports it

pomIncludeRepository := { _ => false }

Expand Down Expand Up @@ -56,36 +59,34 @@ developers := List(
)
)

def commonSettings = Seq(
libraryDependencies ++= Seq(
"org.isarnproject" %% "isarn-sketches" % "0.1.1",
"org.apache.spark" %% "spark-core" % sparkVersion % Provided,
"org.apache.spark" %% "spark-sql" % sparkVersion % Provided,
"org.apache.spark" %% "spark-mllib" % sparkVersion % Provided,
"org.isarnproject" %% "isarn-scalatest" % "0.0.2" % Test,
"org.scalatest" %% "scalatest" % "2.2.4" % Test,
"org.apache.commons" % "commons-math3" % "3.6.1" % Test),
initialCommands in console := """
|import org.apache.spark.SparkConf
|import org.apache.spark.SparkContext
|import org.apache.spark.sql.SparkSession
|import org.apache.spark.SparkContext._
|import org.apache.spark.rdd.RDD
|import org.apache.spark.ml.linalg.Vectors
|import org.isarnproject.sketches.TDigest
|import org.isarnproject.sketches.udaf._
|import org.apache.spark.isarnproject.sketches.udt._
|val initialConf = new SparkConf().setAppName("repl").set("spark.serializer", "org.apache.spark.serializer.KryoSerializer").set("spark.kryoserializer.buffer", "16mb")
|val spark = SparkSession.builder.config(initialConf).master("local[2]").getOrCreate()
|import spark._, spark.implicits._
|val sc = spark.sparkContext
|import org.apache.log4j.{Logger, ConsoleAppender, Level}
|Logger.getRootLogger().getAppender("console").asInstanceOf[ConsoleAppender].setThreshold(Level.WARN)
""".stripMargin,
cleanupCommands in console := "spark.stop"
)

seq(commonSettings:_*)
libraryDependencies ++= Seq(
"org.isarnproject" %% "isarn-sketches" % "0.1.2",
"org.apache.spark" %% "spark-core" % sparkVersion % Provided,
"org.apache.spark" %% "spark-sql" % sparkVersion % Provided,
"org.apache.spark" %% "spark-mllib" % sparkVersion % Provided,
"org.isarnproject" %% "isarn-scalatest" % "0.0.3" % Test,
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"org.apache.commons" % "commons-math3" % "3.6.1" % Test)

initialCommands in console := """
|import org.apache.spark.SparkConf
|import org.apache.spark.SparkContext
|import org.apache.spark.sql.SparkSession
|import org.apache.spark.SparkContext._
|import org.apache.spark.rdd.RDD
|import org.apache.spark.ml.linalg.Vectors
|import org.isarnproject.sketches.TDigest
|import org.isarnproject.sketches.udaf._
|import org.apache.spark.isarnproject.sketches.udt._
|val initialConf = new SparkConf().setAppName("repl").set("spark.serializer", "org.apache.spark.serializer.KryoSerializer").set("spark.kryoserializer.buffer", "16mb")
|val spark = SparkSession.builder.config(initialConf).master("local[2]").getOrCreate()
|import spark._, spark.implicits._
|val sc = spark.sparkContext
|import org.apache.log4j.{Logger, ConsoleAppender, Level}
|Logger.getRootLogger().getAppender("console").asInstanceOf[ConsoleAppender].setThreshold(Level.WARN)
""".stripMargin

cleanupCommands in console := "spark.stop"

licenses += ("Apache-2.0", url("http://opensource.org/licenses/Apache-2.0"))

Expand Down Expand Up @@ -118,9 +119,9 @@ compilePython := {
}
}

compilePython <<= compilePython.dependsOn(deletePYC)
compilePython := (compilePython.dependsOn(deletePYC)).value

(packageBin in Compile) <<= (packageBin in Compile).dependsOn(compilePython)
(packageBin in Compile) := ((packageBin in Compile).dependsOn(compilePython)).value

mappings in (Compile, packageBin) ++= Seq(
(baseDirectory.value / "python" / "isarnproject" / "__init__.pyc") -> "isarnproject/__init__.pyc",
Expand All @@ -142,13 +143,10 @@ assemblyShadeRules in assembly := Seq(

scalacOptions in (Compile, doc) ++= Seq("-doc-root-content", baseDirectory.value+"/root-doc.txt")

site.settings

site.includeScaladoc()
enablePlugins(ScalaUnidocPlugin, GhpagesPlugin)

// Re-enable if/when we want to support gh-pages w/ jekyll
// site.jekyllSupport()
siteSubdirName in ScalaUnidoc := "latest/api"

ghpages.settings
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), siteSubdirName in ScalaUnidoc)

git.remoteRepo := "git@github.com:isarn/isarn-sketches-spark.git"
2 changes: 1 addition & 1 deletion project/assembly.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.4")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.11
sbt.version=1.2.0
16 changes: 8 additions & 8 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositori

resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"

addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")

addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4")
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.6.0")
addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.1.6")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.1")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")

// scoverage and coveralls deps are at old versions to avoid a bug in the current versions
// update these when this fix is released: https://github.com/scoverage/sbt-coveralls/issues/73
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.0.4")
//addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.0.4")

//addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.0.0")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.0.0")
//addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.6.0")

0 comments on commit 10b24f2

Please sign in to comment.