<commit_before>import AssemblyKeys._
import sbt.Keys._

import scala.util.matching.Regex

assemblySettings

name := "mist"

organization := "io.hydrosphere"

val versionRegex = "(\\d+)\\.(\\d+).*".r
val sparkVersion = util.Properties.propOrNone("sparkVersion").getOrElse("[1.5.2, )")

scalaVersion := {
  sparkVersion match {
    case versionRegex(major, minor) if major.toInt == 1 => "2.10.6"
    case versionRegex(major, minor) if major.toInt > 1 => "2.11.8"
    case _ => "2.11.8"
  }
}

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

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  Resolver.sonatypeRepo("snapshots")
)
resolvers += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

libraryDependencies <++= scalaVersion(akkaDependencies)

libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % sparkVersion % "provided",
  "org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
  "org.apache.spark" %% "spark-hive" % sparkVersion % "provided",
  "org.apache.spark" %% "spark-streaming" % sparkVersion % "provided",
  "org.json4s" %% "json4s-native" % "3.2.10",
  "org.json4s" %% "json4s-jackson" % "3.2.10",
  "com.typesafe" % "config" % "1.3.1",
  "com.typesafe.akka" %% "akka-http-core-experimental" % "2.0.4",
  "com.typesafe.akka" %% "akka-http-experimental" % "2.0.4",
  "com.typesafe.akka" %% "akka-http-spray-json-experimental" % "2.0.4",
  "com.github.fge" % "json-schema-validator" % "2.2.6",
  "org.scalactic" %% "scalactic" % "2.2.6",
  "org.scalatest" %% "scalatest" % "2.2.6" % "test",
  "com.typesafe.akka" %% "akka-testkit" % "2.3.12" % "test",
  "org.scalamock" %% "scalamock-scalatest-support" % "3.2.2" % "test",
  "org.mapdb" % "mapdb" % "3.0.2",
  "org.eclipse.paho" % "org.eclipse.paho.client.mqttv3" % "1.1.0",
  "org.apache.hadoop" % "hadoop-client" % "2.7.3" intransitive()
)

dependencyOverrides += "com.typesafe" % "config" % "1.3.1"


def akkaDependencies(scalaVersion: String) = {
  val Old = """2\.10\..""".r

  scalaVersion match {
    case Old() => Seq(
      "com.typesafe.akka" %% "akka-actor" % "2.3.15",
      "com.typesafe.akka" %% "akka-cluster" % "2.3.15",
      "org.slf4j" % "slf4j-api" % "1.7.5",
      "ch.qos.logback" % "logback-classic" % "1.0.3",
      "com.typesafe" %% "scalalogging-slf4j" % "1.0.1",<commit_msg>increase scalatest version<commit_after>import AssemblyKeys._
import sbt.Keys._

import scala.util.matching.Regex

assemblySettings

name := "mist"

organization := "io.hydrosphere"

val versionRegex = "(\\d+)\\.(\\d+).*".r
val sparkVersion = util.Properties.propOrNone("sparkVersion").getOrElse("[1.5.2, )")

scalaVersion := {
  sparkVersion match {
    case versionRegex(major, minor) if major.toInt == 1 => "2.10.6"
    case versionRegex(major, minor) if major.toInt > 1 => "2.11.8"
    case _ => "2.11.8"
  }
}

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

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  Resolver.sonatypeRepo("snapshots")
)
resolvers += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

libraryDependencies <++= scalaVersion(akkaDependencies)

libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % sparkVersion % "provided",
  "org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
  "org.apache.spark" %% "spark-hive" % sparkVersion % "provided",
  "org.apache.spark" %% "spark-streaming" % sparkVersion % "provided",
  "org.json4s" %% "json4s-native" % "3.2.10",
  "org.json4s" %% "json4s-jackson" % "3.2.10",
  "com.typesafe" % "config" % "1.3.1",
  "com.typesafe.akka" %% "akka-http-core-experimental" % "2.0.4",
  "com.typesafe.akka" %% "akka-http-experimental" % "2.0.4",
  "com.typesafe.akka" %% "akka-http-spray-json-experimental" % "2.0.4",
  "com.github.fge" % "json-schema-validator" % "2.2.6",
  "org.scalactic" %% "scalactic" % "3.0.1-SNAP1" % "test",
  "org.scalatest" %% "scalatest" % "3.0.1-SNAP1" % "test",
  "com.typesafe.akka" %% "akka-testkit" % "2.3.12" % "test",
  "org.scalamock" %% "scalamock-scalatest-support" % "3.2.2" % "test",
  "org.mapdb" % "mapdb" % "3.0.2",
  "org.eclipse.paho" % "org.eclipse.paho.client.mqttv3" % "1.1.0",
  "org.apache.hadoop" % "hadoop-client" % "2.7.3" intransitive()
)

dependencyOverrides += "com.typesafe" % "config" % "1.3.1"


def akkaDependencies(scalaVersion: String) = {
  val Old = """2\.10\..""".r

  scalaVersion match {
    case Old() => Seq(
      "com.typesafe.akka" %% "akka-actor" % "2.3.15",
      "com.typesafe.akka" %% "akka-cluster" % "2.3.15",
      "org.slf4j" % "slf4j-api" % "1.7.5",
      "ch.qos.logback" % "logback-classic" % "1.0.3",
      "com.typesafe" %% "scalalogging-slf4j" % "1.0.1",
{'fraction_non_alphanumeric': 0.22152665589660744, 'fraction_numerical': 0.04119547657512116, 'mean_word_length': 3.870206489675516, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2286156', 'n_tokens_mistral': 2205, 'n_tokens_neox': 2043, 'n_words': 296}