// Comment to get more information during initialization
logLevel := Level.Warn

//resolvers += "Local Repository" at "http://localhost:8090/publish"

// Enable it for Play 2.0.3
//resolvers += "Typesafe releases" at "http://repo.typesafe.com/typesafe/releases"

resolvers += (Resolver.file("Local Ivy Repository", file(Path.userHome.absolutePath+"/.ivy2/local"))(Resolver.ivyStylePatterns))

resolvers += "Play2war plugins snapshot" at "http://repository-play-war.forge.cloudbees.com/snapshot/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.2")

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

addSbtPlugin("com.github.play2war" % "play2-war-plugin" % "0.9-SNAPSHOT")

// Comment to get more information during initialization
logLevel := Level.Warn

//resolvers += "Local Repository" at "http://localhost:8090/publish"

// Enable it for Play 2.0.3
resolvers += "Typesafe releases" at "http://repo.typesafe.com/typesafe/releases"

resolvers += (Resolver.file("Local Ivy Repository", file(Path.userHome.absolutePath+"/.ivy2/local"))(Resolver.ivyStylePatterns))

resolvers += "Play2war plugins snapshot" at "http://repository-play-war.forge.cloudbees.com/snapshot/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % Option(System.getProperty("play.version")).getOrElse("2.0.2"))

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

addSbtPlugin("com.github.play2war" % "play2-war-plugin" % "0.9-SNAPSHOT")

Prepare for integration tests over ultiple Play runtimes


package core

import com.gilt.apidoc.v0.models.Organization
import lib.{Text, VersionTag}

case class ServiceConfiguration(
  orgKey: String,
  orgNamespace: String,
  version: String
) {

  /**
    * Example: apidocSpec => apidoc.spec
    */
  def applicationNamespace(key: String): String = {
    (
      Seq(orgNamespace.trim) ++
      Text.splitIntoWords(Text.camelCaseToUnderscore(key.trim)).map(_.toLowerCase).map(_.trim) ++
      Seq(VersionTag(version).major.map(num => s"v$num").getOrElse(""))
    ).filter(!_.isEmpty).mkString(".")
  }

}

object ServiceConfiguration {

  def apply(
    org: Organization,
    version: String
  ): ServiceConfiguration = {
    ServiceConfiguration(
      orgNamespace = org.namespace,
      orgKey = org.key,
      version = version
    )
  }

}

package core

import com.gilt.apidoc.v0.models.Organization
import lib.{Text, VersionTag}

case class ServiceConfiguration(
  orgKey: String,
  orgNamespace: String,
  version: String
) {
  assert(orgKey.trim == orgKey, s"orgKey[$orgKey] must be trimmed")
  assert(orgNamespace.trim == orgNamespace, s"orgNamespace[$orgNamespace] must be trimmed")
  assert(version.trim == version, s"version[$version] must be trimmed")

  /**
    * Example: apidocSpec => apidoc.spec
    */
  def applicationNamespace(key: String): String = {
    (
      Seq(orgNamespace.trim) ++
      Text.splitIntoWords(Text.camelCaseToUnderscore(key.trim)).map(_.toLowerCase).map(_.trim) ++
      Seq(VersionTag(version).major.map(num => s"v$num").getOrElse(""))
    ).filter(!_.isEmpty).mkString(".")
  }

}

object ServiceConfiguration {

  def apply(
    org: Organization,
    version: String
  ): ServiceConfiguration = {
    ServiceConfiguration(
      orgNamespace = org.namespace.trim,
      orgKey = org.key.trim,
      version = version.trim
    )
  }

}

Make sure version numbers are trimmed

Make sure version numbers are trimmed


trait That1[A]
class T[A, This <: That1[A]](val x: Int) extends AnyVal {
  self: This =>
  final def loop(x: This, cnt: Int): Int = loop(x, cnt + 1)
  def const[B](): Boolean = return true
}

class Foo[+A <: AnyRef](val xs: List[A]) extends AnyVal {
  def baz[B >: A](x: B): List[B] = ???
}

object CollectionStrawMan {
  import collection.mutable.ArrayBuffer
  import reflect.ClassTag

  implicit class ArrayOps[A](val xs: Array[A]) extends AnyVal {

    def elemTag: ClassTag[A] = ClassTag(xs.getClass.getComponentType)

    protected[this] def newBuilder = new ArrayBuffer[A].mapResult(_.toArray(elemTag))
  }
}

extension [A](xs: List[A])
  inline def foldl[B](z: B)(op: (B, A) => B): B =
    (xs: List[A]).foldLeft(z)(op)

val x = List("a", "b").foldl[Int](0)((x, y) => x + y.length)

trait That1[A]
class T[A, This <: That1[A]](val x: Int) extends AnyVal {
  self: This =>
  final def loop(x: This, cnt: Int): Int = loop(x, cnt + 1)
  def const[B](): Boolean = return true
}

class Foo[+A <: AnyRef](val xs: List[A]) extends AnyVal {
  def baz[B >: A](x: B): List[B] = ???
}

object CollectionStrawMan {
  import collection.mutable.ArrayBuffer
  import reflect.ClassTag

  implicit class ArrayOps[A](val xs: Array[A]) extends AnyVal {

    def elemTag: ClassTag[A] = ClassTag(xs.getClass.getComponentType)

    protected[this] def newBuilder = new ArrayBuffer[A].mapResult(_.toArray(elemTag))
  }
}

extension [A](xs: List[A])
  inline def foldl[B](z: B)(op: (B, A) => B): B =
    (xs: List[A]).foldLeft(z)(op)
  inline def concat[B <: A](ys: List[B]): List[A] = xs ++ ys

val x = List("a", "b").foldl[Int](0)((x, y) => x + y.length)
val y = Nil.concat(1 :: Nil)
val y1: List[Int] = y
val z = (1 :: Nil).concat(Nil)
val z1: List[Int] = z

trait TT:
  type A
  val m: A
  def f[B <: A](x: B): A = if ??? then m else x

extension (x: TT)
  def foo[B <: x.A](y: B) = x.f(y)

object CC extends TT:
  type A = Seq[Int]
  val m = Nil

val xx = CC.foo(List(1, 2, 3))

Add tests with dependencies from second type parameter clause

Add tests with dependencies from second type parameter clause to
first type parameter and extension parameter clauses.


import sbt._

class GeoScriptProject(info: ProjectInfo) extends ParentProject(info) {
  lazy val library =
    project("geoscript", "GeoScript Library", new GeoScriptLibrary(_))
  lazy val examples = project("examples", "GeoScript Examples", library)

  class GeoScriptLibrary(info: ProjectInfo) extends DefaultProject(info) {
    val osgeo = "OSGeo Maven Repository" at
        "http://download.osgeo.org/webdav/geotools/"
    val java_net = "Java.net Maven Repository" at
        "http://download.java.net/maven/2/"

    val gtVersion = "[2.6.0,2.7.0["

    val gtMain = "org.geotools" % "gt-main" % gtVersion
    val gtReferencing = "org.geotools" % "gt-epsg-hsql" % gtVersion
    val gtShapefile = "org.geotools" % "gt-shapefile" % gtVersion
    val gtJDBC = "org.geotools" % "gt-jdbc" % gtVersion
    val gtDirectory = "org.geotools" % "gt-directory" % gtVersion

    val jai = "javax.media" % "jai_core" % "1.1.3"

    val scalaTest = "org.scalatest" % "scalatest" % "1.0" % "test"
  }
}

import sbt._

class GeoScriptProject(info: ProjectInfo) extends ParentProject(info) {
  lazy val library =
    project("geoscript", "GeoScript Library", new GeoScriptLibrary(_))
  lazy val examples = project("examples", "GeoScript Examples", library)

  lazy val console = task {
    library.act("console")
  } describedAs "Alias for library's console task."

  lazy val run = task { (args: Array[String]) => task {
    examples.call("run", args)
  } } describedAs "Alias for examples' run task."

  class GeoScriptLibrary(info: ProjectInfo) extends DefaultProject(info) {
    val osgeo = "OSGeo Maven Repository" at
        "http://download.osgeo.org/webdav/geotools/"
    val java_net = "Java.net Maven Repository" at
        "http://download.java.net/maven/2/"

    val gtVersion = "[2.6.0,2.7.0["

    val gtMain = "org.geotools" % "gt-main" % gtVersion
    val gtReferencing = "org.geotools" % "gt-epsg-hsql" % gtVersion
    val gtShapefile = "org.geotools" % "gt-shapefile" % gtVersion
    val gtJDBC = "org.geotools" % "gt-jdbc" % gtVersion
    val gtDirectory = "org.geotools" % "gt-directory" % gtVersion

    val jai = "javax.media" % "jai_core" % "1.1.3"

    val scalaTest = "org.scalatest" % "scalatest" % "1.0" % "test"
  }
}

Make 'run' on the parent project an alias for 'run' in the examples project, and 'console' an alias for 'console' on the library project.


package ranking

import controllers.routes
import models.db
import ranking.common.{Ranking, RankingElement}
import scalikejdbc._

import scala.collection.mutable

/**
 *
 * @author ponkotuy
 * Date: 14/12/05.
 */
case object FirstShipRate extends Ranking {
  import ranking.common.Ranking._
  override val title: String = "初期艦"

  override def rankingQuery(limit: Int): List[RankingElement] = {
    val counts = mutable.Map[Int, Long]().withDefaultValue(0)
    db.Ship.countAllShip(sqls"s.id = 1").foreach { case (sid, count) =>
      counts(EvolutionBase(sid)) += count
    }
    val masters = db.MasterShipBase.findAllBy(sqls"ms.id in (${counts.keys.toSet})")
      .map { it => it.id -> it }.toMap
    val sum = counts.values.sum
    counts.toList.sortBy(-_._2).map { case (sid, count) =>
      val master = masters(sid)
      val url = routes.ViewSta.shipBook(sid).toString()
      RankingElement(master.name, {f"$count%,d"}{s" / $sum"}, url, count)
    }.toList
  }

  override def comment: List[String] = List("進化前で集計しています")

  override def divClass: String = colmd3
}

package ranking

import controllers.routes
import models.db
import ranking.common.{Ranking, RankingElement}
import scalikejdbc._

import scala.collection.mutable

/**
 *
 * @author ponkotuy
 * Date: 14/12/05.
 */
case object FirstShipRate extends Ranking {
  import ranking.common.Ranking._
  override val title: String = "初期艦"

  override def rankingQuery(limit: Int): List[RankingElement] = {
    val counts = mutable.Map[Int, Long]().withDefaultValue(0)
    db.Ship.countAllShip(sqls"s.id = 1").foreach { case (sid, count) =>
      counts(EvolutionBase(sid)) += count
    }
    val masters = db.MasterShipBase.findAllBy(sqls.in(db.MasterShipBase.ms.id, counts.keys.toSeq))
      .map { it => it.id -> it }.toMap
    val sum = counts.values.sum
    counts.toList.sortBy(-_._2).map { case (sid, count) =>
      val master = masters(sid)
      val url = routes.ViewSta.shipBook(sid).toString()
      RankingElement(master.name, {f"$count%,d"}{s" / $sum"}, url, count)
    }.toList
  }

  override def comment: List[String] = List("進化前で集計しています")

  override def divClass: String = colmd3
}

Fix SQL syntax error `id in ()`

Fix SQL syntax error `id in ()`


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.0.3" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

version := "0.1.24"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.0.3" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

version := "0.1.25"

autocommit: Update configuration to record version 0.1.25


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.1"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.1.0" % Test,
      compilerPlugin("com.github.ghik" %% "silencer-plugin" % "1.4.4" cross CrossVersion.full),
      "com.github.ghik" %% "silencer-lib" % "1.4.4" % Provided cross CrossVersion.full,
    ),
    credentials += Credentials(
      "Artifactory Realm",
      "flow.jfrog.io",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.jfrog.io/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

// silence all warnings on autogenerated files
flowGeneratedFiles ++= Seq(
  "src/main/scala/io/flow/generated/.*".r,
)

// Make sure you only exclude warnings for the project directories, i.e. make builds reproducible
scalacOptions += s"-P:silencer:sourceRoots=${baseDirectory.value.getCanonicalPath}"

version := "0.2.38"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.1"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.1.0" % Test,
      compilerPlugin("com.github.ghik" %% "silencer-plugin" % "1.4.4" cross CrossVersion.full),
      "com.github.ghik" %% "silencer-lib" % "1.4.4" % Provided cross CrossVersion.full,
    ),
    credentials += Credentials(
      "Artifactory Realm",
      "flow.jfrog.io",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.jfrog.io/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

// silence all warnings on autogenerated files
flowGeneratedFiles ++= Seq(
  "src/main/scala/io/flow/generated/.*".r,
)

// Make sure you only exclude warnings for the project directories, i.e. make builds reproducible
scalacOptions += s"-P:silencer:sourceRoots=${baseDirectory.value.getCanonicalPath}"

version := "0.2.39"

autocommit: Update configuration to record version 0.2.39


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.40"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.6.0",
      "com.ning" % "async-http-client" % "1.9.40",
      "org.scalatest" %% "scalatest" % "3.0.3" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.41"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.6.0",
      "com.ning" % "async-http-client" % "1.9.40",
      "org.scalatest" %% "scalatest" % "3.0.3" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

autocommit: Update configuration to record version 0.1.41


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.6"

lazy val allScalacOptions = Seq(
  "-feature",
  "-Xfatal-warnings",
  "-unchecked",
  "-Xcheckinit",
  "-Xlint:adapted-args",
  "-Ypatmat-exhaust-depth", "100", // Fixes: Exhaustivity analysis reached max recursion depth, not all missing cases are reported.
  "-Wconf:src=generated/.*:silent",
  "-Wconf:src=target/.*:silent", // silence the unused imports errors generated by the Play Routes
)

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.2.10" % Test,
    ),
    credentials += Credentials(
      "Artifactory Realm",
      "flow.jfrog.io",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.jfrog.io/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

scalacOptions ++= allScalacOptions

version := "0.2.93"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.6"

lazy val allScalacOptions = Seq(
  "-feature",
  "-Xfatal-warnings",
  "-unchecked",
  "-Xcheckinit",
  "-Xlint:adapted-args",
  "-Ypatmat-exhaust-depth", "100", // Fixes: Exhaustivity analysis reached max recursion depth, not all missing cases are reported.
  "-Wconf:src=generated/.*:silent",
  "-Wconf:src=target/.*:silent", // silence the unused imports errors generated by the Play Routes
)

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.2.10" % Test,
    ),
    credentials += Credentials(
      "Artifactory Realm",
      "flow.jfrog.io",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.jfrog.io/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

scalacOptions ++= allScalacOptions

version := "0.2.94"

autocommit: Update configuration to record version 0.2.94


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.7"

version := "0.0.16"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.4.6",
      "com.ning" % "async-http-client" % "1.9.32",
      "org.scalatest" %% "scalatest" % "2.2.6" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.7"

version := "0.0.17"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.4.6",
      "com.ning" % "async-http-client" % "1.9.32",
      "org.scalatest" %% "scalatest" % "2.2.6" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

Increment version from 0.0.16 => 0.0.17

Increment version from 0.0.16 => 0.0.17


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.3.27"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(
    libraryDependencies ++= Seq(
      ws,
      filters,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.3",
      "org.scalatestplus" %% "play" % "1.4.0" % "test"
    ),
    resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
    resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
    resolvers += "Artifactory" at "https://flow.artifactoryonline.com/flow/libs-release/",
    credentials += Credentials(
      "Artifactory Realm",
      "flow.artifactoryonline.com",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
)

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.3.28"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(
    libraryDependencies ++= Seq(
      ws,
      filters,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.3",
      "org.scalatestplus" %% "play" % "1.4.0" % "test"
    ),
    resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
    resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
    resolvers += "Artifactory" at "https://flow.artifactoryonline.com/flow/libs-release/",
    credentials += Credentials(
      "Artifactory Realm",
      "flow.artifactoryonline.com",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
)

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

autocommit: Update configuration to record version 0.3.28


name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

crossScalaVersions := Seq("2.12.7", "2.11.12")

version := "0.3.0"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.6.10",
      "org.scalatest" %% "scalatest" % "3.0.5" % Test
    ),
    credentials += Credentials(
      "Artifactory Realm",
      "flow.jfrog.io",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.jfrog.io/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

crossScalaVersions := Seq("2.12.7", "2.11.12")

version := "0.3.1"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.6.10",
      "org.scalatest" %% "scalatest" % "3.0.5" % Test
    ),
    credentials += Credentials(
      "Artifactory Realm",
      "flow.jfrog.io",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.jfrog.io/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

autocommit: Update configuration to record version 0.3.1


name := "lib-apidoc-json-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.9"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.8",
      "org.scalatest" %% "scalatest" % "2.2.6" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

name := "lib-apidoc-json-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.10"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.8",
      "org.scalatest" %% "scalatest" % "2.2.6" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

autocommit: Update configuration to record version 0.0.10


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.5"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.9",
      "com.ning" % "async-http-client" % "1.9.40",
      "org.scalatest" %% "scalatest" % "3.0.0" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.6"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.9",
      "com.ning" % "async-http-client" % "1.9.40",
      "org.scalatest" %% "scalatest" % "3.0.0" % Test
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

autocommit: Update configuration to record version 0.1.6


name := "akka-http-health"

organization := "io.github.lhotari"

version := "1.0.4"

scalaVersion := "2.12.1"

crossScalaVersions := Seq("2.11.8", scalaVersion.value)

scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8")

libraryDependencies ++= {
  val akkaHttpVersion = "10.0.4"
  val scalaTestVersion = "3.0.1"
  val mockitoVersion = "1.10.19"
  Seq(
    "com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
    "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion,
    "org.scalatest" %% "scalatest" % scalaTestVersion % "test",
    "org.mockito" % "mockito-all" % mockitoVersion % "test",
    "com.google.guava" % "guava" % "21.0" % "test",
    "commons-io" % "commons-io" % "2.5" % "test"
  )
}

licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
publishArtifact in Test := false
bintrayRepository := "releases"
bintrayVcsUrl := Some("https://github.com/lhotari/akka-http-health")

name := "akka-http-health"

organization := "io.github.lhotari"

version := "1.0.4"

scalaVersion := "2.12.1"

crossScalaVersions := Seq("2.11.8", scalaVersion.value)

scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8")

libraryDependencies ++= {
  val akkaHttpVersion = "10.0.4"
  val scalaTestVersion = "3.0.1"
  val mockitoVersion = "1.10.19"
  Seq(
    "com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
    "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "test",
    "org.scalatest" %% "scalatest" % scalaTestVersion % "test",
    "org.mockito" % "mockito-all" % mockitoVersion % "test",
    "com.google.guava" % "guava" % "21.0" % "test",
    "commons-io" % "commons-io" % "2.5" % "test"
  )
}

licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
publishArtifact in Test := false
bintrayRepository := "releases"
bintrayVcsUrl := Some("https://github.com/lhotari/akka-http-health")

Use test scope for akka-http-testkit

Use test scope for akka-http-testkit


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.12"

crossScalaVersions := Seq("2.11.12")

version := "0.4.25"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(
    libraryDependencies ++= Seq(
      ws,
      filters,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.3",
      "org.scalatestplus" %% "play" % "1.4.0" % "test"
    ),
    resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
    resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
    resolvers += "Artifactory" at "https://flow.artifactoryonline.com/flow/libs-release/",
    credentials += Credentials(
      "Artifactory Realm",
      "flow.artifactoryonline.com",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.12"

crossScalaVersions := Seq("2.11.12")

version := "0.4.26"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(
    libraryDependencies ++= Seq(
      ws,
      filters,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.3",
      "org.scalatestplus" %% "play" % "1.4.0" % "test"
    ),
    resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
    resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
    resolvers += "Artifactory" at "https://flow.artifactoryonline.com/flow/libs-release/",
    credentials += Credentials(
      "Artifactory Realm",
      "flow.artifactoryonline.com",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

autocommit: Update configuration to record version 0.4.26


package stainless.algebra

import stainless.annotation._

object Monoid {
  import Semigroup._

  abstract class Monoid[A] extends Semigroup[A] {
    def identity: A

    @law
    def law_leftIdentity(x: A): Boolean = {
      combine(identity, x) == x
    }

    @law
    def law_rightIdentity(x: A): Boolean = {
      combine(x, identity) == x
    }
  }

  def multiplicationMonoid: Monoid[BigInt] = new Monoid[BigInt] {
    def combine(x: BigInt, y: BigInt): BigInt = x * y

    def identity: BigInt = 1
  }
}

package stainless.algebra

import stainless.annotation._
import stainless.collection._
import stainless.lang._
import stainless.proof._

object Monoid {
  import Semigroup._

  abstract class Monoid[A] extends Semigroup[A] {
    def identity: A

    @law
    def law_leftIdentity(x: A): Boolean = {
      combine(identity, x) == x
    }

    @law
    def law_rightIdentity(x: A): Boolean = {
      combine(x, identity) == x
    }
  }

  def multiplicationMonoid: Monoid[BigInt] = new Monoid[BigInt] {
    def combine(x: BigInt, y: BigInt): BigInt = x * y

    def identity: BigInt = 1
  }

  @induct
  private def lemma_associativity[T](x: List[T], y: List[T], z: List[T]): Boolean = {
    x ++ (y ++ z) == (x ++ y) ++ z
  }.holds

  def listConcatMonoid[T]: Monoid[List[T]] = new Monoid[List[T]] {
    def identity: List[T] = Nil[T]()

    def combine(x: List[T], y: List[T]): List[T] = x ++ y

    override def law_associativity(x: List[T], y: List[T], z: List[T]): Boolean = {
      super.law_associativity(x, y, z) because lemma_associativity(x, y, z)
    }
  }

  def optionMonoid[T](implicit ev: Monoid[T]): Monoid[Option[T]] = new Monoid[Option[T]] {
    def identity: Option[T] = None[T]()
    def combine(x: Option[T], y: Option[T]): Option[T] = {
      (x, y) match {
        case (Some(a), Some(b)) => Some(ev.combine(a, b))
        case (Some(a), None()) => Some(a)
        case (None(), Some(b)) => Some(b)
        case (None(), None()) => None[T]()
      }
    }

    override def law_associativity(x: Option[T], y: Option[T], z: Option[T]): Boolean = {
      super.law_associativity(x, y, z) because {
        (x, y, z) match {
          case (Some(a), Some(b), Some(c)) => check(ev.law_associativity(a, b, c))
          case _ => true
        }
      }
    }
  }
}

Add List concat and Option monoids templates


import sbt._
import sbt.Keys._
import android.Keys._
import android.Plugin._

object Build extends android.AutoBuild
{
	lazy val main = Project( "toolbelt", file( "." ) )
		.settings( androidBuildAar: _* )
		.settings(
			libraryDependencies ++= Seq(
				"com.android.support" % "appcompat-v7" % "21.0.0",
				"com.github.japgolly.android" % "svg-android" % "2.0.6",
				"com.jpardogo.materialtabstrip" % "library" % "1.0.5",
				"org.scala-lang" % "scala-reflect" % scalaVersion.value
			),
			name := "Toolbelt",
			organization := "com.taig.android",
			publishArtifact in ( Compile, packageDoc ) := false,
			scalaVersion := "2.11.4",
			scalacOptions ++= Seq(
				"-deprecation",
				"-feature",
				"-language:dynamics",
				"-language:existentials",
				"-language:implicitConversions",
				"-language:reflectiveCalls"
			),
			// @see https://github.com/pfn/android-sdk-plugin/issues/88
			sourceGenerators in Compile <<= ( sourceGenerators in Compile ) ( generators => Seq( generators.last ) ),
			version := "0.3.1-BETA",
			minSdkVersion in Android := "10",
			platformTarget in Android := "android-21",
			targetSdkVersion in Android := "21"
		)
}

import sbt._
import sbt.Keys._
import android.Keys._
import android.Plugin._

object Build extends android.AutoBuild
{
	lazy val main = Project( "toolbelt", file( "." ) )
		.settings( androidBuildAar: _* )
		.settings(
			libraryDependencies ++= Seq(
				"com.android.support" % "appcompat-v7" % "21.0.0",
				"com.github.japgolly.android" % "svg-android" % "2.0.6",
				"com.jpardogo.materialtabstrip" % "library" % "1.0.5",
				"org.scala-lang" % "scala-reflect" % scalaVersion.value
			),
			name := "Toolbelt",
			organization := "com.taig.android",
			publishArtifact in ( Compile, packageDoc ) := false,
			scalaVersion := "2.11.4",
			scalacOptions ++= Seq(
				"-deprecation",
				"-feature",
				"-language:dynamics",
				"-language:existentials",
				"-language:implicitConversions",
				"-language:reflectiveCalls"
			),
			// @see https://github.com/pfn/android-sdk-plugin/issues/88
			sourceGenerators in Compile <<= ( sourceGenerators in Compile ) ( generators => Seq( generators.last ) ),
			version := "0.3.2-BETA",
			minSdkVersion in Android := "10",
			platformTarget in Android := "android-21",
			targetSdkVersion in Android := "21"
		)
}

Set project version to 0.3.1-BETA

Set project version to 0.3.1-BETA


import sbt._
import sbt.Keys._
import android.Keys._
import android.Plugin._

object Build extends android.AutoBuild
{
	lazy val main = Project( "toolbelt", file( "." ) )
		.settings( androidBuildAar: _* )
		.settings(
			libraryDependencies ++= Seq(
				"com.android.support" % "appcompat-v7" % "21.0.0",
				"com.github.japgolly.android" % "svg-android" % "2.0.6",
				"com.jpardogo.materialtabstrip" % "library" % "1.0.5",
				"org.scala-lang" % "scala-reflect" % scalaVersion.value
			),
			name := "Toolbelt",
			organization := "com.taig.android",
			publishArtifact in ( Compile, packageDoc ) := false,
			scalaVersion := "2.11.4",
			scalacOptions ++= Seq(
				"-deprecation",
				"-feature",
				"-language:dynamics",
				"-language:existentials",
				"-language:implicitConversions",
				"-language:reflectiveCalls"
			),
			// @see https://github.com/pfn/android-sdk-plugin/issues/88
			sourceGenerators in Compile <<= ( sourceGenerators in Compile ) ( generators => Seq( generators.last ) ),
			version := "0.3.4-BETA",
			minSdkVersion in Android := "10",
			platformTarget in Android := "android-21",
			targetSdkVersion in Android := "21"
		)
}

import sbt._
import sbt.Keys._
import android.Keys._
import android.Plugin._

object Build extends android.AutoBuild
{
	lazy val main = Project( "toolbelt", file( "." ) )
		.settings( androidBuildAar: _* )
		.settings(
			libraryDependencies ++= Seq(
				"com.android.support" % "appcompat-v7" % "21.0.0",
				"com.github.japgolly.android" % "svg-android" % "2.0.6",
				"com.jpardogo.materialtabstrip" % "library" % "1.0.5",
				"org.scala-lang" % "scala-reflect" % scalaVersion.value
			),
			name := "Toolbelt",
			organization := "com.taig.android",
			publishArtifact in ( Compile, packageDoc ) := false,
			scalaVersion := "2.11.4",
			scalacOptions ++= Seq(
				"-deprecation",
				"-feature",
				"-language:dynamics",
				"-language:existentials",
				"-language:implicitConversions",
				"-language:reflectiveCalls"
			),
			// @see https://github.com/pfn/android-sdk-plugin/issues/88
			sourceGenerators in Compile <<= ( sourceGenerators in Compile ) ( generators => Seq( generators.last ) ),
			version := "0.3.5-BETA",
			minSdkVersion in Android := "10",
			platformTarget in Android := "android-21",
			targetSdkVersion in Android := "21"
		)
}

Set project version to 0.3.5-BETA

Set project version to 0.3.5-BETA


addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.9.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.3")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.9.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.3")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

Update sbt-scala-native-crossproject, ... to 1.1.0


// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")

// For removing warts, maintain code quality
addSbtPlugin("org.wartremover" %% "sbt-wartremover" % "2.4.13")

// The sbt native packager - needed for docker builds
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1")

// For code coverage test
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.1")

// For checkstyle
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

// For formatting Scala source code
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.16")

// Build fat JAR file
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")

// Check vulnerabilities in JAR's
addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "3.1.3")

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")

// For removing warts, maintain code quality
addSbtPlugin("org.wartremover" %% "sbt-wartremover" % "2.4.15")

// The sbt native packager - needed for docker builds
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1")

// For code coverage test
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.1")

// For checkstyle
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

// For formatting Scala source code
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.16")

// Build fat JAR file
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")

// Check vulnerabilities in JAR's
addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "3.1.3")

Update sbt-wartremover, wartremover to 2.4.15


// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.3")

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

addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")

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

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.4")

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

addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")

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

Upgrade Play version to 2.2.4.

Upgrade Play version to 2.2.4.


addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0")
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.8.0")

val sbtSoftwareMillVersion = "2.0.7"
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % sbtSoftwareMillVersion)
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % sbtSoftwareMillVersion)
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-browser-test-js" % sbtSoftwareMillVersion)

addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.23")

addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.0")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0")
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.8.0")

val sbtSoftwareMillVersion = "2.0.8"
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % sbtSoftwareMillVersion)
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % sbtSoftwareMillVersion)
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-browser-test-js" % sbtSoftwareMillVersion)

addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.23")

addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.0")

Update sbt-softwaremill-browser-test-js, ... to 2.0.8


import AssemblyKeys._

name := "infinity-server"

description := "Infinity Server"

assemblySettings

excludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
  cp filter { path => path.data.getName.contains("cglib-nodep-2.2.jar") }
}

jarName in assembly <<= (name, version) map { (name, version) => name + "-" + version + ".jar" }

libraryDependencies ++= Dependencies.unfiltered ++ Seq(
  Dependencies.anorm,
  Dependencies.commonsCodec,
  Dependencies.dispatch,
  Dependencies.finagleStream,
  Dependencies.finatra,
  Dependencies.h2database % "test",
  Dependencies.hadoopCommon % "provided",
  Dependencies.hadoopHdfs % "provided",
  Dependencies.liftJson,
  Dependencies.scalalikejdbc,
  Dependencies.scalaMigrations,
  Dependencies.scalaz,
  Dependencies.typesafeConfig
)

import AssemblyKeys._

name := "infinity-server"

description := "Infinity Server"

assemblySettings

excludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
  cp filter { path => path.data.getName.contains("cglib-nodep-2.2.jar") }
}

mergeStrategy in assembly <<= (mergeStrategy in assembly) { oldStrategy => {
  case "com/twitter/common/args/apt/cmdline.arg.info.txt.1" => MergeStrategy.first
  case other => oldStrategy(other)
}}

jarName in assembly <<= (name, version) map { (name, version) => name + "-" + version + ".jar" }

libraryDependencies ++= Dependencies.unfiltered ++ Seq(
  Dependencies.anorm,
  Dependencies.commonsCodec,
  Dependencies.dispatch,
  Dependencies.finagleStream,
  Dependencies.finatra,
  Dependencies.h2database % "test",
  Dependencies.hadoopCommon % "provided",
  Dependencies.hadoopHdfs % "provided",
  Dependencies.liftJson,
  Dependencies.scalalikejdbc,
  Dependencies.scalaMigrations,
  Dependencies.scalaz,
  Dependencies.typesafeConfig
)

Discard all but one cmdline.arg.info.txt.1 from the assembly


/*
 * Copyright (C) 2014 Romain Reuillon
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package fr.iscpif.gridscale.tools.shell

trait BashShell <: Shell {

  // bash -ci will fake an interactive shell (-i) in order to load the config files
  // as an interactive ssh shell would (~/.bashrc, /etc/bashrc)
  // and run the sequence of command without interaction (-c)
  override def command(cmd: String) = new Command {
    override def toString = "bash -ci \"" + cmd + "\""
  }
}

/*
 * Copyright (C) 2014 Romain Reuillon
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package fr.iscpif.gridscale.tools.shell

trait BashShell <: Shell {

  // bash -ci will fake an interactive shell (-i) in order to load the config files
  // as an interactive ssh shell would (~/.bashrc, /etc/bashrc)
  // and run the sequence of command without interaction (-c)
  override def command(cmd: String) = new Command {
    override def toString = "bash << EOF \n" +
      cmd + "\n" +
      "EOF"
  }
}

Switch bash script remote execution from bash -ci to bash << EOF


object Solution {

  def quickSort3Way(nums: Array[Int]) {

    def exch(i: Int, j: Int) {
      var temp = nums(i)
      nums(i) = nums(j)
      nums(j) = temp
    }

    def threeWayPartition(lo: Int, hi: Int) {
      if (lo >= hi) return;
      val p = nums(lo)
      var lt = lo; var gt = hi; var i = lo + 1;
      while (i <= gt) {
        if (nums(i) < p) {
          exch(i, lt)
          i += 1
          lt += 1
        }
        else if (p < nums(i)) {
          exch(i, gt)
          gt -= 1
        }
        else i += 1
      }
      threeWayPartition(lo, lt - 1)
      threeWayPartition(gt + 1, hi)
      println(nums.slice(lo, hi + 1).mkString(" "))
    }

    threeWayPartition(0, nums.size - 1)
  }

  def main(args: Array[String]) {
    val _ = readLine
    val nums = readLine.split(" ").map(_.toInt)
    quickSortWays(nums)
  }
}

object Solution {

  def quickSort(nums: Array[Int]) {

    def partition(nums: Array[Int]): Array[Int] = {
      if (nums.size <= 1) return nums
      val p = nums(0)
      val lessThan = nums.filter(_ < p)
      val equalTo = nums.filter(_ == p)
      val greaterThan = nums.filter(_ > p)
      val sortedArray = partition(lessThan) ++ equalTo ++ partition(greaterThan)
      println(sortedArray.mkString(" "))
      sortedArray
    }

    partition(nums)
  }

  def quickSort3Way(nums: Array[Int]) {

    def exch(i: Int, j: Int) {
      var temp = nums(i)
      nums(i) = nums(j)
      nums(j) = temp
    }

    def threeWayPartition(lo: Int, hi: Int) {
      if (lo >= hi) return;
      val p = nums(lo)
      var lt = lo; var gt = hi; var i = lo + 1;
      while (i <= gt) {
        if (nums(i) < p) {
          exch(i, lt)
          i += 1
          lt += 1
        }
        else if (p < nums(i)) {
          exch(i, gt)
          gt -= 1
        }
        else i += 1
      }
      threeWayPartition(lo, lt - 1)
      threeWayPartition(gt + 1, hi)
      println(nums.slice(lo, hi + 1).mkString(" "))
    }

    threeWayPartition(0, nums.size - 1)
  }

  def main(args: Array[String]) {
    val _ = readLine
    val nums = readLine.split(" ").map(_.toInt)
    quickSort(nums)
  }
}

Add solution to quick sort part 2 - sorting.


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.0.5" % Test
    ),
    credentials += Credentials(
      "Artifactory Realm",
      "flow.jfrog.io",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.jfrog.io/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

version := "0.2.16"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.0.5" % Test
    ),
    credentials += Credentials(
      "Artifactory Realm",
      "flow.jfrog.io",
      System.getenv("ARTIFACTORY_USERNAME"),
      System.getenv("ARTIFACTORY_PASSWORD")
    )
  )

publishTo := {
  val host = "https://flow.jfrog.io/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

version := "0.2.17"

autocommit: Update configuration to record version 0.2.17


val ls: List[Int] = null
/*start*/(ls.collect){ case x => x }/*end*/

//List[Int]

object ls {
  def collect[A](x: PartialFunction[Int, A]): A = null
}
/*start*/(ls.collect){ case x => x }/*end*/

//Int

Fix the test case from last commit, _really_ closing SCL-2763.


package com.crystal

// akka
import akka.actor.{ ActorSystem, Actor, Props }

// Spark
import org.apache.spark.SparkConf
import org.apache.spark.streaming.{ Duration, StreamingContext }

object Main extends App {
  AppConfig.setArgs(args)

  AppConfig.load() match {
    case Some(appConfig) =>
      val sparkConf = new SparkConf()
        .setMaster("local[*]")
        .setAppName(appConfig.appName)

      val streamingCtx = new StreamingContext(
        sparkConf,
        Duration(appConfig.checkpointInterval)
      )

      // Disable noisy logging
      streamingCtx.sparkContext.setLogLevel("ERROR")

      val system = ActorSystem("SegmentationSystem")
      val overseer = system.actorOf(Overseer.props(appConfig, streamingCtx), "overseer")
    case None => ()
  }
}

package com.crystal

// akka
import akka.actor.{ ActorSystem, Actor, Props }

// Spark
import org.apache.spark.SparkConf
import org.apache.spark.streaming.{ Duration, StreamingContext }

object Main extends App {
  AppConfig.setArgs(args)

  AppConfig.load() match {
    case Some(appConfig) =>
      val sparkConf = new SparkConf()
        .setMaster("local[*]")
        .setAppName(appConfig.appName)

      val streamingCtx = new StreamingContext(
        sparkConf,
        Duration(appConfig.checkpointInterval)
      )

      val system = ActorSystem("SegmentationSystem")
      val overseer = system.actorOf(Overseer.props(appConfig, streamingCtx), "overseer")
    case None => ()
  }
}

Enable logs to troubleshoot production issues


package io.flow.lint

object Main extends App {

  private[this] val linter = Lint()

  Downloader.withClient { dl =>

    import scala.concurrent.ExecutionContext.Implicits.global

    args.foreach { name =>
      val (organization, application, version) = name.split("/").map(_.trim).toList match {
        case org :: app :: Nil => (org, app, "latest")
        case org :: app :: version :: Nil => (org, app, version)
        case _ => {
          sys.error(s"Invalid name[$name] - expected organization/application (e.g. flow/user)")
        }
      }

      println("")
      println(s"$name")
      print(s"  Downloading...")
      dl.service(organization, application, version) match {
        case Left(error) => {
          println("\n  ** ERROR: " + error)
        }
        case Right(service) => {
          print("  Done\n  Starting Linter... ")
          linter.validate(service) match {
            case Nil => println("\n  Valid!")
            case errors => {
              println(" 1 or more errors found:")
              errors.foreach { error =>
                println(s"    - $error")
              }
            }
          }
        }
      }
    }

  }
}

package io.flow.lint

object Main extends App {

  private[this] val linter = Lint()

  Downloader.withClient { dl =>

    import scala.concurrent.ExecutionContext.Implicits.global

    args.foreach { name =>
      val (organization, application, version) = name.split("/").map(_.trim).toList match {
        case org :: app :: Nil => (org, app, "latest")
        case org :: app :: version :: Nil => (org, app, version)
        case _ => {
          sys.error(s"Invalid name[$name] - expected organization/application (e.g. flow/user)")
        }
      }

      println("")
      println(s"$name")
      print(s"  Downloading...")
      dl.service(organization, application, version) match {
        case Left(error) => {
          println("\n  ** ERROR: " + error)
        }
        case Right(service) => {
          print("  Done\n  Starting Linter... ")
          linter.validate(service) match {
            case Nil => println("\n  Valid!")
            case errors => {
              errors.size match {
                case 1 => println(" 1 error:")
                case n => println(s" $n errors:")
              }
              errors.sorted.foreach { error =>
                println(s"    - $error")
              }
            }
          }
        }
      }
    }

  }
}

Improve grammar of output to user

Improve grammar of output to user


name := "debiki-core"

organization := "com.debiki"

version := "0.0.2-SNAPSHOT"

scalaVersion := "2.10.0-RC1"

resolvers += "Scala-Tools Maven2 Repository" at "http://scala-tools.org/repo-releases"

libraryDependencies ++= Seq(
  // "org.scala-lang" % "scala-library" % "2.9.1",
  "com.google.guava" % "guava" % "10.0.1",
  "commons-codec" % "commons-codec" % "1.5",
  "nu.validator.htmlparser" % "htmlparser" % "1.2.1",
  "junit" % "junit" % "4.7" % "test",
  //"org.specs2" %% "specs2" % "1.12.2" % "test"  —> unresolved dependency: //"org.specs2#specs2_2.10;1.12.2: not found"
  "org.specs2" % "specs2_2.10.0-RC1" % "1.12.2" % "test"
)

scalacOptions += "-deprecation"

// See: https://groups.google.com/forum/?fromgroups=#!topic/simple-build-tool/bkF1IDZj4L0
ideaPackagePrefix := None

Add weird ideaPackagePrefix, so sbt-idea works

Otherwise it fails with a "missing package prefix" error.


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.1.8"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(
    libraryDependencies ++= Seq(
      ws,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.1",
      "org.scalatest" %% "scalatest" % "2.2.6" % "test",
      "org.scalatestplus" %% "play" % "1.4.0" % "test"
    )
)

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.1.9"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(
    libraryDependencies ++= Seq(
      ws,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.1",
      "org.scalatest" %% "scalatest" % "2.2.6" % "test",
      "org.scalatestplus" %% "play" % "1.4.0" % "test"
    )
)

publishTo := {
  val host = "https://flow.artifactoryonline.com/flow"
  if (isSnapshot.value) {
    Some("Artifactory Realm" at s"$host/libs-snapshot-local;build.timestamp=" + new java.util.Date().getTime)
  } else {
    Some("Artifactory Realm" at s"$host/libs-release-local")
  }
}

autocommit: Update configuration to record version 0.1.9


enablePlugins(JavaServerAppPackaging)

enablePlugins(DockerPlugin)

name := """sdkman-website"""

organization := "io.sdkman"

version := "1.0.0-SNAPSHOT"

packageName in Docker := "sdkman/sdkman-website"

dockerExposedPorts ++= Seq(9000)

javaOptions in Universal ++= Seq(
  "-Dpidfile.path=/dev/null"
)

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.12.10"

resolvers ++= Seq(
  Resolver.bintrayRepo("sdkman", "maven"),
  Resolver.jcenterRepo
)

libraryDependencies ++= Seq(
  ws,
  guice,
  "io.sdkman" %% "sdkman-mongodb-persistence" % "1.3",
  "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
  "com.iheart" %% "ficus" % "1.4.7")

enablePlugins(JavaServerAppPackaging)

enablePlugins(DockerPlugin)

name := """sdkman-website"""

organization := "io.sdkman"

version := "1.0.0-SNAPSHOT"

packageName in Docker := "sdkman/sdkman-website"

dockerExposedPorts ++= Seq(9000)

javaOptions in Universal ++= Seq(
  "-Dpidfile.path=/dev/null"
)

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.12.10"

resolvers += "jitpack" at "https://jitpack.io"

libraryDependencies ++= Seq(
  ws,
  guice,
  "com.github.sdkman" % "sdkman-mongodb-persistence" % "1.3",
  "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
  "com.iheart" %% "ficus" % "1.4.7")

Resolve bintray dependency directly with jitpack.


package org.scalameta
package build

object Versions {
  val LatestScala210 = "2.10.7"
  val LatestScala211 = "2.11.12"
  val LatestScala212 = "2.12.8"
  val LatestScala213 = "2.13.0-RC1"
  val LegacyScalaVersions = List(
    "2.12.7"
  )
}

package org.scalameta
package build

object Versions {
  val LatestScala210 = "2.10.7"
  val LatestScala211 = "2.11.12"
  val LatestScala212 = "2.12.8"
  val LatestScala213 = "2.13.0-RC1"
  val LegacyScalaVersions = List[String]()
}

Remove 2.12.7 from the build.

Remove 2.12.7 from the build.

Let's see if this reduces release times so we don't timeout on Travis.


resolvers ++= Seq(
  Classpaths.typesafeResolver,
  "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/",
  "Web plugin repo" at "http://siasia.github.com/maven2",
  "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
)

addSbtPlugin("play" % "sbt-plugin" % "2.0.3")

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0-M2-TYPESAFE")

addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.4.0")

libraryDependencies += "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.11"

resolvers ++= Seq(
  Classpaths.typesafeResolver,
  "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/",
  "Web plugin repo" at "http://siasia.github.com/maven2"
)

addSbtPlugin("play" % "sbt-plugin" % "2.0.3")

addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.4.0")

libraryDependencies += "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.11"

Remove dep on the indistinctly named typesafe version of sbt-idea

It is never good to have this.


logLevel := Level.Warn

libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "1.1.1"
libraryDependencies += "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.1.0"

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.9.0")
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.2")
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.2")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")

// Deployment configuration
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")

logLevel := Level.Warn

libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "1.1.1"
libraryDependencies += "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.1.0"

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.2")
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.2")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")

// Deployment configuration
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")

Update sbt-scalajs, scalajs-compiler, ... to 1.10.0


addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")

addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.2")

// addSbtPlugin("com.typesafe.sbt" % "sbt-proguard" % "0.2.2")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.2")

addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.18")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")

addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.2")

// addSbtPlugin("com.typesafe.sbt" % "sbt-proguard" % "0.2.2")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.2")

addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.19")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

Update sbt-wartremover, wartremover to 2.4.19


addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27")

addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.2")

Update sbt-jmh plugin to 0.3.2.

Update sbt-jmh plugin to 0.3.2.


package scala.tools
package partest

import nsc.io.{ File, Path, Directory }
import util.{ PathResolver }
import nsc.Properties.{ propOrElse, propOrNone, propOrEmpty }

object PartestDefaults {
  import nsc.Properties._
  private def wrapAccessControl[T](body: => Option[T]): Option[T] =
    try body catch { case _: java.security.AccessControlException => None }

  def testRootName  = propOrNone("partest.root")
  def srcDirName    = propOrElse("partest.srcdir", "files")
  def testRootDir   = testRootName map (x => Directory(x))

  def classPath   = propOrElse("partest.classpath", "")

  def javaCmd     = propOrElse("partest.javacmd", "java")
  def javacCmd    = propOrElse("partest.javac_cmd", "javac")
  def javaOpts    = propOrElse("partest.java_opts", "")
  def scalacOpts  = propOrElse("partest.scalac_opts", "-deprecation")

  def testBuild   = propOrNone("partest.build")
  def errorCount  = propOrElse("partest.errors", "0").toInt
  def numActors   = propOrElse("partest.actors", "6").toInt
  def poolSize    = wrapAccessControl(propOrNone("actors.corePoolSize"))

  def timeout     = "1200000"
}

package scala.tools
package partest

import nsc.io.{ File, Path, Directory }
import util.{ PathResolver }
import nsc.Properties.{ propOrElse, propOrNone, propOrEmpty }

object PartestDefaults {
  import nsc.Properties._
  private def wrapAccessControl[T](body: => Option[T]): Option[T] =
    try body catch { case _: java.security.AccessControlException => None }

  def testRootName  = propOrNone("partest.root")
  def srcDirName    = propOrElse("partest.srcdir", "files")
  def testRootDir   = testRootName map (x => Directory(x))

  // def classPath   = propOrElse("partest.classpath", "")
  def classpath   = PathResolver.Environment.javaUserClassPath    // XXX

  def javaCmd     = propOrElse("partest.javacmd", "java")
  def javacCmd    = propOrElse("partest.javac_cmd", "javac")
  def javaOpts    = propOrElse("partest.java_opts", "")
  def scalacOpts  = propOrElse("partest.scalac_opts", "-deprecation")

  def testBuild   = propOrNone("partest.build")
  def errorCount  = propOrElse("partest.errors", "0").toInt
  def numActors   = propOrElse("partest.actors", "6").toInt
  def poolSize    = wrapAccessControl(propOrNone("actors.corePoolSize"))

  def timeout     = "1200000"
}

Put back the XXX line in partest.

Put back the XXX line in partest.

Classpaths and partest, soon to be jointly responsible for one or more
tragedies. No review.


package uk.ac.wellcome.platform.snapshot_generator.source

import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.scaladsl.{Flow, Sink, Source}
import com.sksamuel.elastic4s.http.ElasticDsl.{search, termQuery}
import com.sksamuel.elastic4s.http.HttpClient
import com.sksamuel.elastic4s.http.search.SearchHit
import com.sksamuel.elastic4s.streams.ReactiveElastic._
import com.twitter.inject.Logging
import uk.ac.wellcome.models.IdentifiedWork
import uk.ac.wellcome.utils.JsonUtil._

object ElasticsearchWorksSource extends Logging {
  def apply(elasticClient: HttpClient, indexName: String, itemType: String)(
    implicit actorSystem: ActorSystem): Source[IdentifiedWork, NotUsed] = {
    val loggingSink = Flow[IdentifiedWork]
      .grouped(10000)
      .map(works => {
        logger.info(s"Received ${works.length} works from $indexName")
        works
      })
      .to(Sink.ignore)
    Source
      .fromPublisher(
        elasticClient.publisher(
          search(s"$indexName/$itemType")
            .query(termQuery("visible", true))
            .scroll(keepAlive = "1m")))
      .map { searchHit: SearchHit =>
        fromJson[IdentifiedWork](searchHit.sourceAsString).get
      }
      .alsoTo(loggingSink)
  }
}

package uk.ac.wellcome.platform.snapshot_generator.source

import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.scaladsl.{Flow, Sink, Source}
import com.sksamuel.elastic4s.http.ElasticDsl.{search, termQuery}
import com.sksamuel.elastic4s.http.HttpClient
import com.sksamuel.elastic4s.http.search.SearchHit
import com.sksamuel.elastic4s.streams.ReactiveElastic._
import com.twitter.inject.Logging
import uk.ac.wellcome.models.IdentifiedWork
import uk.ac.wellcome.utils.JsonUtil._

object ElasticsearchWorksSource extends Logging {
  def apply(elasticClient: HttpClient, indexName: String, itemType: String)(
    implicit actorSystem: ActorSystem): Source[IdentifiedWork, NotUsed] = {
    val loggingSink = Flow[IdentifiedWork]
      .grouped(10000)
      .map(works => {
        logger.info(s"Received ${works.length} works from $indexName")
        works
      })
      .to(Sink.ignore)
    Source
      .fromPublisher(
        elasticClient.publisher(
          search(s"$indexName/$itemType")
            .query(termQuery("visible", true))
            .scroll(keepAlive = "2m")
            .size(1000))
      )
      .map { searchHit: SearchHit =>
        fromJson[IdentifiedWork](searchHit.sourceAsString).get
      }
      .alsoTo(loggingSink)
  }
}

Increase keepAlive to match timeout in client and increase size of scroll requests to try and reduce the time it takes


addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.1")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.1")

Update sbt-scalajs, scalajs-compiler to 1.0.0


package io.finch.internal

import java.time.format.DateTimeFormatter
import java.time.Instant
import java.time.ZoneOffset

object currentTime {
  private[this] val formatter: DateTimeFormatter =
    DateTimeFormatter.RFC_1123_DATE_TIME.withZone(ZoneOffset.UTC)

  @volatile private[this] var last: (Long, String) = (0, "")

  def apply(): String = {
    val time = System.currentTimeMillis()
    if (time - last._1 > 1000) {
      last = time -> formatter.format(Instant.ofEpochMilli(time))
    }

    last._2
  }
}

package io.finch.internal

import java.time.{Instant, ZoneId}
import java.time.format.DateTimeFormatter
import java.util.Locale

object currentTime {
  private[this] val formatter: DateTimeFormatter =
    DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss zzz")
      .withLocale(Locale.ENGLISH)
      .withZone(ZoneId.of("GMT"))

  @volatile private[this] var last: (Long, String) = (0, "")

  def apply(): String = {
    val time = System.currentTimeMillis()
    if (time - last._1 > 1000) {
      last = time -> formatter.format(Instant.ofEpochMilli(time))
    }

    last._2
  }
}

Fix Date Header to conform to RFCs 7231 and 5322


package io.gatling.amqp.data

import com.rabbitmq.client.AMQP.BasicProperties
import com.rabbitmq.client.MessageProperties

case class PublishRequest(
  exchange: Exchange,
  routingKey: String,
  props: BasicProperties,
  bytes: Array[Byte]
) extends AmqpRequest {

  def withProps[A](b : BasicProperties.Builder => A): PublishRequest = {
    val builder = new BasicProperties.Builder()
    b(builder)
    copy(props = builder.build())
  }

  def persistent: PublishRequest = copy(props = MessageProperties.MINIMAL_PERSISTENT_BASIC)
}

object PublishRequest {
  def apply(queueName: String, bytes: Array[Byte]): PublishRequest =
    new PublishRequest(Exchange.Direct, queueName, props(), bytes)

  def apply(queueName: String, body: String): PublishRequest =
    new PublishRequest(Exchange.Direct, queueName, props(), body.getBytes("UTF-8"))

  def apply(exchange: Exchange, routingKey: String, body: String): PublishRequest =
    new PublishRequest(exchange, routingKey, props(), body.getBytes("UTF-8"))

  def apply(exchange: Exchange, routingKey: String, bytes: Array[Byte]): PublishRequest =
    new PublishRequest(exchange, "", props(), bytes)

  def props(): BasicProperties = {
    val builder = new BasicProperties.Builder()
    builder.build()
  }
}

package io.gatling.amqp.data

import com.rabbitmq.client.AMQP.BasicProperties
import com.rabbitmq.client.MessageProperties

case class PublishRequest(
  exchange: Exchange,
  routingKey: String,
  props: BasicProperties,
  bytes: Array[Byte]
) extends AmqpRequest {

  def withProps[A](b : BasicProperties.Builder => A): PublishRequest = {
    val builder = new BasicProperties.Builder()
    b(builder)
    copy(props = builder.build())
  }

  def persistent: PublishRequest = copy(props = MessageProperties.MINIMAL_PERSISTENT_BASIC)
}

object PublishRequest {
  def apply(queueName: String, bytes: Array[Byte]): PublishRequest =
    new PublishRequest(Exchange.Direct, queueName, props(), bytes)

  def apply(queueName: String, body: String): PublishRequest =
    new PublishRequest(Exchange.Direct, queueName, props(), body.getBytes("UTF-8"))

  def apply(exchange: Exchange, routingKey: String, body: String): PublishRequest =
    new PublishRequest(exchange, routingKey, props(), body.getBytes("UTF-8"))

  def apply(exchange: Exchange, routingKey: String, bytes: Array[Byte]): PublishRequest =
    new PublishRequest(exchange, routingKey, props(), bytes)

  def props(): BasicProperties = {
    val builder = new BasicProperties.Builder()
    builder.build()
  }
}

Fix of ignoring routing key parameter and passing just empty string.


package hercules.api

import akka.actor.ActorSystem
import akka.util.Timeout

import scala.concurrent.duration.Duration

/**
 * Core is type containing the ``system: ActorSystem`` and ``timeout: Timeout`` members.
 * This enables us to use it in our apps as well as in our tests.
 */
trait Core {

  implicit def system: ActorSystem
  implicit val timeout: Timeout

}

/**
 * This trait implements ``Core`` by starting the required ``ActorSystem`` and registering the
 * termination handler to stop the system when the JVM exits.
 */
trait BootedCore extends Core {

  /**
   * Construct the ActorSystem we will use in our application
   */
  implicit lazy val system = ActorSystem("hercules-rest-api")
  /**
   * Define the timeout value used throughout the API
   */
  implicit lazy val timeout = Timeout(Duration(5, "seconds"))

  /**
   * Ensure that the constructed ActorSystem is shut down when the JVM shuts down
   */
  sys.addShutdownHook(system.shutdown())

}

package hercules.api

import akka.actor.ActorSystem
import akka.util.Timeout
import com.typesafe.config.ConfigFactory

import scala.concurrent.duration.Duration

/**
 * Core is type containing the ``system: ActorSystem`` and ``timeout: Timeout`` members.
 * This enables us to use it in our apps as well as in our tests.
 */
trait Core {

  implicit def system: ActorSystem
  implicit val timeout: Timeout

}

/**
 * This trait implements ``Core`` by starting the required ``ActorSystem`` and registering the
 * termination handler to stop the system when the JVM exits.
 */
trait BootedCore extends Core {

  /**
   * Construct the ActorSystem we will use in our application
   */
  implicit lazy val system = ActorSystem("hercules-rest-api", ConfigFactory.load())
  /**
   * Define the timeout value used throughout the API
   */
  implicit lazy val timeout = Timeout(Duration(5, "seconds"))

  /**
   * Ensure that the constructed ActorSystem is shut down when the JVM shuts down
   */
  sys.addShutdownHook(system.shutdown())

}

Make sure config is loaded

Make sure config is loaded


import sbt._
import sbt.Keys._
import android.Keys._
import android.Plugin._

object Build extends android.AutoBuild
{
	lazy val main = Project( "toolbelt", file( "." ) )
		.settings( androidBuildAar: _* )
		.settings(
			libraryDependencies ++= Seq(
				"com.android.support" % "appcompat-v7" % "21.0.0",
				"com.github.japgolly.android" % "svg-android" % "2.0.6",
				"com.jpardogo.materialtabstrip" % "library" % "1.0.5",
				"org.scala-lang" % "scala-reflect" % scalaVersion.value
			),
			name := "Toolbelt",
			organization := "com.taig.android",
			publishArtifact in ( Compile, packageDoc ) := false,
			scalaVersion := "2.11.4",
			scalacOptions ++= Seq(
				"-deprecation",
				"-feature",
				"-language:dynamics",
				"-language:existentials",
				"-language:implicitConversions",
				"-language:reflectiveCalls"
			),
			// @see https://github.com/pfn/android-sdk-plugin/issues/88
			sourceGenerators in Compile <<= ( sourceGenerators in Compile ) ( generators => Seq( generators.last ) ),
			version := "0.3.8-BETA",
			minSdkVersion in Android := "10",
			platformTarget in Android := "android-21",
			targetSdkVersion in Android := "21"
		)
}

import sbt._
import sbt.Keys._
import android.Keys._
import android.Plugin._

object Build extends android.AutoBuild
{
	lazy val main = Project( "toolbelt", file( "." ) )
		.settings( androidBuildAar: _* )
		.settings(
			libraryDependencies ++= Seq(
				"com.android.support" % "appcompat-v7" % "21.0.0",
				"com.github.japgolly.android" % "svg-android" % "2.0.6",
				"com.jpardogo.materialtabstrip" % "library" % "1.0.5",
				"org.scala-lang" % "scala-reflect" % scalaVersion.value
			),
			name := "Toolbelt",
			organization := "com.taig.android",
			publishArtifact in ( Compile, packageDoc ) := false,
			scalaVersion := "2.11.4",
			scalacOptions ++= Seq(
				"-deprecation",
				"-feature",
				"-language:dynamics",
				"-language:existentials",
				"-language:implicitConversions",
				"-language:reflectiveCalls"
			),
			// @see https://github.com/pfn/android-sdk-plugin/issues/88
			sourceGenerators in Compile <<= ( sourceGenerators in Compile ) ( generators => Seq( generators.last ) ),
			version := "0.3.9-BETA",
			minSdkVersion in Android := "10",
			platformTarget in Android := "android-21",
			targetSdkVersion in Android := "21"
		)
}

Set project version to 0.3.9-BETA

Set project version to 0.3.9-BETA


addSbtPlugin("com.lightbend.paradox"     % "sbt-paradox"             % "0.9.2")
addSbtPlugin("com.typesafe.sbt"          % "sbt-site"                % "1.4.1")
addSbtPlugin("com.typesafe.sbt"          % "sbt-ghpages"             % "0.6.3")
addSbtPlugin("org.typelevel"             % "sbt-typelevel-ci-release" % "0.4.5")
addSbtPlugin("org.scoverage"             % "sbt-scoverage"           % "1.9.3")
addSbtPlugin("com.timushev.sbt"          % "sbt-updates"             % "0.6.2")
addSbtPlugin("pl.project13.scala"        % "sbt-jmh"                 % "0.4.3")
addSbtPlugin("de.heikoseeberger"         % "sbt-header"              % "5.6.5")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat"            % "0.1.21")
addSbtPlugin("org.scalameta"             % "sbt-mdoc"                % "2.2.24")

addSbtPlugin("com.lightbend.paradox"     % "sbt-paradox"             % "0.9.2")
addSbtPlugin("com.typesafe.sbt"          % "sbt-site"                % "1.4.1")
addSbtPlugin("com.typesafe.sbt"          % "sbt-ghpages"             % "0.6.3")
addSbtPlugin("org.typelevel"             % "sbt-typelevel-ci-release" % "0.4.5")
addSbtPlugin("org.scoverage"             % "sbt-scoverage"           % "1.9.3")
addSbtPlugin("com.timushev.sbt"          % "sbt-updates"             % "0.6.2")
addSbtPlugin("pl.project13.scala"        % "sbt-jmh"                 % "0.4.3")
addSbtPlugin("de.heikoseeberger"         % "sbt-header"              % "5.6.5")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat"            % "0.1.21")
addSbtPlugin("org.scalameta"             % "sbt-mdoc"                % "2.3.0")

Update mdoc, sbt-mdoc to 2.3.0

Update mdoc, sbt-mdoc to 2.3.0


resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.3")
addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.2.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.0-RC3")

resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")
addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.2.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.0-RC3")

Upgrade sbt-scoverage plugin to 1.3.5

Upgrade sbt-scoverage plugin to 1.3.5


addSbtPlugin("com.updateimpact" % "updateimpact-sbt-plugin" % "2.1.3")

libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.3.0"
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.27")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9")

addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill" % "1.6.0")

addSbtPlugin("com.updateimpact" % "updateimpact-sbt-plugin" % "2.1.3")

libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.3.0"
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9")

addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill" % "1.6.0")

Update sbt-scalajs, scalajs-compiler to 0.6.28


addSbtPlugin("org.scoverage"             % "sbt-scoverage"            % "1.6.1")
addSbtPlugin("com.47deg"                 % "sbt-microsites"           % "0.9.1")
addSbtPlugin("com.github.gseitz"         % "sbt-release"              % "1.0.13")
addSbtPlugin("org.scala-js"              % "sbt-scalajs"              % "0.6.32")
addSbtPlugin("org.portable-scala"        % "sbt-crossproject"         % "0.6.1")
addSbtPlugin("org.portable-scala"        % "sbt-scalajs-crossproject" % "0.6.1")
addSbtPlugin("com.lucidchart"            % "sbt-scalafmt"             % "1.16")
addSbtPlugin("org.tpolecat"              % "tut-plugin"               % "0.6.13")
addSbtPlugin("io.get-coursier"           % "sbt-coursier"             % "1.0.3")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat"             % "0.1.10")
addSbtPlugin("ch.epfl.scala"             % "sbt-scalajs-bundler"      % "0.12.0")
addSbtPlugin("com.geirsson"              % "sbt-ci-release"           % "1.5.2")

addSbtPlugin("org.scoverage"             % "sbt-scoverage"            % "1.6.1")
addSbtPlugin("com.47deg"                 % "sbt-microsites"           % "0.9.1")
addSbtPlugin("com.github.gseitz"         % "sbt-release"              % "1.0.13")
addSbtPlugin("org.scala-js"              % "sbt-scalajs"              % "0.6.32")
addSbtPlugin("org.portable-scala"        % "sbt-crossproject"         % "1.0.0")
addSbtPlugin("org.portable-scala"        % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("com.lucidchart"            % "sbt-scalafmt"             % "1.16")
addSbtPlugin("org.tpolecat"              % "tut-plugin"               % "0.6.13")
addSbtPlugin("io.get-coursier"           % "sbt-coursier"             % "1.0.3")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat"             % "0.1.10")
addSbtPlugin("ch.epfl.scala"             % "sbt-scalajs-bundler"      % "0.12.0")
addSbtPlugin("com.geirsson"              % "sbt-ci-release"           % "1.5.2")

Update sbt-crossproject, ... to 1.0.0

Update sbt-crossproject, ... to 1.0.0


addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13")
addSbtPlugin("ohnosequences" % "sbt-github-release" % "0.7.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7")

// https://github.com/ohnosequences/sbt-github-release/issues/28#issuecomment-426086656
libraryDependencies += "com.sun.activation" % "javax.activation" % "1.2.0"

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.11.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13")
addSbtPlugin("ohnosequences" % "sbt-github-release" % "0.7.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7")

// https://github.com/ohnosequences/sbt-github-release/issues/28#issuecomment-426086656
libraryDependencies += "com.sun.activation" % "javax.activation" % "1.2.0"

Update sbt-scalajs, scalajs-compiler, ... to 1.11.0


addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.15")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.11.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.15")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.12.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

Update sbt-scalajs, scalajs-compiler, ... to 1.12.0 in master


name := "geocss"

libraryDependencies <++= gtVersion { v =>
  Seq(
    "org.geotools" % "gt-main" % v,
    "org.geotools" % "gt-cql" % v
  )
}

libraryDependencies ++= Seq(
  "org.scalacheck" %% "scalacheck" % "1.10.0" % "test",
  "org.scalatest" %% "scalatest" % "1.9.1" % "test")

initialCommands += """
import org.{ geotools => gt }
import org.opengis.{ filter => ogc }
import org.geoscript._
import gt.filter.text.ecql.ECQL.{ toFilter => cql }
import geocss.filter.FiltersAreSentential
import support.logic.{ given, reduce }
def in(path: String) = new java.io.FileReader(new java.io.File(path))
def load(path: String) =
  geocss.CssParser.parseAll(
    geocss.CssParser.styleSheet, in(path)
  ).get
val tx = new geocss.Translator()
"""

name := "geocss"

libraryDependencies <++= gtVersion { v =>
  Seq(
    "org.geotools" % "gt-main" % v,
    "org.geotools" % "gt-cql" % v
  )
}

libraryDependencies ++= Seq(
  "org.scalacheck" %% "scalacheck" % "1.10.0" % "test",
  "org.scalatest" %% "scalatest" % "1.9.2" % "test")

initialCommands += """
import org.{ geotools => gt }
import org.opengis.{ filter => ogc }
import org.geoscript._
import gt.filter.text.ecql.ECQL.{ toFilter => cql }
import geocss.filter.FiltersAreSentential
import support.logic.{ given, reduce }
def in(path: String) = new java.io.FileReader(new java.io.File(path))
def load(path: String) =
  geocss.CssParser.parseAll(
    geocss.CssParser.styleSheet, in(path)
  ).get
val tx = new geocss.Translator()
"""

Update scalatest in geocss module

Update scalatest in geocss module


libraryDependencies += "org.rogach" %% "scallop" % "0.9.5"

libraryDependencies += "com.typesafe" % "config" % "1.3.0"

libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.5"

libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.5"

libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"

libraryDependencies += "org.rogach" %% "scallop" % "0.9.5"

libraryDependencies += "com.typesafe" % "config" % "1.3.0"

libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.6" % "test"

libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.5"

libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"

ssembly-cleanup: Update scalatest to 2.2.6 and drop it from assembly.

This updates scalatest to 2.2.6 and drops it from assembly
with ` % "test"` construct.


import sbt._

class ScalatraProject(info: ProjectInfo) extends ParentProject(info)
{
  override def shouldCheckOutputDirectories = false

  val jettyGroupId = "org.mortbay.jetty"
  val jettyVersion = "6.1.22"

  lazy val core = project("core", "scalatra", new CoreProject(_))
  class CoreProject(info: ProjectInfo) extends DefaultProject(info) {
    val jettytester = jettyGroupId % "jetty-servlet-tester" % jettyVersion % "provided"
    val scalatest = "org.scalatest" % "scalatest" % scalatestVersion(crossScalaVersionString) % "provided->default"
    val mockito = "org.mockito" % "mockito-core" % "1.8.2" % "test"
  }

  lazy val example = project("example", "scalatra-example", new ExampleProject(_), core)
  class ExampleProject(info: ProjectInfo) extends DefaultWebProject(info) {
    val jetty6 = jettyGroupId % "jetty" % jettyVersion % "test"
  }

  def scalatestVersion(scalaVersion: String) = {
    scalaVersion match {
      case "2.8.0.Beta1" =>
        "1.0.1-for-scala-2.8.0.Beta1-with-test-interfaces-0.3-SNAPSHOT"
      case "2.8.0.RC1" =>
        "1.0.1-for-scala-2.8.0.RC1-SNAPSHOT"
      case "2.8.0" =>
	// Temporary until ScalaTest is released for 2.8.0
        "1.2-for-scala-2.8.0.RC7-SNAPSHOT"
      case x =>
        "1.2-for-scala-"+x+"-SNAPSHOT"
    }
  }

  val scalaToolsSnapshots = "Scala-Tools Maven2 Snapshots Repository" at "http://scala-tools.org/repo-snapshots"
}

import sbt._

class ScalatraProject(info: ProjectInfo) extends ParentProject(info)
{
  override def shouldCheckOutputDirectories = false

  val jettyGroupId = "org.mortbay.jetty"
  val jettyVersion = "6.1.22"

  lazy val core = project("core", "scalatra", new CoreProject(_))
  class CoreProject(info: ProjectInfo) extends DefaultProject(info) {
    val jettytester = jettyGroupId % "jetty-servlet-tester" % jettyVersion % "provided"
    val scalatest = "org.scalatest" % "scalatest" % "1.2" % "provided->default"
    val mockito = "org.mockito" % "mockito-core" % "1.8.2" % "test"
  }

  lazy val example = project("example", "scalatra-example", new ExampleProject(_), core)
  class ExampleProject(info: ProjectInfo) extends DefaultWebProject(info) {
    val jetty6 = jettyGroupId % "jetty" % jettyVersion % "test"
  }

  val scalaToolsSnapshots = "Scala-Tools Maven2 Snapshots Repository" at "http://scala-tools.org/repo-snapshots"
}

Upgrade ScalaTest to 1.2 release.

Upgrade ScalaTest to 1.2 release.


object Version {

  val logback          = "1.1.2"
  val scalaLogging     = "3.1.0"
  val akka             = "2.3.11"
  val akkaStreams      = "1.0-RC4"
  val scalaTest        = "2.2.1"
  val scalaCheck       = "1.12.1"
  val elasticsearch    = "1.4.2"
  val jts              = "1.13"
  val scale            = "0.0.1"
  val async            = "0.9.2"
  val metrics          = "3.1.2"
  val influxdbReporter = "0.7.0"
  val metricsScala     = "3.5.1_a2.3"
}

object Version {

  val logback          = "1.1.2"
  val scalaLogging     = "3.1.0"
  val akka             = "2.3.11"
  val akkaStreams      = "1.0"
  val scalaTest        = "2.2.1"
  val scalaCheck       = "1.12.1"
  val elasticsearch    = "1.4.2"
  val jts              = "1.13"
  val scale            = "0.0.1"
  val async            = "0.9.2"
  val metrics          = "3.1.2"
  val influxdbReporter = "0.7.0"
  val metricsScala     = "3.5.1_a2.3"
}

Upgrade to Streams & Http 1.0

Upgrade to Streams & Http 1.0


import sbt._
import Keys._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

object Dependencies {
  lazy val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.1" % "test"

  lazy val jodaTime = Seq(
    "joda-time" % "joda-time" % "2.10.13",
    "org.joda" % "joda-convert" % "2.2.2"
  )
  lazy val jackson = Seq(
    "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.1"
  )
  lazy val scalaz_core = Def.setting(
    "org.scalaz" %%% "scalaz-core" % "7.3.6"
  )
  lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.8"
  lazy val scalatest = Def.setting(
    Seq("org.scalatest" %%% "scalatest-wordspec" % "3.2.11" % "test")
  )
  lazy val scalatestScalacheck = Def.setting(
    Seq("org.scalatestplus" %%% "scalacheck-1-15" % "3.2.11.0" % "test")
  )

  lazy val scalaXml = Def.setting {
    "org.scala-lang.modules" %%% "scala-xml" % "2.0.1"
  }
}

import sbt._
import Keys._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

object Dependencies {
  lazy val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.1" % "test"

  lazy val jodaTime = Seq(
    "joda-time" % "joda-time" % "2.10.13",
    "org.joda" % "joda-convert" % "2.2.2"
  )
  lazy val jackson = Seq(
    "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2"
  )
  lazy val scalaz_core = Def.setting(
    "org.scalaz" %%% "scalaz-core" % "7.3.6"
  )
  lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.8"
  lazy val scalatest = Def.setting(
    Seq("org.scalatest" %%% "scalatest-wordspec" % "3.2.11" % "test")
  )
  lazy val scalatestScalacheck = Def.setting(
    Seq("org.scalatestplus" %%% "scalacheck-1-15" % "3.2.11.0" % "test")
  )

  lazy val scalaXml = Def.setting {
    "org.scala-lang.modules" %%% "scala-xml" % "2.0.1"
  }
}

Update jackson-databind to 2.13.2 in master


import sbt._
import Keys._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

object Dependencies {
  lazy val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.1" % "test"

  lazy val jodaTime = Seq(
    "joda-time" % "joda-time" % "2.10.13",
    "org.joda" % "joda-convert" % "2.2.2"
  )
  lazy val jackson = Seq(
    "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0"
  )
  lazy val scalaz_core = Def.setting(
    "org.scalaz" %%% "scalaz-core" % "7.3.5" cross CrossVersion.for3Use2_13
  )
  lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.8"
  lazy val scalatest = Def.setting(
    Seq("org.scalatest" %%% "scalatest-wordspec" % "3.2.10" % "test")
  )
  lazy val scalatestScalacheck = Def.setting(
    Seq("org.scalatestplus" %%% "scalacheck-1-15" % "3.2.10.0" % "test")
  )

  lazy val scalaXml = Def.setting {
    "org.scala-lang.modules" %%% "scala-xml" % "2.0.1"
  }
}

import sbt._
import Keys._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

object Dependencies {
  lazy val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.1" % "test"

  lazy val jodaTime = Seq(
    "joda-time" % "joda-time" % "2.10.13",
    "org.joda" % "joda-convert" % "2.2.2"
  )
  lazy val jackson = Seq(
    "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.1"
  )
  lazy val scalaz_core = Def.setting(
    "org.scalaz" %%% "scalaz-core" % "7.3.5" cross CrossVersion.for3Use2_13
  )
  lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.8"
  lazy val scalatest = Def.setting(
    Seq("org.scalatest" %%% "scalatest-wordspec" % "3.2.10" % "test")
  )
  lazy val scalatestScalacheck = Def.setting(
    Seq("org.scalatestplus" %%% "scalacheck-1-15" % "3.2.10.0" % "test")
  )

  lazy val scalaXml = Def.setting {
    "org.scala-lang.modules" %%% "scala-xml" % "2.0.1"
  }
}

Update jackson-databind to 2.13.1 in master


/*
* 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.
*/

package hex

import hex.Model.Output

/**
 * Helper class to access package-private methods of Model API.
 */
object ModelUtils {

  def classify(row: Array[Double], m : Model[_, _, _]): (String, Array[Double]) = {
    val modelOutput = m._output.asInstanceOf[Output]
    val nclasses = modelOutput.nclasses()
    val classNames = modelOutput.classNames()
    val pred = m.score0(row, new Array[Double](nclasses + 1))
    (classNames(pred(0).asInstanceOf[Int]), pred slice (1, pred.length))
  }
}

/*
* 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.
*/

package hex

import hex.Model.Output
import water.util.ArrayUtils

/**
 * Helper class to access package-private methods of Model API.
 */
object ModelUtils {

  def classify(row: Array[Double], m : Model[_, _, _]): (String, Array[Double]) = {
    val modelOutput = m._output.asInstanceOf[Output]
    val nclasses = modelOutput.nclasses()
    val classNames = modelOutput.classNames()
    val pred = m.score0(row, new Array[Double](nclasses + 1))
    val predProb = pred slice (1, pred.length)
    val maxProbIdx = ArrayUtils.maxIndex(predProb)
    (classNames(maxProbIdx), predProb)
  }
}

[SW-68] Return right category in AskCraig application

H2O has started to return 0 instead of index of max probability.
The fix pick the index by finding the max probability in returned model prediction.