name := "raster-foundry-tile-server"

initialCommands in console := """
  |import com.azavea.rf.tile.Config
  |import com.azavea.rf.datamodel._
  |import com.azavea.rf.database.Database
  |import com.azavea.rf.database.ExtendedPostgresDriver.api._
  |import com.azavea.rf.database.tables._
  |import io.circe._
  |import io.circe.syntax._
  |import java.util.UUID
  |import java.sql.Timestamp
  |import java.time.Instant
  |import scala.concurrent.{Future,Await}
  |import scala.concurrent.duration._
  |import akka.actor.ActorSystem
  |import akka.stream.ActorMaterializer
  |val publicOrgId = UUID.fromString("dfac6307-b5ef-43f7-beda-b9f208bb7726")
  |import geotrellis.vector.{MultiPolygon, Polygon, Point, Geometry}
  |import geotrellis.slick.Projected
  |object Rollbar extends com.azavea.rf.common.RollbarNotifier {
  |  implicit val system = ActorSystem("rf-system")
  |  implicit val materializer = ActorMaterializer()
  |}
  |object Main extends Config { implicit val database = Database.DEFAULT }
  |import Main._
""".trim.stripMargin

Add convenience imports when in tile project console


package io.continuum.bokeh

trait FillProps { self: HasFields with Vectorization =>
    object fill_color extends Vectorized[Color](Color.Gray)
    object fill_alpha extends Field[Percent]
}

trait LineProps { self: HasFields with Vectorization =>
    object line_color extends Vectorized[Color](Color.Black)
    object line_width extends Field[Double](1.0)
    object line_alpha extends Field[Percent]
    object line_join extends Field[LineJoin]
    object line_cap extends Field[LineCap]
    object line_dash extends Field[List[Int]]
    object line_dash_offset extends Field[Int]
}

trait TextProps { self: HasFields with Vectorization =>
    object text_font extends Field[String]
    object text_font_size extends Field[FontSize](10 pt)
    object text_font_style extends Field[FontStyle]
    object text_color extends Field[Color](Color.Black)
    object text_alpha extends Field[Percent]
    object text_align extends Field[TextAlign]
    object text_baseline extends Field[TextBaseline]
}

package io.continuum.bokeh

trait FillProps { self: HasFields with Vectorization =>
    object fill_color extends Vectorized[Color](Color.Gray)
    object fill_alpha extends Vectorized[Percent]
}

trait LineProps { self: HasFields with Vectorization =>
    object line_color extends Vectorized[Color](Color.Black)
    object line_width extends Vectorized[Double](1.0)
    object line_alpha extends Vectorized[Percent]
    object line_join extends Vectorized[LineJoin]
    object line_cap extends Vectorized[LineCap]
    object line_dash extends Vectorized[List[Int]]
    object line_dash_offset extends Vectorized[Int]
}

trait TextProps { self: HasFields with Vectorization =>
    object text_font extends Vectorized[String]
    object text_font_size extends Vectorized[FontSize](10 pt)
    object text_font_style extends Vectorized[FontStyle]
    object text_color extends Vectorized[Color](Color.Black)
    object text_alpha extends Vectorized[Percent]
    object text_align extends Vectorized[TextAlign]
    object text_baseline extends Vectorized[TextBaseline]
}

Make all fields of mixins vectorized

Make all fields of mixins vectorized


import scala.annotation.tailrec
class Context {
  type Tree
}

class Test {
  @tailrec
  final def loop(c: Context)(trees: List[c.Tree]): Boolean =
    loop(c)(trees)

  @tailrec
  final def loop2(c: Context, trees: List[c.Tree]): Boolean =
    loop2(c, trees)
}

import scala.annotation.tailrec
class Context {
  type Tree
}

class TestSimple {
  @tailrec
  final def loop(c: Context)(trees: List[c.Tree]): Boolean =
    loop(c)(trees)

  @tailrec
  final def loop2(c: Context, trees: List[c.Tree]): Boolean =
    loop2(c, trees)

  @tailrec
  final def loop3[A <: Context](c: A, trees: List[c.Tree]): Boolean =
    loop3(c, trees)
}

class TestVCParameterized[C <: Context](val classC: C) extends AnyVal {
  @tailrec
  final def loop(c: C)(trees: List[c.Tree]): List[c.Tree] =
    loop(c)(trees)

  @tailrec
  final def loop2(c: C, trees: List[c.Tree]): List[c.Tree] =
    loop2(c, trees)

  @tailrec
  final def loop3[A <: C](c: A, trees: List[c.Tree]): List[c.Tree] =
    loop3(c, trees)

  @tailrec
  final def loop4(trees: List[classC.Tree]): List[classC.Tree] =
    loop4(trees)

  def loopNonRec(c: C)(trees: List[c.Tree]): List[c.Tree] = {
    loopNonRec(c)(trees)
    loopNonRec(c)(trees)
  }

  def loopNonRec2(c: C, trees: List[c.Tree]): List[c.Tree] = {
    loopNonRec2(c, trees)
    loopNonRec2(c, trees)
  }

  def loopNonRec3[A <: Context](c: A, trees: List[c.Tree]): List[classC.Tree] = {
    loopNonRec3(c, trees)
    loopNonRec3(c, trees)
  }

  def loopNonRec4(trees: List[classC.Tree]): List[classC.Tree] = {
    loopNonRec4(trees)
    loopNonRec4(trees)
  }
}

Add more testcases for this PR

Add more testcases for this PR


package audit

import audit.Message.JsonWrites
import com.google.inject.Inject
import com.rabbitmq.client.ConnectionFactory
import play.api.Logger
import play.api.libs.json.Json.{stringify, toJson}
import utils.helpers.Config

final class AuditServiceImpl @Inject()(config: Config) extends AuditService {

  override def send(auditMessage: Message): Unit = {
//    val factory = new ConnectionFactory()
//    factory.setHost(config.rabbitmqHost)
//    val connection = factory.newConnection() // TESTS NEED TO BE USING STUB SERVICE
//    try {
//      val channel = connection.createChannel()
//      try {
//        channel.queueDeclare(config.rabbitmqQueue, false, false, false, null)
//        val message = messageToSend(auditMessage).getBytes
//        channel.basicPublish("", config.rabbitmqQueue, null, message)
//        Logger.debug(s"Sent Audit message: $message")
//      } finally {
//        channel.close()
//      }
//    } finally {
//      connection.close()
//    }
    Logger.debug(s"Sent Audit message" + auditMessage)
  }

  private def messageToSend(auditMessage: Message) = {
    val asJson = toJson(auditMessage)
    stringify(asJson)
  }
}

package audit

import audit.Message.JsonWrites
import com.google.inject.Inject
import com.rabbitmq.client.ConnectionFactory
import play.api.Logger
import play.api.libs.json.Json.{stringify, toJson}
import utils.helpers.Config

final class AuditServiceImpl @Inject()(config: Config) extends AuditService {

  override def send(auditMessage: Message): Unit = {
    val factory = new ConnectionFactory()
    factory.setHost(config.rabbitmqHost)
    val connection = factory.newConnection() // TESTS NEED TO BE USING STUB SERVICE
    try {
      val channel = connection.createChannel()
      try {
        channel.queueDeclare(config.rabbitmqQueue, false, false, false, null)
        val message = messageToSend(auditMessage).getBytes
        channel.basicPublish("", config.rabbitmqQueue, null, message)
        Logger.debug(s"Sent Audit message: $message")
      } finally {
        channel.close()
      }
    } finally {
      connection.close()
    }
  }

  private def messageToSend(auditMessage: Message) = {
    val asJson = toJson(auditMessage)
    stringify(asJson)
  }
}

Revert "US1496: Comment out code that equires rabbitmq to be installed and running"

This reverts commit 5bb9891a7b92b4a14fce014fd7a3b096666de1dd.


resolvers ++= Seq(
    "socrata maven" at "https://repository-socrata-oss.forge.cloudbees.com/release",
    "DiversIT repo" at "http://repository-diversit.forge.cloudbees.com/release"
)

addSbtPlugin("com.socrata" % "socrata-cloudbees-sbt" % "1.3.1-SNAPSHOT")

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.2")

addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2")

libraryDependencies ++= Seq(
  "com.rojoma" %% "simple-arm" % "1.2.0",
  "com.rojoma" %% "rojoma-json" % "2.4.3"
)

resolvers ++= Seq(
    "socrata maven" at "https://repository-socrata-oss.forge.cloudbees.com/release",
    "DiversIT repo" at "http://repository-diversit.forge.cloudbees.com/release"
)

addSbtPlugin("com.socrata" % "socrata-cloudbees-sbt" % "1.3.1")

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.2")

addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2")

libraryDependencies ++= Seq(
  "com.rojoma" %% "simple-arm" % "1.2.0",
  "com.rojoma" %% "rojoma-json" % "2.4.3"
)

Upgrade to newer cloudbees plugin with sbt release fix


addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.7")

addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.9")

Update tut-core, tut-plugin to 0.6.9

Update tut-core, tut-plugin to 0.6.9


import akka.actor.{Actor, ActorSystem, Props}
import fsm.DiningHakkersOnFsm
import postoffice.PostOffice
import spray.SprayDemo

import scala.util.Random

object Main extends App {
  DiningHakkersOnFsm.run(ActorSystem("fsm"))
  PostOffice.run(ActorSystem("post-office"))
  SprayDemo.run(ActorSystem("spray"))

  val system = ActorSystem("small-demos")
  val lazyActorProps = Props(new Actor {
    override def receive: Receive = {
      case msg =>
        Thread.sleep(Random.nextInt(2000))
        sender() ! msg
    }
  })

  val lazyActor1 = system.actorOf(lazyActorProps, "lazy1")
  val lazyActor2 = system.actorOf(lazyActorProps, "lazy2")
  for (i <- 0 to 1000) {
    lazyActor1.tell("doit", lazyActor2)
  }
}

import akka.actor.{Actor, ActorSystem, Props}
import fsm.DiningHakkersOnFsm
import postoffice.PostOffice
import spray.SprayDemo

import scala.util.Random

object Main extends App {
  DiningHakkersOnFsm.run(ActorSystem("fsm"))
  PostOffice.run(ActorSystem("post-office"))
  SprayDemo.run(ActorSystem("spray"))

  val system = ActorSystem("small-demos")
  val lazyActorProps = Props(new Actor {
    var counter = 0
    override def receive: Receive = {
      case msg =>
        Thread.sleep(Random.nextInt(2000))
        counter += 1
        sender() ! msg
    }
  })

  val lazyActor1 = system.actorOf(lazyActorProps, "lazy1")
  val lazyActor2 = system.actorOf(lazyActorProps, "lazy2")
  for (i <- 0 to 1000) {
    lazyActor1.tell("doit", lazyActor2)
  }
}

Add counter to ping-pong actor to show it's value on frontend


package com.typesafe.sbt
package packager

import sbt._

/** A set of helper methods to simplify the writing of mappings */
object MappingsHelper {

  /** return a Seq of mappings which effect is to add a whole directory in the generated package */
  def directory(sourceDir: File): Seq[(File, String)] = {
    sourceDir.*** pair relativeTo(sourceDir.getParentFile)
  }

  /** It lightens the build file if one wants to give a string instead of file. */
  def directory(sourceDir: String): Seq[(File, String)] = {
    directory(file(sourceDir))
  }

  /** return a Seq of mappings which effect is to add the content of directory in the generated package,
    *  excluding the directory itself */
  def contentOf(sourceDir: File): Seq[(File, String)] = {
    (sourceDir.*** --- sourceDir) pair relativeTo(sourceDir)
  }

  /** It lightens the build file if one wants to give a string instead of file. */
  def contentOf(sourceDir: String): Seq[(File, String)] = {
    contentOf(file(sourceDir))
  }

}

package com.typesafe.sbt
package packager

import sbt._

/** A set of helper methods to simplify the writing of mappings */
object MappingsHelper {

  /** return a Seq of mappings which effect is to add a whole directory in the generated package */
  def directory(sourceDir: File): Seq[(File, String)] = {
    val parentFile = sourceDir.getParentFile
    if (parentFile != null)
      sourceDir.*** pair relativeTo(sourceDir.getParentFile)
    else
      sourceDir.*** pair basic
  }

  /** It lightens the build file if one wants to give a string instead of file. */
  def directory(sourceDir: String): Seq[(File, String)] = {
    directory(file(sourceDir))
  }

  /** return a Seq of mappings which effect is to add the content of directory in the generated package,
    *  excluding the directory itself */
  def contentOf(sourceDir: File): Seq[(File, String)] = {
    (sourceDir.*** --- sourceDir) pair relativeTo(sourceDir)
  }

  /** It lightens the build file if one wants to give a string instead of file. */
  def contentOf(sourceDir: String): Seq[(File, String)] = {
    contentOf(file(sourceDir))
  }
}

issue-161: Fix the case where a directory mapped does not have parent.

It happens when one wants to map a directory from the root of the project.
In that case we use the `basic` mapper on the directory itself.


name := "qdb-spark-connector"
version := "1.0.0-SNAPSHOT"

resolvers += "QuasarDB Maven Repository" at "https://maven.quasardb.net/"

spName := "quasardb/spark-connector"
scalaVersion := "2.11.7"
crossScalaVersions := Seq("2.10.5", "2.11.7")

sparkVersion := "1.5.2"
sparkComponents ++= Seq("streaming", "sql")

organization := "net.quasardb"
organizationName := "QuasarDB"
organizationHomepage := Some(url("https://www.quasardb.net"))

libraryDependencies ++= Seq(
  "net.quasardb" % "qdb" % "2.0.0",
  "org.scalatest" %% "scalatest" % "3.0.4" % "test",
  "com.novocode" % "junit-interface" % "0.9" % "test"
)

name := "qdb-spark-connector"
version := "1.0.0-SNAPSHOT"

resolvers += "QuasarDB Maven Repository" at "https://maven.quasardb.net/"

spName := "quasardb/spark-connector"
scalaVersion := "2.11.7"
crossScalaVersions := Seq("2.10.5", "2.11.7")

sparkVersion := "2.2.0"
sparkComponents ++= Seq("streaming", "sql")

organization := "net.quasardb"
organizationName := "QuasarDB"
organizationHomepage := Some(url("https://www.quasardb.net"))

libraryDependencies ++= Seq(
  "net.quasardb" % "qdb" % "2.0.0",
  "org.scalatest" %% "scalatest" % "3.0.4" % "test",
  "com.novocode" % "junit-interface" % "0.9" % "test"
)

Upgrade spark to latest version

Upgrade spark to latest version


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.3.7"

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.8"

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.8


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.91"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.8",
      "com.ning" % "async-http-client" % "1.9.39",
      "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-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.92"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.8",
      "com.ning" % "async-http-client" % "1.9.39",
      "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.92


enablePlugins(JavaServerAppPackaging)

enablePlugins(DockerPlugin)

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

organization := "io.sdkman"

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

dockerExposedPorts ++= Seq(9000)

Universal / javaOptions ++= 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")

enablePlugins(JavaServerAppPackaging)

enablePlugins(DockerPlugin)

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

organization := "io.sdkman"

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

dockerExposedPorts ++= Seq(9000)

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

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

scalaVersion := "2.12.10"

resolvers ++= Seq(
  Resolver.mavenCentral,
  "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")

Update resolvers to use maven central and jitpack.


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.4"

crossScalaVersions := Seq("2.12.4", "2.11.12", "2.10.6")

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.0.5" % 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.59"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.4"

crossScalaVersions := Seq("2.12.4", "2.11.12", "2.10.6")

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.0.5" % 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.60"

autocommit: Update configuration to record version 0.1.60


//
// Project metadata
//

name := "tempgres-client"

organization := "dk.cwconsult"

version := "1.1-SNAPSHOT"

//
// sbt-pgp settings
//

useGpg := true

//
// This is a Java-only project, so we don't need the scala
// library nor the artifact name mangling.
//

crossPaths := false

autoScalaLibrary := false

//
// Compiler settings
//

javacOptions ++= Seq("-source", "1.7")

//
// Project metadata
//

name := "tempgres-client"

organization := "dk.cwconsult"

version := "1.1-SNAPSHOT"

//
// sbt-pgp settings
//

useGpg := true

//
// This is a Java-only project, so we don't need the scala
// library nor the artifact name mangling.
//

crossPaths := false

autoScalaLibrary := false

//
// Compiler settings
//

javacOptions ++= Seq("-source", "1.7", "-target", "1.7")

Use "-target 1.7" for javac

Use "-target 1.7" for javac


package model

import akka.actor.ActorRef
import domain._
import play.api.Play.current
import play.api.libs.json._
import play.api.libs.ws._

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.util.Success

object Updates {
  var counter:Int = 0
  var startTime:Long = System.currentTimeMillis
  var currentTime:Long = 0

  def instagram(mediaUpdate: Seq[UpdateResponse], clientID: String, actors: List[ActorRef]): Unit = {
    getMedia(mediaUpdate.head.objectId, clientID, actors)
  }

  private def getMedia(objectID: String, clientID: String, actors: List[ActorRef]): Unit = {
      val url = s"https://api.instagram.com/v1/tags/$objectID/media/recent?client_id=$clientID"

      val response: Future[Option[JsValue]] = for {
        response <- WS.url(url).get()
      } yield {
          (response.json \\ "data").flatMap(_ \\ "images").flatMap(_ \\ "standard_resolution").flatMap(_ \\ "url").headOption
        }

      response.onComplete {
        case Success(Some(JsString(image))) => {
          actors foreach { actor =>
            actor ! image
          }
        }
        case _ => println("NO")
      }
  }
}

package model

import akka.actor.ActorRef
import domain._
import play.api.Play.current
import play.api.libs.json._
import play.api.libs.ws._

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.util.Success

object Updates {
  var counter:Int = 0
  var startTime:Long = System.currentTimeMillis
  var currentTime:Long = 0

  def instagram(mediaUpdate: Seq[UpdateResponse], clientID: String, actors: List[ActorRef]): Unit = {
    getMedia(mediaUpdate.head.objectId, clientID, actors)
  }

  private def getMedia(objectID: String, clientID: String, actors: List[ActorRef]): Unit = {
      val url = s"https://api.instagram.com/v1/tags/$objectID/media/recent?client_id=$clientID"

      val response: Future[Option[JsValue]] = for {
        response <- WS.url(url).get()
      } yield {
          (response.json \\ "data").flatMap(_ \\ "images").flatMap(_ \\ "standard_resolution").flatMap(_ \\ "url").headOption
        }

      response.onComplete {
        case Success(Some(JsString(image))) => {
          println(
            s"""
               |+++++++++++++++++++++++++++++++
               |$image
               |
               |
             """.stripMargin)
          actors foreach { actor =>
            actor ! image
          }
        }
        case _ => println("NO")
      }
  }
}

Fix variable to pass to actor

Fix variable to pass to actor


package com.nibado.projects.adventscala

/**
  * Created by nielsdommerholt on 07/12/15.
  */
object AdventOfCode {
  def main(args: Array[String]): Unit = {
    val list = List(new Day01, new Day02)

    list.foreach(r => r.run())
  }
}

package com.nibado.projects.adventscala

object AdventOfCode {
  def main(args: Array[String]): Unit = {
    val list = List(new Day01, new Day02)

    list.foreach(r => r.run())
  }
}

Add Day2 to test set

Add Day2 to test set


package ca.innovativemedicine.vcf.parsers

import scala.util.parsing.combinator.JavaTokenParsers

/**
 * A mix-in for parsers dealing with TSV-like files. This is basically a
 * `JavaTokenParsers`, but with tabs removed from allowed whitespace, and a
 * few convenience methods. This has the parser `tab` which just parses a tab.
 * It also adds 2 identical methods to parsers; `t` and `&`, which can be used
 * to indicate to 2 parsers are separated by a tab. For example, `a & b & c`.
 */
trait TsvParsers extends JavaTokenParsers {

  // Omit tabs from normal whitespace skips.

  override protected val whiteSpace = """[ \n\x0B\f\r]""".r

  protected val tab: Parser[String] = "\\t"

  final class FieldOps[A](a: Parser[A]) {
    def t[B](b: Parser[B]) = (a <~ tab) ~ b
    def &[B](b: Parser[B]) = (a <~ tab) ~ b
  }

  implicit def FieldOps[A](a: Parser[A]) = new FieldOps(a)
}

package ca.innovativemedicine.vcf.parsers

import scala.util.parsing.combinator.JavaTokenParsers

/**
 * A mix-in for parsers dealing with TSV-like files. This is basically a
 * `JavaTokenParsers`, but with tabs removed from allowed whitespace, and a
 * few convenience methods. This has the parser `tab` which just parses a tab.
 * It also adds 2 identical methods to parsers; `t` and `&`, which can be used
 * to indicate to 2 parsers are separated by a tab. For example, `a & b & c`.
 */
trait TsvParsers extends JavaTokenParsers {

  // Omit tabs from normal whitespace skips.

  override protected val whiteSpace = """[ \n\x0B\f\r]""".r

  protected val tab: Parser[String] = "\t"

  final class FieldOps[A](a: Parser[A]) {
    def t[B](b: Parser[B]) = (a <~ tab) ~ b
    def &[B](b: Parser[B]) = (a <~ tab) ~ b
  }

  implicit def FieldOps[A](a: Parser[A]) = new FieldOps(a)
}

Fix bug with tab not being used as separator.


package tabulate.benchmark

import java.io.StringWriter
import java.util.concurrent.TimeUnit

import org.openjdk.jmh.annotations._
import tabulate.ops._

@State(Scope.Thread)
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.MICROSECONDS)
class EncodingBenchmark {
  @Benchmark
  def tabulate() = new StringWriter().writeCsv(rawData, ',').toString

  @Benchmark
  def productCollections() = {
    val out = new StringWriter()
    com.github.marklister.collections.io.Utils.CsvOutput(rawData).writeCsv(out)
    out.toString
  }
}

package tabulate.benchmark

import java.io.{StringWriter, Writer}
import java.util.concurrent.TimeUnit

import org.openjdk.jmh.annotations._
import tabulate.ops._

@State(Scope.Thread)
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.MICROSECONDS)
class EncodingBenchmark {
  def write[A](f: Array[String] => Unit): Unit =
    rawData.foreach { entry => f(Array(entry._1.toString, entry._2.toString, entry._3.toString, entry._4.toString)) }

  @Benchmark
  def tabulate() = new StringWriter().writeCsv(rawData, ',').close()

  @Benchmark
  def productCollections() = {
    val out = new StringWriter()
    com.github.marklister.collections.io.Utils.CsvOutput(rawData).writeCsv(out, ",")
    out.close()
  }

  @Benchmark
  def opencsv() = {
    val out = new StringWriter()
    val writer = new com.opencsv.CSVWriter(out, ',')
    write { a => writer.writeNext(a) }
    writer.close()
    out.close()
  }
}

Add opencsv to the list of libraries benchmarked for output.


enablePlugins(DockerPlugin)
enablePlugins(com.tapad.docker.DockerComposePlugin)

dockerfile in docker := {
  new sbtdocker.mutable.Dockerfile {
    from("mysql/mysql-server:5.7")
    expose(3306)
  }
}

dockerImageCreationTask := docker.value

enablePlugins(DockerPlugin)
enablePlugins(com.tapad.docker.DockerComposePlugin)

dockerfile in docker := {
  new sbtdocker.mutable.Dockerfile {
    from("mysql/mysql-server:5.7.15")
    expose(3306)
  }
}

dockerImageCreationTask := docker.value

Fix MySQL docker image version

Fix MySQL docker image version


package uk.gov.tna.dri.schema

import scalaz._
import Scalaz._
import uk.gov.tna.dri.metadata.Row

case class InRule(inVal: StringProvider) extends Rule {

  override def execute(columnIndex: Int, row: Row, schema: Schema): ValidationNEL[String, Any] = {
    val columnDefinition = schema.columnDefinitions(columnIndex)

    inVal.cellValue(columnIndex, row, schema) match {
      case Left(e) => e.failNel[Any]

      case Right(ruleValue) => {
        val cellValue = row.cells(columnIndex).value

        if (schema.columnDefinitions(columnIndex).contains(IgnoreCase())) {
          if (ruleValue.toLowerCase.contains(cellValue.toLowerCase))
            true.successNel[String]
          else
            s"in: ${ruleValue} fails for line ${row.lineNumber}, column: ${columnDefinition.id}, value: ${cellValue}".failNel[Any]
        } else {
          if (ruleValue.contains(cellValue))
            true.successNel[String]
          else
            s"in: ${ruleValue} fails for line ${row.lineNumber}, column: ${columnDefinition.id}, value: ${cellValue}".failNel[Any]
        }
      }
    }
  }
}

package uk.gov.tna.dri.schema

import scalaz._
import Scalaz._
import uk.gov.tna.dri.metadata.Row

case class InRule(inVal: StringProvider) extends Rule {

  override def execute(columnIndex: Int, row: Row, schema: Schema): ValidationNEL[String, Any] = {
    val columnDefinition = schema.columnDefinitions(columnIndex)

    inVal.cellValue(columnIndex, row, schema) match {
      case Left(e) => e.failNel[Any]

      case Right(ruleValue) => {
        val cellValue = row.cells(columnIndex).value
        val (cv, rv) = if (schema.columnDefinitions(columnIndex).contains(IgnoreCase())) (cellValue.toLowerCase, ruleValue.toLowerCase) else (cellValue, ruleValue)

        if (rv.contains(cv))
          true.successNel[String]
        else
          s"in: ${ruleValue} fails for line ${row.lineNumber}, column: ${columnDefinition.id}, value: ${cellValue}".failNel[Any]
      }
    }
  }
}

 [DA] Clean up of checking "ignore case", but it is still crap.

git-svn-id: d9d935340129e626144eb3fe7cfd050cd27cf88a@4599 6bcde575-cb03-8b4d-b1e0-7a084bef6d9c


/*
 * Copyright 2009-2010 the original author or authors.
 *
 * Licensed 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 ccf.session

import org.specs.Specification

object ChannelIdSpec extends Specification {
  "Random ChannelId" should {
    val clientId = ChannelId.randomId
    "not be equal to another random ChannelId" in {
      clientId must not equalTo(ChannelId.randomId)
    }
  }
}

/*
 * Copyright 2009-2010 the original author or authors.
 *
 * Licensed 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 ccf.session

import org.specs.Specification

object ChannelIdSpec extends Specification {
  "Random ChannelId" should {
    val clientId = ChannelId.randomId
    "not be equal to another random ChannelId" in {
      clientId must not equalTo(ChannelId.randomId)
    }
  }

  "ChannelId" should {
    "encode and decode transport representation of channelId" in {
      val channelId = ChannelId.randomId
      val transportRepresentation = channelId.toString
      ChannelId(transportRepresentation) must equalTo(Some(channelId))
    }
    "return None for invalid representation of channel id" in {
      val invalidId = "not an uuid"
      ChannelId(invalidId) mustBe None
    }
  }
}

session: Add spec for encoding and decoding transport representation of channel id

Signed-off-by: Nuutti Rintala <c1fdae2d91f4b7dda69ea7bf7d9378472e503063@reaktor.fi>


name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.4"

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

version := "0.1.20"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.6.9",
      "org.scalatest" %% "scalatest" % "3.0.5" % 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 := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.4"

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

version := "0.1.21"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.6.9",
      "org.scalatest" %% "scalatest" % "3.0.5" % 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.21


import Common._

val commonSettings = Seq(
  sbtPlugin := true,
  scalaVersion := scalaVersionString,
  organization := organisationString,
  organizationName := organisationNameString,
  scalacOptions := scalaOptionsSeq,
  publishTo.<<=(publishResolver),
  credentials += sbtCredentials,
  licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
  BintrayCredentials.bintrayCredentialsTask
) ++ Seq (
  bintray.Keys.bintrayOrganization := None,
  bintray.Keys.repository := "maven"
) //++ bintrayPublishSettings // Comment this in before pushing to GitHub so it gets automatically built and published to bintray

lazy val microservicesSandbox = project.in(file("microservices-sandbox"))
  .settings(name := "microservices-sandbox")
  .settings(version := "1.1")
  .settings(commonSettings:_*)
  .settings(
    libraryDependencies ++= Seq(
      "commons-io" % "commons-io" % "2.4" withSources() withJavadoc(),
      "com.typesafe" % "config" % "1.2.1" withSources() withJavadoc()
    )
  )
  .settings(publishMavenStyle := true)

lazy val buildDetailsGenerator = project.in(file("build-details-generator"))
  .settings(name := "build-details-generator")
  .settings(version := "1.1")
  .settings(commonSettings:_*)
  .settings(publishMavenStyle := true)

publish := {}

import Common._

val commonSettings = Seq(
  sbtPlugin := true,
  scalaVersion := scalaVersionString,
  organization := organisationString,
  organizationName := organisationNameString,
  scalacOptions := scalaOptionsSeq,
  publishTo.<<=(publishResolver),
  credentials += sbtCredentials,
  licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
  BintrayCredentials.bintrayCredentialsTask,
  bintray.Keys.bintrayOrganization := None
) //++ bintrayPublishSettings // Comment this in before pushing to GitHub so it gets automatically built and published to bintray

lazy val microservicesSandbox = Project("microservices-sandbox", file("microservices-sandbox"))
  .settings(version := "1.1")
  .settings(commonSettings:_*)
  .settings(
    libraryDependencies ++= Seq(
      "commons-io" % "commons-io" % "2.4" withSources() withJavadoc(),
      "com.typesafe" % "config" % "1.2.1" withSources() withJavadoc()
    )
  )

lazy val buildDetailsGenerator = Project("build-details-generator", file("build-details-generator"))
  .settings(version := "1.1")
  .settings(commonSettings:_*)

publish := {}

Make bintray plugin publish to a ivy repository instead of maven


androidBuildAar

autoScalaLibrary := false

githubProject := "donutprogress"

javacOptions ++=
    "-source" :: "1.7" ::
    "-target" :: "1.7" ::
    Nil

libraryDependencies ++=
    "com.android.support" % "appcompat-v7" % "23.2.0" ::
    Nil

minSdkVersion := "7"

name := "DonutProgress"

normalizedName := "donut-progress"

organization := "io.taig.android"

platformTarget := "android-23"

publishArtifact in ( Compile, packageDoc ) := false

scalaVersion := "2.11.7"

scalacOptions ++=
    "-deprecation" ::
    "-feature" ::
    Nil

targetSdkVersion := "23"

typedResources := false

version := "1.0.3"

androidBuildAar

autoScalaLibrary := false

githubProject := "donutprogress"

javacOptions ++=
    "-source" :: "1.7" ::
    "-target" :: "1.7" ::
    Nil

libraryDependencies ++=
    "com.android.support" % "appcompat-v7" % "23.2.1" ::
    Nil

minSdkVersion := "7"

name := "DonutProgress"

normalizedName := "donut-progress"

organization := "io.taig.android"

platformTarget := "android-23"

publishArtifact in ( Compile, packageDoc ) := false

scalacOptions ++=
    "-deprecation" ::
    "-feature" ::
    Nil

targetSdkVersion := "23"

typedResources := false

version := "1.0.3"

Upgrade to android support library 23.2.1


name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

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

version := "0.2.4"

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.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")
  }
}

autocommit: Update configuration to record version 0.3.0


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.1.68"

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.1.69"

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.1.69


sbtPlugin := true

organization := "com.typesafe.sbt"

name := "sbt-mocha"

version := "1.0.3-SNAPSHOT"

scalaVersion := "2.10.4"

resolvers ++= Seq(
    "Typesafe Releases Repository" at "http://repo.typesafe.com/typesafe/releases/",
    Resolver.url("sbt snapshot plugins", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns),
    Resolver.sonatypeRepo("snapshots"),
    "Typesafe Snapshots Repository" at "http://repo.typesafe.com/typesafe/snapshots/",
    Resolver.mavenLocal
    )

libraryDependencies ++= Seq(
  "org.webjars" % "mocha" % "1.17.1"
)

addSbtPlugin("com.typesafe.sbt" % "sbt-js-engine" % "1.0.0")

publishMavenStyle := false

publishTo := {
  if (isSnapshot.value) Some(Classpaths.sbtPluginSnapshots)
  else Some(Classpaths.sbtPluginReleases)
}

scriptedSettings

scriptedLaunchOpts <+= version apply { v => s"-Dproject.version=$v" }

scriptedLaunchOpts += "-XX:MaxPermSize=256m"

sbtPlugin := true

organization := "com.typesafe.sbt"

name := "sbt-mocha"

version := "1.0.3-SNAPSHOT"

scalaVersion := "2.10.4"

libraryDependencies ++= Seq(
  "org.webjars" % "mocha" % "1.17.1"
)

addSbtPlugin("com.typesafe.sbt" % "sbt-js-engine" % "1.1.1")

publishMavenStyle := false

publishTo := {
  if (isSnapshot.value) Some(Classpaths.sbtPluginSnapshots)
  else Some(Classpaths.sbtPluginReleases)
}

scriptedSettings

scriptedLaunchOpts <+= version apply { v => s"-Dproject.version=$v" }

scriptedLaunchOpts += "-XX:MaxPermSize=256m"

Upgrade spray-json to fix bincompat issues


/**
 * Copyright (C) 2012 Typesafe, Inc. <http://www.typesafe.com>
 */

import sbt._
import sbt.Keys._

object ZincBuild extends Build {
  val sbtVersion = "0.12.0-RC2"

  lazy val buildSettings = Defaults.defaultSettings ++ Seq(
    organization := "com.typesafe.zinc",
    version := "0.1.0-SNAPSHOT",
    scalaVersion := "2.9.2",
    crossPaths := false
  )

  lazy val zinc = Project(
    "zinc",
    file("."),
    settings = buildSettings ++ Version.settings ++ Publish.settings ++ Seq(
      resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
      resolvers += "Typesafe Third-party" at "http://repo.typesafe.com/typesafe/third-party",
      libraryDependencies ++= Seq(
        "com.typesafe.sbt" % "incremental-compiler" % sbtVersion,
        "com.typesafe.sbt" % "compiler-interface" % sbtVersion classifier "sources",
        "jline" % "jline" % "1.0" % "optional",
        "com.martiansoftware" % "nailgun" % "0.7.1" % "optional"
      )
    )
  )

  lazy val dist = Project(
    id = "dist",
    base = file("dist"),
    settings = buildSettings ++ Dist.settings
  )
}

/**
 * Copyright (C) 2012 Typesafe, Inc. <http://www.typesafe.com>
 */

import sbt._
import sbt.Keys._

object ZincBuild extends Build {
  val sbtVersion = "0.12.0-RC3"

  lazy val buildSettings = Defaults.defaultSettings ++ Seq(
    organization := "com.typesafe.zinc",
    version := "0.1.0-SNAPSHOT",
    scalaVersion := "2.9.2",
    crossPaths := false
  )

  lazy val zinc = Project(
    "zinc",
    file("."),
    settings = buildSettings ++ Version.settings ++ Publish.settings ++ Seq(
      resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
      resolvers += "Typesafe Third-party" at "http://repo.typesafe.com/typesafe/third-party",
      libraryDependencies ++= Seq(
        "com.typesafe.sbt" % "incremental-compiler" % sbtVersion,
        "com.typesafe.sbt" % "compiler-interface" % sbtVersion classifier "sources",
        "jline" % "jline" % "1.0" % "optional",
        "com.martiansoftware" % "nailgun" % "0.7.1" % "optional"
      )
    )
  )

  lazy val dist = Project(
    id = "dist",
    base = file("dist"),
    settings = buildSettings ++ Dist.settings
  )
}

Update to republished sbt 0.12.0-RC3

Update to republished sbt 0.12.0-RC3


name := "play-scala"

version := "1.0-SNAPSHOT"

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

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  "com.foomoo.abc" %% "abc-domain" % "0.2-SNAPSHOT",
  "com.foomoo.abc" %% "abc-parser" % "0.2-SNAPSHOT",
  "com.foomoo.abc" %% "abc-app" % "0.2-SNAPSHOT",
  "com.foomoo.string-store" % "string-store-service-api" % "0.2-SNAPSHOT",
  "com.foomoo.string-store" % "string-store-service-provider-mongo" % "0.2-SNAPSHOT",
  "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test,
  "commons-cli" % "commons-cli" % "1.2"
)

sources in (Compile, doc) := Seq.empty

publishArtifact in (Compile, packageDoc) := false

name := "play-scala"

version := "1.0-SNAPSHOT"

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

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  "com.foomoo.abc" %% "abc-domain" % "0.2",
  "com.foomoo.abc" %% "abc-parser" % "0.2",
  "com.foomoo.abc" %% "abc-app" % "0.2",
  "com.foomoo.string-store" % "string-store-service-api" % "0.2",
  "com.foomoo.string-store" % "string-store-service-provider-mongo" % "0.2",
  "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test,
  "commons-cli" % "commons-cli" % "1.2"
)

sources in (Compile, doc) := Seq.empty

publishArtifact in (Compile, packageDoc) := false

Use released versions of abc libraries and string-store.


name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.7.1",
      "org.apache.commons" % "commons-compress" % "1.18",
      "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.4.0"

name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.7.1",
      "org.apache.commons" % "commons-compress" % "1.18",
      "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.4.1"

autocommit: Update configuration to record version 0.4.1


name := "proxy"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(commonSettings: _*)
  .settings(
    libraryDependencies ++= Seq(
      filters,
      ws,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.1",
      "org.yaml" % "snakeyaml" % "1.17",
      "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0" % "test"
    )
  )

val credsToUse = Option(System.getenv("ARTIFACTORY_USERNAME")) match {
  case None => Credentials(Path.userHome / ".ivy2" / ".artifactory")
  case _ => Credentials("Artifactory Realm","flow.artifactoryonline.com",System.getenv("ARTIFACTORY_USERNAME"),System.getenv("ARTIFACTORY_PASSWORD"))
}

lazy val commonSettings: Seq[Setting[_]] = Seq(
  name <<= name("proxy-" + _),
  scalacOptions += "-feature",
  sources in (Compile,doc) := Seq.empty,
  publishArtifact in (Compile, packageDoc) := false,
  credentials += credsToUse,
  resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
  resolvers += "Artifactory" at "https://flow.artifactoryonline.com/flow/libs-release/"
)
version := "0.0.11"

name := "proxy"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(commonSettings: _*)
  .settings(
    libraryDependencies ++= Seq(
      filters,
      ws,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.1",
      "org.yaml" % "snakeyaml" % "1.17",
      "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0" % "test"
    )
  )

val credsToUse = Option(System.getenv("ARTIFACTORY_USERNAME")) match {
  case None => Credentials(Path.userHome / ".ivy2" / ".artifactory")
  case _ => Credentials("Artifactory Realm","flow.artifactoryonline.com",System.getenv("ARTIFACTORY_USERNAME"),System.getenv("ARTIFACTORY_PASSWORD"))
}

lazy val commonSettings: Seq[Setting[_]] = Seq(
  name <<= name("proxy-" + _),
  scalacOptions += "-feature",
  sources in (Compile,doc) := Seq.empty,
  publishArtifact in (Compile, packageDoc) := false,
  credentials += credsToUse,
  resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
  resolvers += "Artifactory" at "https://flow.artifactoryonline.com/flow/libs-release/"
)
version := "0.0.12"

autocommit: Update configuration to record version 0.0.12


package com.getbootstrap.lmvtfy.github

import spray.json.{JsonFormat, DefaultJsonProtocol}
import spray.httpx.SprayJsonSupport

case class GitHubUser(login: String)
case class IssueOrComment(
  body: String,
  user: GitHubUser
)
case class IssueOrCommentEvent(
  action: String, // issue_comment: "opened", "closed", "reopened"; issue: "created"
  //comment: Option[IssueOrComment],
  issue: IssueOrComment
)

object GitHubJsonProtocol extends DefaultJsonProtocol with SprayJsonSupport {
  implicit val gitHubUserFormat = jsonFormat1(GitHubUser.apply)
  implicit val issueOrCommentFormat = jsonFormat2(IssueOrComment.apply)
  implicit val issueOrCommentEventFormat = jsonFormat2(IssueOrCommentEvent.apply)
}

package com.getbootstrap.lmvtfy.github

import spray.json.{JsonFormat, DefaultJsonProtocol}
import spray.httpx.SprayJsonSupport

case class GitHubUser(login: String)
case class IssueOrComment(
  body: String,
  user: GitHubUser
)
case class IssueOrCommentEvent(
  action: String, // issue_comment: "opened", "closed", "reopened"; issue: "created"
  comment: Option[IssueOrComment],
  issue: IssueOrComment
)

object GitHubJsonProtocol extends DefaultJsonProtocol with SprayJsonSupport {
  implicit val gitHubUserFormat = jsonFormat1(GitHubUser.apply)
  implicit val issueOrCommentFormat = jsonFormat2(IssueOrComment.apply)
  implicit val issueOrCommentEventFormat = jsonFormat3(IssueOrCommentEvent.apply)
}

Revert "TEMPORARY: see whether the Option is screwing things up"

This reverts commit fb0637431cd6e95d6354b07f661bb8c4a1d280cb.


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.11"

crossScalaVersions := Seq("2.11.11")

version := "0.4.4"

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.11"

crossScalaVersions := Seq("2.11.11")

version := "0.4.5"

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.5


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.13" % 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.3.5"

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.13" % 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.3.6"

autocommit: Update configuration to record version 0.3.6


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

crossScalaVersions := Seq("2.12.7")

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.12"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

crossScalaVersions := Seq("2.12.7")

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.13"

autocommit: Update configuration to record version 0.2.13


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.6"

version := "0.1.77"

exportJars := true

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

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")
  }
}

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.6"

version := "0.1.78"

exportJars := true

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

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.1.78


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"

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.40"

autocommit: Update configuration to record version 0.2.40


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.96"

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.39",
      "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.0.97"

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.39",
      "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.0.97


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.26"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.1",
      "com.ning" % "async-http-client" % "1.9.36",
      "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.8"

version := "0.0.27"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.1",
      "com.ning" % "async-http-client" % "1.9.36",
      "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.27


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "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")
  }
}
version := "0.0.3"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "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")
  }
}
version := "0.0.4"

autocommit: Update configuration to record version 0.0.4


name := "rros-protocol"

organization := "rros"

version := "1.0"

scalaVersion := "2.11.5"

assemblyJarName in assembly := "rros.jar"

mainClass in assembly := Some("rros.App")

libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.9"

libraryDependencies += "org.json4s" %% "json4s-jackson" % "3.2.10"

//libraryDependencies += "com.typesafe.play" %% "play" % "2.3.8"
//only for testing client - lots of bugs
//libraryDependencies += "io.backchat.hookup" %% "hookup" % "0.3.0"

name := "rros-protocol"

organization := "rros"

version := "1.0"

scalaVersion := "2.11.6"

assemblyJarName in assembly := "rros.jar"

mainClass in assembly := Some("rros.App")

libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.9"

libraryDependencies += "org.json4s" %% "json4s-jackson" % "3.2.10"

//libraryDependencies += "com.typesafe.play" %% "play" % "2.3.8"
//only for testing client - lots of bugs
//libraryDependencies += "io.backchat.hookup" %% "hookup" % "0.3.0"

Convert scala 2.11.5 -> 2.11.6

Convert scala 2.11.5 -> 2.11.6


import scala.util.Try
import scoverage.ScoverageSbtPlugin.ScoverageKeys._

name         := "silky-persistence"
organization := "com.github.piltt"
version      := Try(sys.env("BUILD_NUMBER")).map("1.0." + _).getOrElse("1.0-SNAPSHOT")

scalaVersion := "2.10.6"
crossScalaVersions := Seq("2.10.6", "2.11.7")

javacOptions  ++= Seq("-Xms512m", "-Xmx512m", "-Xss4m")
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-language:implicitConversions")

coverageHighlighting := false
graphSettings

import scala.util.Try
import scoverage.ScoverageSbtPlugin.ScoverageKeys._

name         := "silky-persistence"
organization := "com.github.piltt"
version      := Try(sys.env("BUILD_NUMBER")).map("1.0." + _).getOrElse("1.0-SNAPSHOT")

scalaVersion := "2.11.7"
crossScalaVersions := Seq("2.10.6", "2.11.7")

javacOptions  ++= Seq("-Xms512m", "-Xmx512m", "-Xss4m")
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-language:implicitConversions")

coverageHighlighting := false
graphSettings

Set Scala version to 2.11.7

Set Scala version to 2.11.7


ThisBuild / fork in Test := true

ThisBuild / scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings")

ThisBuild / organization := "com.socrata"

ThisBuild / resolvers += "socrata" at "https://repo.socrata.com/artifactory/libs-release"

val commonPG = project in file("common-pg")

val storePG = (project in file("store-pg")).
  dependsOn(commonPG % "test->test;compile->compile")

val soqlServerPG = (project in file("soql-server-pg")).
  dependsOn(storePG % "test->test;compile->compile")

disablePlugins(AssemblyPlugin)

releaseProcess -= ReleaseTransformations.publishArtifacts

ThisBuild / fork in Test := true

ThisBuild / scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings")

ThisBuild / organization := "com.socrata"

ThisBuild / resolvers += "socrata" at "https://repo.socrata.com/artifactory/libs-release"

val commonPG = project in file("common-pg")

val storePG = (project in file("store-pg")).
  dependsOn(commonPG % "compile;test->test")

val soqlServerPG = (project in file("soql-server-pg")).
  dependsOn(commonPG, storePG % "test->test")

disablePlugins(AssemblyPlugin)

releaseProcess -= ReleaseTransformations.publishArtifacts

Make inter-subproject dependencies more precise

They share test code rather promiscuously, but main code is a
straightforward "common is used by both other projects"


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

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.21"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.9",
      "org.scalatest" %% "scalatest" % "3.0.1" % 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.22"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.9",
      "org.scalatest" %% "scalatest" % "3.0.1" % 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.22


name := "proxy"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .enablePlugins(NewRelic)
  .settings(commonSettings: _*)
  .settings(
    libraryDependencies ++= Seq(
      filters,
      ws,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.1",
      "org.yaml" % "snakeyaml" % "1.17",
      "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0" % "test"
    )
  )

val credsToUse = Option(System.getenv("ARTIFACTORY_USERNAME")) match {
  case None => Credentials(Path.userHome / ".ivy2" / ".artifactory")
  case _ => Credentials("Artifactory Realm","flow.artifactoryonline.com",System.getenv("ARTIFACTORY_USERNAME"),System.getenv("ARTIFACTORY_PASSWORD"))
}

lazy val commonSettings: Seq[Setting[_]] = Seq(
  name <<= name("proxy-" + _),
  scalacOptions += "-feature",
  sources in (Compile,doc) := Seq.empty,
  publishArtifact in (Compile, packageDoc) := false,
  credentials += credsToUse,
  resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
  resolvers += "Artifactory" at "https://flow.artifactoryonline.com/flow/libs-release/"
)
version := "0.0.13"

name := "proxy"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .enablePlugins(NewRelic)
  .settings(commonSettings: _*)
  .settings(
    libraryDependencies ++= Seq(
      filters,
      ws,
      "com.jason-goodwin" %% "authentikat-jwt" % "0.4.1",
      "org.yaml" % "snakeyaml" % "1.17",
      "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0" % "test"
    )
  )

val credsToUse = Option(System.getenv("ARTIFACTORY_USERNAME")) match {
  case None => Credentials(Path.userHome / ".ivy2" / ".artifactory")
  case _ => Credentials("Artifactory Realm","flow.artifactoryonline.com",System.getenv("ARTIFACTORY_USERNAME"),System.getenv("ARTIFACTORY_PASSWORD"))
}

lazy val commonSettings: Seq[Setting[_]] = Seq(
  name <<= name("proxy-" + _),
  scalacOptions += "-feature",
  sources in (Compile,doc) := Seq.empty,
  publishArtifact in (Compile, packageDoc) := false,
  credentials += credsToUse,
  resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
  resolvers += "Artifactory" at "https://flow.artifactoryonline.com/flow/libs-release/"
)
version := "0.0.14"

autocommit: Update configuration to record version 0.0.14


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.7"

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.8"

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.8


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.4"

crossScalaVersions := Seq("2.12.4", "2.11.12", "2.10.6")

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.0.5" % 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.53"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.4"

crossScalaVersions := Seq("2.12.4", "2.11.12", "2.10.6")

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.0.5" % 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.54"

autocommit: Update configuration to record version 0.1.54


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.3.3"

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.4"

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.4


name := """vessel-webapp"""

version := "0.1-SNAPSHOT"

scalaVersion := "2.11.4"

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

resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

libraryDependencies ++= Seq(
  "com.google.inject" % "guice" % "3.0",
  "javax.inject" % "javax.inject" % "1",
  "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23",
  "org.webjars" % "bootstrap" % "3.3.1",
  "org.webjars" % "angularjs" % "1.3.8",
  "org.webjars" % "angular-ui-bootstrap" % "0.12.0",
  "org.mockito" % "mockito-core" % "1.10.17" % "test")

name := """vessel-webapp"""

version := "0.1-SNAPSHOT"

scalaVersion := "2.11.4"

scalacOptions += "-target:jvm-1.7"

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

resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

libraryDependencies ++= Seq(
  "com.google.inject" % "guice" % "3.0",
  "javax.inject" % "javax.inject" % "1",
  "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23",
  "org.webjars" % "bootstrap" % "3.3.1",
  "org.webjars" % "angularjs" % "1.3.8",
  "org.webjars" % "angular-ui-bootstrap" % "0.12.0",
  "org.mockito" % "mockito-core" % "1.10.17" % "test")

Set target JVM to 1.7

Set target JVM to 1.7


name := "play-webpack-react"

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayJava, SbtWeb)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
)

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator

pipelineStages := Seq(webpack, digest, gzip)

name := "play-webpack-react"

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayJava, SbtWeb)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
)

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator

val webpackDev = taskKey[Unit]("webpack-dev")

webpackDev := {
  val rc = Process("npm run build", file(".")).!
  if (rc != 0) {
    sys.error(s"NPM generated non-zero return code: $rc")
  }
  println("webpackDev")
}

run in Compile <<= (run in Compile) dependsOn webpackDev

pipelineStages := Seq(webpack, digest, gzip)

Add webpackDev task for run

Add webpackDev task for run


import Dependencies._

lazy val root = (project in file(".")).
  settings(
    inThisBuild(List(
      organization := "edu.colorado.plv",
      scalaVersion := "2.12.1",
      version      := "0.1.0-SNAPSHOT"
    )),
    name := "cuanto",
    libraryDependencies ++= Seq(
      scalaParserCombinators,
      scalaTest % Test,
      scalaCheck % Test
    )
  )

import Dependencies._

lazy val root = (project in file(".")).
  settings(
    inThisBuild(List(
      // Scalac
      scalacOptions ++= Seq(
        "-language:implicitConversions",
        "-Xlint",
        "-Xfuture", // future language features
        //"-Xfatal-warnings", // fail on warnings
        "-encoding", "UTF-8", // check encoding
        "-feature", // warn on features that should be imported explicitly
        "-explaintypes", // explain type errors in more detail
        "-deprecation", // warn on deprecated APIs
        "-unchecked", // detailed erasure warnings
        "-Ywarn-adapted-args", // warn if an argument list is modified to match the receiver
        "-Ywarn-inaccessible", // warn about inaccessible types in method signatures
        "-Ywarn-infer-any", // warn when a type argument is inferred to be `Any`
        "-Ywarn-nullary-override", // warn when non-nullary `def f()' overrides nullary `def f'
        "-Ywarn-nullary-unit", // warn when nullary methods return Unit
        "-Ywarn-numeric-widen", // warn when numerics are widened
        "-Ywarn-unused", // warn when local and private vals, vars, defs, and types are unused
        "-Ywarn-unused-import", // warn when imports are unused
        "-Ywarn-value-discard" // warn when non-Unit expression results are unused
      ),

      // Scaladoc
      autoAPIMappings := true,

      organization := "edu.colorado.plv",
      scalaVersion := "2.12.1",
      version      := "0.1.0-SNAPSHOT"
    )),

    // Dependencies
    libraryDependencies ++= Seq(
      scalaParserCombinators,
      scalaTest % Test,
      scalaCheck % Test
    ),

    // Name
    name := "cuanto"
  )

Set scalac to warn more

Set scalac to warn more


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.77"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.5",
      "com.ning" % "async-http-client" % "1.9.39",
      "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-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.78"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.5.5",
      "com.ning" % "async-http-client" % "1.9.39",
      "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.78


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "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")
  }
}
version := "0.1.3"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "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")
  }
}
version := "0.1.4"

autocommit: Update configuration to record version 0.1.4


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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.11"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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.12"

autocommit: Update configuration to record version 0.1.12


package org.softwaremill.clippy

sealed trait CompilationError
case class TypeMismatchError(found: String, required: String) extends CompilationError

object CompilationErrorParser {
  private val FoundRegexp = """found\s*:\s*([^\n]+)\n""".r
  private val RequiredRegexp = """required:\s*(.+)""".r

  def parse(error: String): Option[CompilationError] = {
    if (error.startsWith("type mismatch")) {
      for {
        found <- FoundRegexp.findFirstMatchIn(error)
        required <- RequiredRegexp.findFirstMatchIn(error)
      } yield TypeMismatchError(found.group(1), required.group(1))
    }
    else None
  }
}

package org.softwaremill.clippy

sealed trait CompilationError
case class TypeMismatchError(found: String, required: String) extends CompilationError

object CompilationErrorParser {
  private val FoundRegexp = """found\s*:\s*([^\n]+)\n""".r
  private val RequiredRegexp = """required\s*:\s*(.+)""".r

  def parse(error: String): Option[CompilationError] = {
    if (error.startsWith("type mismatch")) {
      for {
        found <- FoundRegexp.findFirstMatchIn(error)
        required <- RequiredRegexp.findFirstMatchIn(error)
      } yield TypeMismatchError(found.group(1), required.group(1))
    }
    else None
  }
}

Allow optional spaces in pattern

Allow optional spaces in pattern


name := "streamz-common"

libraryDependencies += "org.scalaz.stream" %% "scalaz-stream" % Version.scalazStream

name := "streamz-util"

libraryDependencies += "org.scalaz.stream" %% "scalaz-stream" % Version.scalazStream

Change module name to streamz-util

Change module name to streamz-util


package hmda.validation.rules.lar.validity

import hmda.model.fi.lar.LoanApplicationRegister
import hmda.validation.dsl.Result
import hmda.validation.rules.EditCheck

object V470 extends EditCheck[LoanApplicationRegister] {

  def apply(lar: LoanApplicationRegister): Result = {
    val applicant = lar.applicant
    when(applicant.race1 is containedIn(1 to 5)) {
      (validRace(applicant.race2) is equalTo(true)) and
        (validRace(applicant.race3) is equalTo(true)) and
        (validRace(applicant.race4) is equalTo(true)) and
        (validRace(applicant.race5) is equalTo(true))
    }
  }

  private def validRace(input: String): Boolean = {
    (input == "") || inRange(1 to 5, input)
  }

  private def inRange(domain: Seq[Int], input: String): Boolean = {
    try {
      val x = input.toInt
      domain.contains(x)
    } catch {
      case ex: NumberFormatException => false
    }
  }

  def name: String = "V470"

}

package hmda.validation.rules.lar.validity

import hmda.model.fi.lar.LoanApplicationRegister
import hmda.validation.dsl.Result
import hmda.validation.rules.EditCheck
import scala.util.Try

object V470 extends EditCheck[LoanApplicationRegister] {

  def apply(lar: LoanApplicationRegister): Result = {
    val applicant = lar.applicant
    when(applicant.race1 is containedIn(1 to 5)) {
      (validRace(applicant.race2) is equalTo(true)) and
        (validRace(applicant.race3) is equalTo(true)) and
        (validRace(applicant.race4) is equalTo(true)) and
        (validRace(applicant.race5) is equalTo(true))
    }
  }

  private def validRace(input: String): Boolean = {
    (input == "") || inRange(1 to 5, input).getOrElse(false)
  }

  private def inRange(domain: Seq[Int], input: String): Try[Boolean] = {
    Try(domain.contains(input.toInt))
  }

  def name: String = "V470"

}

Handle toInt exception using Try

Handle toInt exception using Try

Previously, the inRange method used a try...catch construction to handle
failures parsing a race value from string to int. That way doesn't take
advantage of Scala's more elegant and idiomatic syntax for trying an
operation that might fail.

Now using Try and getOrElse to simply return false if toInt fails.


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Update sbt-wartremover, wartremover to 3.0.7


resolvers += Resolver.url(
  "bintray-sbt-plugin-releases",
   url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

resolvers += "maven" at "http://repo1.maven.org/maven2/"

resolvers += Classpaths.sbtPluginReleases

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.1")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.20")

resolvers += Resolver.url(
  "bintray-sbt-plugin-releases",
   url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

resolvers += "maven" at "http://repo1.maven.org/maven2/"

resolvers += Classpaths.sbtPluginReleases

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC5")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.1")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.20")

Add coursier plugin to speed up build

Add coursier plugin to speed up build

Summary: Problem/Solution:

Use coursier sbt plugin for a better Artifact Fetching, reduce sbt build time.

Result:

Build time down to 40 mins on average now.

JIRA Issues: CSL-4742

Differential Revision: https://phabricator.twitter.biz/D64117


package com.softwaremill.react.kafka

import akka.stream.actor.{ActorPublisher, ActorPublisherMessage}
import kafka.consumer.{ConsumerTimeoutException, KafkaConsumer}
import kafka.serializer.Decoder

import scala.util.{Failure, Success, Try}
private[kafka] class KafkaActorPublisher[T](consumer: KafkaConsumer, decoder: Decoder[T]) extends ActorPublisher[T] {

  val iterator = consumer.iterator()

  override def receive = {
    case ActorPublisherMessage.Request(_) => read()
    case ActorPublisherMessage.Cancel | ActorPublisherMessage.SubscriptionTimeoutExceeded => cleanupResources()
  }

  private def read() {
    if (totalDemand < 0 && isActive)
      onError(new IllegalStateException("3.17: Overflow"))
    else readDemandedItems()
  }

  private def tryReadingSingleElement() = {
    Try(iterator.next().message()).map(bytes => Some(decoder.fromBytes(bytes))).recover {
      // We handle timeout exceptions as normal 'end of the queue' cases
      case _: ConsumerTimeoutException => None
    }
  }

  private def readDemandedItems() {
    var maybeMoreElements = true
    while (isActive && totalDemand > 0 && maybeMoreElements) {
      tryReadingSingleElement() match {
        case Success(None) => maybeMoreElements = false // No more elements
        case Success(valueOpt) =>
          valueOpt.foreach(element => onNext(element))
          maybeMoreElements = true
        case Failure(ex) => onError(ex)
      }
    }

  }
  private def cleanupResources() {
    consumer.close()
  }
}

package com.softwaremill.react.kafka

import akka.stream.actor.{ActorPublisher, ActorPublisherMessage}
import kafka.consumer.{ConsumerTimeoutException, KafkaConsumer}
import kafka.serializer.Decoder

import scala.util.{Failure, Success, Try}
private[kafka] class KafkaActorPublisher[T](consumer: KafkaConsumer, decoder: Decoder[T]) extends ActorPublisher[T] {

  val iterator = consumer.iterator()

  override def receive = {
    case ActorPublisherMessage.Request(_) => read()
    case ActorPublisherMessage.Cancel | ActorPublisherMessage.SubscriptionTimeoutExceeded => cleanupResources()
  }

  private def read() {
    if (totalDemand < 0 && isActive)
      onError(new IllegalStateException("3.17: Overflow"))
    else readDemandedItems()
  }

  private def tryReadingSingleElement() = {
    Try(iterator.next().message()).map(bytes => Some(decoder.fromBytes(bytes))).recover {
      // We handle timeout exceptions as normal 'end of the queue' cases
      case _: ConsumerTimeoutException => None
    }
  }

  private def readDemandedItems() {
    var maybeMoreElements = true
    while (isActive && totalDemand > 0 && maybeMoreElements) {
      tryReadingSingleElement() match {
        case Success(None) => maybeMoreElements = false // No more elements
        case Success(valueOpt) =>
          valueOpt.foreach(element => onNext(element))
          maybeMoreElements = true
        case Failure(ex) => onError(ex)
      }
    }

  }
  private def cleanupResources() {
    consumer.close()
    context.stop(self)
  }
}

Stop publisher actor when stream gets closed