package org.moe.parser

import org.scalatest.FunSuite
import org.scalatest.BeforeAndAfter

import org.moe.runtime._
import org.moe.interpreter._
import org.moe.ast._
import org.moe.parser._

class SimpleExpressionTestSuite extends FunSuite with BeforeAndAfter with ParserTestUtils {

  test("... literal int addition") {
    val ast = basicAST(Parser.parseStuff("2+2"))
    println(Serializer.toJSON(ast))
    // Interpreter.eval(runtime, runtime.getRootEnv, ast)
  // }
    // val result = interpretCode("2 + 2")
    // assert(result.asInstanceOf[MoeIntObject].getNativeValue === 4)
  }

}

package org.moe.parser

import org.scalatest.FunSuite
import org.scalatest.BeforeAndAfter
import org.scalatest.matchers.ShouldMatchers

import org.moe.runtime._
import org.moe.interpreter._
import org.moe.ast._
import org.moe.parser._

class SimpleExpressionTestSuite extends FunSuite with BeforeAndAfter with ParserTestUtils with ShouldMatchers {

  test("... literal int addition") {
    val result = interpretCode("2+2")
    result.asInstanceOf[MoeIntObject].getNativeValue should equal (4)
  }

}

Update test to actually interpret and fix style


package com.ponkotuy.proxy

import com.github.theon.uri.Uri
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.{http, Service, Http}
import com.twitter.util.{Future, Await}
import org.jboss.netty.handler.codec.http.{HttpMethod, HttpResponse, HttpRequest}
import com.ponkotuy.intercept.{Intercepter, PassThrough}

/** Proxy by Finagle
  *
  * @param hosts: Hosts. Require Port Number(hostname:80 etc...)
  * @param port: Server Port.
  * @param inter: com.ponkotuy.intercept.Intercepter
  */
class FinagleProxy(hosts: String, port: Int, inter: Intercepter = new PassThrough) {
  val client = ClientBuilder()
    .codec(http.Http())
    .hosts(hosts)
    .hostConnectionLimit(4).build()

  val service = new Service[HttpRequest, HttpResponse] {
    def apply(req: HttpRequest): Future[HttpResponse] = {
      val res = if(req.getMethod == HttpMethod.POST) {
        val uri = Uri.parseUri(req.getUri)
        req.setUri(uri.pathRaw)
        client.apply(req)
      } else {
        client.apply(req)
      }
      res.foreach(rs => inter.input(req, rs))
      res
    }
  }
  val server = Http.serve(s":$port", service)

  def start(): Unit = {
    Await.ready(server)
  }
}

package com.ponkotuy.proxy

import com.github.theon.uri.Uri
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.{http, Service, Http}
import com.twitter.util.{Future, Await}
import org.jboss.netty.handler.codec.http.{HttpMethod, HttpResponse, HttpRequest}
import com.ponkotuy.intercept.{Intercepter, PassThrough}
import com.twitter.conversions.storage._

/** Proxy by Finagle
  *
  * @param hosts: Hosts. Require Port Number(hostname:80 etc...)
  * @param port: Server Port.
  * @param inter: com.ponkotuy.intercept.Intercepter
  */
class FinagleProxy(hosts: String, port: Int, inter: Intercepter = new PassThrough) {
  val client = ClientBuilder()
    .codec(http.Http().maxRequestSize(128.megabytes))
    .codec(http.Http().maxResponseSize(128.megabytes))
    .hosts(hosts)
    .hostConnectionLimit(4).build()

  val service = new Service[HttpRequest, HttpResponse] {
    def apply(req: HttpRequest): Future[HttpResponse] = {
      val res = if(req.getMethod == HttpMethod.POST) {
        val uri = Uri.parseUri(req.getUri)
        req.setUri(uri.pathRaw)
        client.apply(req)
      } else {
        client.apply(req)
      }
      res.foreach(rs => inter.input(req, rs))
      res
    }
  }
  val server = Http.serve(s":$port", service)

  def start(): Unit = {
    Await.ready(server)
  }
}

Fix Over Http Content Length

Fix Over Http Content Length


package recursion.cons.alldifferent

import plm.universe.bat.BatTest
import plm.universe.cons.RecList
import plm.universe.cons.ConsEntity

class ScalaButLastEntity extends ConsEntity {

  override def run(t: BatTest) {
    val parameter: List[Int] = RecList.fromArraytoScalaList(t.getParameter(0).asInstanceOf[Array[Int]])
    t.setResult( butLast(parameter) )
  }

  /* BEGIN TEMPLATE */
  def butLast(l:List[Int]): List[Int] = {
  /* BEGIN SOLUTION */
    l match {
      case a::Nil => Nil
      case a::b   => a::butLast(b)
    }
  /* END SOLUTION */
  }
  /* END TEMPLATE */
}

package recursion.cons.alldifferent

import plm.universe.bat.BatTest
import plm.universe.cons.RecList
import plm.universe.cons.ConsEntity

class ScalaButLastEntity extends ConsEntity {

  override def run(t: BatTest) {
    val parameter: List[Int] = RecList.fromArraytoScalaList(t.getParameter(0).asInstanceOf[Array[Int]])
    t.setResult( butLast(parameter) )
  }

  /* BEGIN TEMPLATE */
  def butLast(l:List[Int]): List[Int] = {
  /* BEGIN SOLUTION */
    l match {
      case a::Nil => Nil
      case a::b   => a::butLast(b)
      case _ => Nil
    }
  /* END SOLUTION */
  }
  /* END TEMPLATE */
}

Fix warning in Scala entity of exercise 'ButLast'


name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

version := "0.3.19"

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

name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

version := "0.3.20"

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

autocommit: Update configuration to record version 0.3.20


import com.github.retronym.SbtOneJar._
import sbt.Credentials

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

version := "0.2.4"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "io.flow" %% "lib-util" % "0.1.2",
      "io.flow" %% "apibuilder-validation" % "0.3.6",
      "com.typesafe.play" %% "play-json" % "2.6.10",
      "com.ning" % "async-http-client" % "1.9.40",
      "org.scalatest" %% "scalatest" % "3.0.5" % Test
    )
  )

resolvers += "Artifactory" at "https://flow.jfrog.io/flow/libs-release/"

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

import com.github.retronym.SbtOneJar._
import sbt.Credentials

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

version := "0.2.5"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "io.flow" %% "lib-util" % "0.1.2",
      "io.flow" %% "apibuilder-validation" % "0.3.6",
      "com.typesafe.play" %% "play-json" % "2.6.10",
      "com.ning" % "async-http-client" % "1.9.40",
      "org.scalatest" %% "scalatest" % "3.0.5" % Test
    )
  )

resolvers += "Artifactory" at "https://flow.jfrog.io/flow/libs-release/"

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


scalaVersion := "2.11.8"

name := "typelevel-blog-tut"

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

libraryDependencies ++= Seq(
  "io.get-coursier" %% "coursier" % "1.0.0-M14",
  "io.get-coursier" %% "coursier-cache" % "1.0.0-M14",
  "com.chuusai" %% "shapeless" % "2.3.0",
  "org.yaml" % "snakeyaml" % "1.17"
)

lazy val tutInput = SettingKey[File]("tutInput")
lazy val tutOutput = SettingKey[File]("tutOutput")
lazy val tutVersion = SettingKey[String]("tutVersion")

tutInput := (baseDirectory in ThisBuild).value / "posts"
tutOutput := (baseDirectory in ThisBuild).value / "_posts"
tutVersion := "0.4.4"

watchSources ++= (tutInput.value ** "*.md").get

cleanFiles += tutOutput.value
cleanFiles += (baseDirectory in ThisBuild).value / "_site"

enablePlugins(BuildInfoPlugin)

buildInfoKeys := Seq[BuildInfoKey](tutInput, tutOutput, tutVersion)

buildInfoPackage := "org.typelevel.blog"

scalaVersion := "2.11.8"

name := "typelevel-blog-tut"

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

libraryDependencies ++= Seq(
  "io.get-coursier" %% "coursier" % "1.0.0-M14",
  "io.get-coursier" %% "coursier-cache" % "1.0.0-M14",
  "com.chuusai" %% "shapeless" % "2.3.0",
  "org.yaml" % "snakeyaml" % "1.17"
)

lazy val tutInput = SettingKey[File]("tutInput")
lazy val tutOutput = SettingKey[File]("tutOutput")
lazy val tutVersion = SettingKey[String]("tutVersion")

tutInput := (baseDirectory in ThisBuild).value / "posts"
tutOutput := (baseDirectory in ThisBuild).value / "_posts"
tutVersion := "0.4.8"

watchSources ++= (tutInput.value ** "*.md").get

cleanFiles += tutOutput.value
cleanFiles += (baseDirectory in ThisBuild).value / "_site"

enablePlugins(BuildInfoPlugin)

buildInfoKeys := Seq[BuildInfoKey](tutInput, tutOutput, tutVersion)

buildInfoPackage := "org.typelevel.blog"

Upgrade to tut 0.4.8 for Scala 2.12 support.


package scorex.account

import scorex.crypto.{Base58, RIPEMD160}

class Account(val address: String) extends Serializable {

  lazy val bytes = Base58.decode(address).get

  override def toString = address

  override def equals(b: Any) = b match {
    case a: Account => a.address == address
    case _ => false
  }

  override def hashCode(): Int = address.hashCode()
}

object Account {

  import scorex.crypto.Sha256._

  val AddressLength = 25

  val AddressVersion: Byte = 58
  val ChecksumLength = 4

  def fromBytes(bytes: Array[Byte]): Account = new Account(Base58.encode(bytes))

  def fromPubkey(publicKey: Array[Byte]): String = {
    val publicKeyHash = new RIPEMD160().digest(hash(publicKey))
    val withoutChecksum = AddressVersion +: publicKeyHash //prepend ADDRESS_VERSION
    val checkSum = doubleHash(withoutChecksum).take(ChecksumLength)

    Base58.encode(withoutChecksum ++ checkSum)
  }

  def isValidAddress(address: String): Boolean =
    Base58.decode(address).map { addressBytes =>
      if (addressBytes.length != Account.AddressLength)
        false
      else {
        val checkSum = addressBytes.takeRight(ChecksumLength)

        val dh = doubleHash(addressBytes.dropRight(ChecksumLength))
        val checkSumGenerated = dh.take(ChecksumLength)

        checkSum.sameElements(checkSumGenerated)
      }
    }.getOrElse(false)
}

package scorex.account

import scorex.crypto.{Base58, RIPEMD160}

class Account(val address: String) extends Serializable {

  lazy val bytes = Base58.decode(address).get

  override def toString = address

  override def equals(b: Any) = b match {
    case a: Account => a.address == address
    case _ => false
  }

  override def hashCode(): Int = address.hashCode()
}

object Account {

  import scorex.crypto.Sha256._

  val AddressLength = 25

  val AddressVersion: Byte = 58
  val ChecksumLength = 4

  def fromPubkey(publicKey: Array[Byte]): String = {
    val publicKeyHash = new RIPEMD160().digest(hash(publicKey))
    val withoutChecksum = AddressVersion +: publicKeyHash //prepend ADDRESS_VERSION
    val checkSum = doubleHash(withoutChecksum).take(ChecksumLength)

    Base58.encode(withoutChecksum ++ checkSum)
  }

  def isValidAddress(address: String): Boolean =
    Base58.decode(address).map { addressBytes =>
      if (addressBytes.length != Account.AddressLength)
        false
      else {
        val checkSum = addressBytes.takeRight(ChecksumLength)

        val dh = doubleHash(addressBytes.dropRight(ChecksumLength))
        val checkSumGenerated = dh.take(ChecksumLength)

        checkSum.sameElements(checkSumGenerated)
      }
    }.getOrElse(false)
}

Remove unused account from bytes

Remove unused account from bytes


package ducttape.util

import java.util.logging.Formatter
import java.util.logging.LogRecord

import collection._
import collection.JavaConversions._
import java.lang.management.ManagementFactory

class LogFormatter extends Formatter {

    val threadCache = new mutable.HashMap[Long,Thread]
    threadCache

    val startTime = ManagementFactory.getRuntimeMXBean.getStartTime

    def getThreadName(id: Long): String = threadCache.get(id) match {
      case Some(t) => t.getName
      case None => {
        // expand the cache
        val threads: Iterable[Thread] = Environment.getAllThreads
        for (t <- threads) {
          threadCache += t.getId -> t
        }
        threadCache.get(id) match {
          case Some(t) => t.getName
          case None => id.toString
        }
      }
    }

    override def format(record: LogRecord): String = formatMessage(record) + "\n"

    override def formatMessage(record: LogRecord): String = {
      "[%d] %s: %s [%s]: %s".format(
          record.getMillis - startTime,
          record.getLevel,
          record.getLoggerName,
          getThreadName(record.getThreadID),
          record.getMessage)
    }
}

package ducttape.util

import java.util.logging.Formatter
import java.util.logging.LogRecord

import collection._
import collection.JavaConversions._
import java.lang.management.ManagementFactory

class LogFormatter extends Formatter {

    val startTime = ManagementFactory.getRuntimeMXBean.getStartTime

    override def format(record: LogRecord): String = formatMessage(record) + "\n"

    override def formatMessage(record: LogRecord): String = {
     // NOTE: Thread.currentThread.getId != record.getThreadID
      "[%d] %s: %s [%s]: %s".format(
          record.getMillis - startTime,
          record.getLevel,
          record.getLoggerName,
          Thread.currentThread.getName,
          record.getMessage)
    }
}

Include proper thread name in logging output


/**
 * Copyright 2017 Yahoo Inc. Licensed under the Apache License, Version 2.0
 * See accompanying LICENSE file.
 */
package kafka.manager.model

import org.scalatest.FunSuite

/**
  * @author fuji-151a
  */
class KafkaVersionTest extends FunSuite {

  test("testFormSelectList") {

  }

}

Add the test to sort the fromSelectList.


package filodb.core.cassandra

import com.websudos.phantom.testing.CassandraFlatSpec
import org.scalatest.BeforeAndAfter
import scala.concurrent.Await
import scala.concurrent.duration._

import filodb.core.messages._

class DatasetTableSpec extends CassandraFlatSpec with BeforeAndAfter {
  val keySpace = "test"

  // First create the datasets table
  override def beforeAll() {
    super.beforeAll()
    // Note: This is a CREATE TABLE IF NOT EXISTS
    Await.result(DatasetTableOps.create.future(), 3 seconds)
  }

  before {
    Await.result(DatasetTableOps.truncate.future(), 3 seconds)
  }

  import scala.concurrent.ExecutionContext.Implicits.global

  "DatasetTableRecord" should "create a dataset successfully, then return AlreadyExists" in {
    whenReady(DatasetTableOps.createNewDataset("foo")) { response =>
      response should equal (Success)
    }

    // Second time around, dataset already exists
    whenReady(DatasetTableOps.createNewDataset("foo")) { response =>
      response should equal (AlreadyExists)
    }
  }

  "DatasetTableRecord" should "not delete a dataset if it is NotFound" in {
    whenReady(DatasetTableOps.deleteDataset("foo")) { response =>
      response should equal (NotFound)
    }
  }
}

package filodb.core.cassandra

import com.websudos.phantom.testing.CassandraFlatSpec
import org.scalatest.BeforeAndAfter
import scala.concurrent.Await
import scala.concurrent.duration._

import filodb.core.messages._

class DatasetTableSpec extends CassandraFlatSpec with BeforeAndAfter {
  val keySpace = "test"

  // First create the datasets table
  override def beforeAll() {
    super.beforeAll()
    // Note: This is a CREATE TABLE IF NOT EXISTS
    Await.result(DatasetTableOps.create.future(), 3 seconds)
  }

  before {
    Await.result(DatasetTableOps.truncate.future(), 3 seconds)
  }

  import scala.concurrent.ExecutionContext.Implicits.global

  "DatasetTableRecord" should "create a dataset successfully, then return AlreadyExists" in {
    whenReady(DatasetTableOps.createNewDataset("foo")) { response =>
      response should equal (Success)
    }

    // Second time around, dataset already exists
    whenReady(DatasetTableOps.createNewDataset("foo")) { response =>
      response should equal (AlreadyExists)
    }
  }

  it should "not delete a dataset if it is NotFound" in {
    whenReady(DatasetTableOps.deleteDataset("foo")) { response =>
      response should equal (NotFound)
    }
  }

  it should "delete an empty dataset" in {
    whenReady(DatasetTableOps.createNewDataset("foo")) { response =>
      response should equal (Success)
    }
    whenReady(DatasetTableOps.deleteDataset("foo")) { response =>
      response should equal (Success)
    }
  }

  it should "return StorageEngineException when trying to delete nonempty Dataset" in {
    val f = DatasetTableOps.insert
              .value(_.name, "bar")
              .value(_.partitions, Set("first"))
              .future
    whenReady(f) { result => result.wasApplied should equal (true) }

    whenReady(DatasetTableOps.deleteDataset("bar")) { response =>
      response.getClass should be (classOf[MetadataException])
    }
  }
}

Test other delete edge cases

Test other delete edge cases


lazy val admin = project.dependsOn(worker)

lazy val worker = project

inThisBuild(Seq(
  credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", System.getenv("SONATYPE_USERNAME"), System.getenv("SONATYPE_PASSWORD")),
  developers ++= List(
    Developer("disaacson", "Derrick Issacson", "", url("http://derrickisaacson.com/"))
  ),
  licenses += "Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"),
  homepage := Some(url("https://github.com/lucidsoftware/piezo")),
  organization := "com.lucidchart",
  PgpKeys.pgpPassphrase := Some(Array.emptyCharArray),
  scalaVersion := "2.11.8",
  scmInfo := Some(ScmInfo(url("https://github.com/lucidsoftware/piezo"), "scm:git:git@github.com:lucidsoftware/piezo.git"))
))

lazy val admin = project.dependsOn(worker)

lazy val worker = project

PgpKeys.pgpPassphrase in Global := Some(Array.emptyCharArray)

inThisBuild(Seq(
  credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", System.getenv("SONATYPE_USERNAME"), System.getenv("SONATYPE_PASSWORD")),
  developers ++= List(
    Developer("disaacson", "Derrick Issacson", "", url("http://derrickisaacson.com/"))
  ),
  licenses += "Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"),
  homepage := Some(url("https://github.com/lucidsoftware/piezo")),
  organization := "com.lucidchart",
  scalaVersion := "2.11.8",
  scmInfo := Some(ScmInfo(url("https://github.com/lucidsoftware/piezo"), "scm:git:git@github.com:lucidsoftware/piezo.git"))
))

Define PHP passphrase in Global scope

Define PHP passphrase in Global scope


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

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

autocommit: Update configuration to record version 0.0.16


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.43"

exportJars := true

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

exportJars := true

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


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

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.2"

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

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

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

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.3"

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


name              := "system-testing"

version           := "0.3.0-SNAPSHOT"

organization      := "edu.nus"

scalaVersion      := "2.10.5"

publishMavenStyle := true

libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.2.4" % "test"

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

libraryDependencies += "io.argonaut" %% "argonaut" % "6.0.4"

libraryDependencies += "joda-time" % "joda-time" % "2.8.2"

libraryDependencies += "com.github.scopt" %% "scopt" % "3.3.0"

resolvers += Resolver.sonatypeRepo("public")

mainClass in Compile := Some("edu.nus.systemtesting.hipsleek.Main")

import com.github.retronym.SbtOneJar._

oneJarSettings

name              := "system-testing"

version           := "0.3.0-SNAPSHOT"

organization      := "edu.nus"

scalaVersion      := "2.10.5"

publishMavenStyle := true

libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.2.4" % "test"

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

libraryDependencies += "io.argonaut" %% "argonaut" % "6.0.4"

libraryDependencies += "joda-time" % "joda-time" % "2.8.2"

libraryDependencies += "com.github.scopt" %% "scopt" % "3.3.0"

libraryDependencies += "org.antlr" % "stringtemplate" % "4.0.2"

resolvers += Resolver.sonatypeRepo("public")

mainClass in Compile := Some("edu.nus.systemtesting.hipsleek.Main")

import com.github.retronym.SbtOneJar._

oneJarSettings

Add StringTemplate4 to SBT dependencies

Add StringTemplate4 to SBT dependencies


name := "dbgp-interfaces"

organization := "com.codnos.dbgp-interfaces"

version := "1.0-SNAPSHOT"

description := "Interfaces and implementations for both client and server side of DBGp"

scalaVersion := "2.11.8"

publishMavenStyle := true

crossPaths := false

autoScalaLibrary := false

resolvers += "Sonatype" at "https://oss.sonatype.org/content/groups/public/"

libraryDependencies ++= Seq(
  "io.netty" % "netty-all" % "4.1.0.Beta7",
  "junit" % "junit" % "4.12" % "test",
  "org.mockito" % "mockito-core" % "1.10.19" % "test",
  "org.hamcrest" % "hamcrest-library" % "1.3" % "test" exclude("org.hamcrest", "hamcrest-core"),
  "com.jayway.awaitility" % "awaitility" % "1.7.0" % "test",
  "com.novocode" % "junit-interface" % "0.11" % "test",
  "org.xmlunit" % "xmlunit-core" % "2.1.1" % "test",
  "org.scalatest" %% "scalatest" % "2.2.6" % "test"
)

name := "dbgp-interfaces"

organization := "com.codnos.dbgp-interfaces"

version := "1.0-SNAPSHOT"

description := "Interfaces and implementations for both client and server side of DBGp"

scalaVersion := "2.11.8"

publishMavenStyle := true

publishTo := Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository")))

crossPaths := false

autoScalaLibrary := false

resolvers += "Sonatype" at "https://oss.sonatype.org/content/groups/public/"

libraryDependencies ++= Seq(
  "io.netty" % "netty-all" % "4.1.0.Beta7",
  "junit" % "junit" % "4.12" % "test",
  "org.mockito" % "mockito-core" % "1.10.19" % "test",
  "org.hamcrest" % "hamcrest-library" % "1.3" % "test" exclude("org.hamcrest", "hamcrest-core"),
  "com.jayway.awaitility" % "awaitility" % "1.7.0" % "test",
  "com.novocode" % "junit-interface" % "0.11" % "test",
  "org.xmlunit" % "xmlunit-core" % "2.1.1" % "test",
  "org.scalatest" %% "scalatest" % "2.2.6" % "test"
)

Add local maven as location to publish to.


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

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

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

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

Update sbt-sonatype to 3.9.15 in master

Update sbt-sonatype to 3.9.15 in master


addSbtPlugin("org.allenai.plugins" % "allenai-sbt-plugins" % "2015.04.30-0")

addSbtPlugin("org.allenai.plugins" % "allenai-sbt-plugins" % "2015.06.05-0")

Update common plugin to pick up new dependencies.


addSbtPlugin("com.lightbend.paradox"     % "sbt-paradox"             % "0.9.1")
addSbtPlugin("com.typesafe.sbt"          % "sbt-site"                % "1.4.1")
addSbtPlugin("com.typesafe.sbt"          % "sbt-ghpages"             % "0.6.3")
addSbtPlugin("com.geirsson"              % "sbt-ci-release"          % "1.5.5")
addSbtPlugin("org.scoverage"             % "sbt-scoverage"           % "1.6.1")
addSbtPlugin("com.timushev.sbt"          % "sbt-updates"             % "0.5.1")
addSbtPlugin("pl.project13.scala"        % "sbt-jmh"                 % "0.4.0")
addSbtPlugin("de.heikoseeberger"         % "sbt-header"              % "5.6.0")
addSbtPlugin("io.chrisdavenport"         % "sbt-mima-version-check"  % "0.1.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat"            % "0.1.16")
addSbtPlugin("org.scalameta"             % "sbt-mdoc"                % "2.2.17")
addSbtPlugin("ch.epfl.lamp"              % "sbt-dotty"               % "0.5.3")

addSbtPlugin("com.lightbend.paradox"     % "sbt-paradox"             % "0.9.1")
addSbtPlugin("com.typesafe.sbt"          % "sbt-site"                % "1.4.1")
addSbtPlugin("com.typesafe.sbt"          % "sbt-ghpages"             % "0.6.3")
addSbtPlugin("com.geirsson"              % "sbt-ci-release"          % "1.5.5")
addSbtPlugin("org.scoverage"             % "sbt-scoverage"           % "1.6.1")
addSbtPlugin("com.timushev.sbt"          % "sbt-updates"             % "0.5.1")
addSbtPlugin("pl.project13.scala"        % "sbt-jmh"                 % "0.4.0")
addSbtPlugin("de.heikoseeberger"         % "sbt-header"              % "5.6.0")
addSbtPlugin("io.chrisdavenport"         % "sbt-mima-version-check"  % "0.1.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat"            % "0.1.16")
addSbtPlugin("org.scalameta"             % "sbt-mdoc"                % "2.2.18")
addSbtPlugin("ch.epfl.lamp"              % "sbt-dotty"               % "0.5.3")

Update mdoc_2.12.12, mdoc_2.13, sbt-mdoc to 2.2.18


package db.impl.schema

import scala.concurrent.{ExecutionContext, Future}

import db.impl.OrePostgresDriver.api._
import db.{ModelSchema, ModelService}
import models.project.Page

import cats.data.OptionT

/**
  * Page related queries.
  */
class PageSchema(override val service: ModelService)
    extends ModelSchema[Page](service, classOf[Page], TableQuery[PageTable]) {

  override def like(page: Page)(implicit ec: ExecutionContext): OptionT[Future, Page] =
    this.service.find[Page](
      this.modelClass,
      p =>
        p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase
          && page.parentId.isDefined && page.parentId.fold(true: Rep[Boolean])(p.parentId.get === _)
    )

}

package db.impl.schema

import scala.concurrent.{ExecutionContext, Future}

import db.impl.OrePostgresDriver.api._
import db.{ModelSchema, ModelService}
import models.project.Page

import cats.data.OptionT

/**
  * Page related queries.
  */
class PageSchema(override val service: ModelService)
    extends ModelSchema[Page](service, classOf[Page], TableQuery[PageTable]) {

  override def like(page: Page)(implicit ec: ExecutionContext): OptionT[Future, Page] =
    this.service.find[Page](
      this.modelClass,
      p =>
        p.projectId === page.projectId && p.name.toLowerCase === page.name.toLowerCase && page.parentId.fold(
          true: Rep[Boolean]
        )(p.parentId.get === _)
    )

}

Fix like method to find pages correctly

Fix like method to find pages correctly


package org.continuumio.bokeh
package sampledata

import scalax.io.JavaConverters._
import scalax.file.Path

import au.com.bytecode.opencsv.CSVReader
import java.io.FileReader

import scala.collection.JavaConverters._

trait SampleData {
    protected def load(fileName: String): List[Array[String]] = {
        val home = Path.fromString(System.getProperty("user.home"))
        val file = home / ".bokeh" / "data" / fileName
        val reader = new CSVReader(new FileReader(file.path), ',', '"', '\\', 1)
        reader.readAll().asScala.toList
    }
}

package org.continuumio.bokeh
package sampledata

import java.net.URL

import scalax.io.JavaConverters._
import scalax.file.Path

import au.com.bytecode.opencsv.CSVReader
import java.io.FileReader

import scala.collection.JavaConverters._

object SampleData {
    lazy val dataPath: Path = {
        val home = Path.fromString(System.getProperty("user.home"))
        val path = home / ".bokeh" / "data"
        if (!path.exists) path.createDirectory()
        path
    }

    def load(fileName: String): List[Array[String]] = {
        val file = dataPath / fileName
        file.size match {
            case Some(0) | None => download(fileName)
            case _              =>
        }
        val reader = new CSVReader(new FileReader(file.path), ',', '"', '\\', 1)
        reader.readAll().asScala.toList
    }

    val dataUrl = new URL("https://s3.amazonaws.com/bokeh_data/")

    def download(fileName: String) {
        val input = new URL(dataUrl, fileName)
        val output = dataPath / fileName

        println(s"Downloading $input to ${output.path} ...")

        val bytes = input.asInput.bytes
        bytes.size
        output.write(bytes)
    }
}

trait SampleData {
    def load(fileName: String): List[Array[String]] = SampleData.load(fileName)
}

Allow to download sample datasets from Amazon S3


latestVersion in ThisBuild := "0.7.2"
latestBinaryCompatibleVersion in ThisBuild := None
unreleasedModuleNames in ThisBuild := Set()

latestVersion in ThisBuild := "0.8.0"
latestBinaryCompatibleVersion in ThisBuild := Some("0.8.0")
unreleasedModuleNames in ThisBuild := Set()

Set latest version to 0.8.0

Set latest version to 0.8.0


object Solution {
  import scala.collection.mutable

  // the largestPem is easier to generate than leastPem. It's straightforward.
  def largestPem(x: Long): Long = {
    var digits = Array.fill(10)(0)
    var temp = x
    var returnVal = 0L
    while (temp > 0) {
      digits((temp % 10).toInt) += 1
      temp /= 10
    }
    for (j <- 9 to 0 by -1) {
      while(digits(j) > 0) {
        returnVal = returnVal * 10 + j
        digits(j) -= 1
      }
    }
    returnVal
  }

  def genKCubes(n: Int, k: Int) = {
    val cache = new mutable.HashMap[Long, (Int, Long)] {
      override def default(k: Long) = (0, 0L)
    }

    for (i <- 345L until n) { // L will be Long, so cube won't overflow
      val cube = i * i * i
      val key = largestPem(cube)
      val (count, smallest) = cache(key)
      cache(key) = (count + 1, if (smallest == 0) cube else smallest)
    }
    cache.map(_._2).filter(_._1 == k).map(_._2)
  }

  def main(args: Array[String]) {
    val Array(n, k) = readLine.split(" ").map(_.toInt)
    val cubes = genKCubes(n, k).toList.sorted
    cubes.foreach { x =>
      println(x)
    }
  }
}

object Solution {
  import scala.collection.mutable

  // the largestPem is easier to generate than leastPem. It's straightforward.
  def largestPem(x: Long): Long = {
    var digits = Array.fill(10)(0)
    var temp = x
    var returnVal = 0L
    while (temp > 0) {
      digits((temp % 10).toInt) += 1
      temp /= 10
    }
    for (j <- 9 to 0 by -1) {
      while(digits(j) > 0) {
        returnVal = returnVal * 10 + j
        digits(j) -= 1
      }
    }
    returnVal
  }

  def genKCubes(n: Int, k: Int) = {
    val cache = new mutable.HashMap[Long, (Int, Long)] {
      override def default(k: Long) = (0, 0L)
    }

    for (i <- 345L until n) { // L will be Long, so cube won't overflow
      val cube = i * i * i
      val key = largestPem(cube)
      val (count, smallest) = cache(key)
      cache(key) = (count + 1, if (smallest == 0) cube else smallest)
    }
    cache.filter(x => x._2._1 == k).mapValues(_._2).map(_._2)
  }

  def main(args: Array[String]) {
    val Array(n, k) = readLine.split(" ").map(_.toInt)
    val cubes = genKCubes(n, k).toList.sorted
    cubes.foreach { x =>
      println(x)
    }
  }
}

Update solution to project euler 62. The github version is slightly different than the submitted code.


package co.theasi.plotly.writer

import org.scalatest.{FlatSpec, Matchers}

import org.json4s.JString

import co.theasi.plotly.{AxisOptions, AxisType}

class AxisOptionsWriterSpec extends FlatSpec with Matchers {
  "toJson" should "serialize the plot type" in {
    val options = AxisOptions().axisType(AxisType.Log)
    val jobj = AxisOptionsWriter.toJson(options)
    jobj \ "type" shouldEqual JString("log")
  }
}

package co.theasi.plotly.writer

import org.scalatest.{FlatSpec, Matchers}

import org.json4s.{JString, JNothing}

import co.theasi.plotly.{AxisOptions, AxisType}

class AxisOptionsWriterSpec extends FlatSpec with Matchers {
  "toJson" should "serialize the plot type" in {
    val options = AxisOptions().axisType(AxisType.Log)
    val jobj = AxisOptionsWriter.toJson(options)
    jobj \ "type" shouldEqual JString("log")
  }

  it should "serialize to null if the plot type is not specified" in {
    val options = AxisOptions()
    val jobj = AxisOptionsWriter.toJson(options)
    jobj \ "type" shouldEqual JNothing
  }
}

Test for empty axis type

Test for empty axis type


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.5"

version := "0.1.71"

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

version := "0.1.72"

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


import com.typesafe.sbt.web._
import sbtrelease._
import ReleaseStateTransformations._

name := "dit4c"

// Overriding publishArtifactsAction, so unnecessary for actual operation
publishTo := Some(Resolver.file("file",  new File( "/tmp" )) )

scalaVersion in ThisBuild := "2.11.8"

// Target JDK 1.8
scalacOptions in ThisBuild += "-target:jvm-1.8"

javacOptions in ThisBuild ++= Seq("-source", "1.8",  "-target", "1.8")

// Project definitions (automatically aggregated)
lazy val common      = project in file("dit4c-common")

lazy val gatehouse   = (project in file("dit4c-gatehouse")).dependsOn(common)

lazy val highcommand = (project in file("dit4c-highcommand")).
  enablePlugins(PlayScala, SbtWeb)

lazy val machineshop = (project in file("dit4c-machineshop")).dependsOn(common)

lazy val switchboard = (project in file("dit4c-switchboard")).dependsOn(common)

// Release settings

releaseSettings

crossScalaVersions := Nil

parallelExecution in ThisBuild := false

import com.typesafe.sbt.web._
import sbtrelease._
import ReleaseStateTransformations._

name := "dit4c"

// Overriding publishArtifactsAction, so unnecessary for actual operation
publishTo := Some(Resolver.file("file",  new File( "/tmp" )) )

scalaVersion in ThisBuild := "2.11.8"

// Target JDK 1.8
scalacOptions in ThisBuild += "-target:jvm-1.8"

javacOptions in ThisBuild ++= Seq("-source", "1.8",  "-target", "1.8")

// Attempt to fix cryptic Travis CI sbt.ForkMain error
javaOptions in ThisBuild += "-Xmx1G"

// Project definitions (automatically aggregated)
lazy val common      = project in file("dit4c-common")

lazy val gatehouse   = (project in file("dit4c-gatehouse")).dependsOn(common)

lazy val highcommand = (project in file("dit4c-highcommand")).
  enablePlugins(PlayScala, SbtWeb)

lazy val machineshop = (project in file("dit4c-machineshop")).dependsOn(common)

lazy val switchboard = (project in file("dit4c-switchboard")).dependsOn(common)

// Release settings

releaseSettings

crossScalaVersions := Nil

parallelExecution in ThisBuild := false

Revert "Removing old config line"

Revert "Removing old config line"

Turns out it's still needed.

This reverts commit 6891685b74fc0f93f8991131316eb8eca374bc4a.


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.7"

crossScalaVersions := Seq("2.11.7")

version := "0.0.25"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(
    libraryDependencies ++= Seq(
      ws,
      "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 play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.7"

crossScalaVersions := Seq("2.11.7")

version := "0.0.26"

lazy val root = project
  .in(file("."))
  .enablePlugins(PlayScala)
  .settings(
    libraryDependencies ++= Seq(
      ws,
      "org.scalatest" %% "scalatest" % "2.2.6" % "test"
    )
)

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

Increment version from 0.0.25 => 0.0.26

Increment version from 0.0.25 => 0.0.26


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.11"

version := "0.1.57"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.6.7",
      "com.ning" % "async-http-client" % "1.9.40",
      "org.scalatest" %% "scalatest" % "3.0.4" % 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.11"

version := "0.1.58"

exportJars := true

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-json" % "2.6.7",
      "com.ning" % "async-http-client" % "1.9.40",
      "org.scalatest" %% "scalatest" % "3.0.4" % 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.58


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.6"

crossScalaVersions := Seq("2.12.6")

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

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.6"

crossScalaVersions := Seq("2.12.6")

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

autocommit: Update configuration to record version 0.1.94


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.11"

crossScalaVersions := Seq("2.11.11")

version := "0.3.30"

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

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


import sbt.Keys._

name := "scala-offheap-collections"
version := "0.1-SNAPSHOT"
val scalaVer = "2.11.8"

lazy val api = project
  .in(file("api"))
  .settings(
    moduleName := "api",
    scalaVersion := scalaVer
  )

lazy val codegen = project
  .in(file("codegen"))
  .dependsOn(api)
  .settings(
    moduleName := "codegen",
    scalaVersion := scalaVer
  )

lazy val core = project
  .in(file("core"))
  .dependsOn(api, codegen)
  .settings(
    moduleName := "core",
    libraryDependencies ++= Seq(
      "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test",
      "org.scalacheck" %% "scalacheck" % "1.12.2" % "test"
    ),
    scalaVersion := scalaVer
  )

lazy val benchmark = project
  .in(file("benchmark"))
  .dependsOn(core)
  .enablePlugins(JmhPlugin)
  .settings(
    moduleName := "benchmark",
    scalaVersion := scalaVer
  )

import sbt.Keys._

name := "scala-offheap-collections"
version := "0.1-SNAPSHOT"
val scalaVer = "2.11.8"

lazy val api = project
  .in(file("api"))
  .settings(
    moduleName := "api",
    libraryDependencies ++= Seq(
      "sh.den" % "scala-offheap_2.11" % "0.1"
    ),
    scalaVersion := scalaVer
  )

lazy val codegen = project
  .in(file("codegen"))
  .dependsOn(api)
  .settings(
    moduleName := "codegen",
    scalaVersion := scalaVer
  )

lazy val core = project
  .in(file("core"))
  .dependsOn(api, codegen)
  .settings(
    moduleName := "core",
    libraryDependencies ++= Seq(
      "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test",
      "org.scalacheck" %% "scalacheck" % "1.12.2" % "test"
    ),
    scalaVersion := scalaVer
  )

lazy val benchmark = project
  .in(file("benchmark"))
  .dependsOn(core)
  .enablePlugins(JmhPlugin)
  .settings(
    moduleName := "benchmark",
    scalaVersion := scalaVer
  )

Add project dependency to scala-offheap

Add project dependency to scala-offheap


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.7"

version := "0.0.5"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.7"

version := "0.0.6"

exportJars := true

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

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

Increment version from 0.0.5 => 0.0.6

Increment version from 0.0.5 => 0.0.6


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.6"

crossScalaVersions := Seq("2.12.6")

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

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.6"

crossScalaVersions := Seq("2.12.6")

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

autocommit: Update configuration to record version 0.2.6


name := "lift-formality"

organization := "com.withoutincident"

version := "0.1-SNAPSHOT"

scalaVersion := "2.9.2"

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

{
  val liftVersion = "2.6-SNAPSHOT"
  libraryDependencies ++= Seq(
    "net.liftweb" %% "lift-webkit" % liftVersion
  )
}

libraryDependencies += "com.chuusai" %% "shapeless" % "1.2.4"

scalacOptions += "-deprecation"

name := "lift-formality"

organization := "com.withoutincident"

version := "0.1-SNAPSHOT"

scalaVersion := "2.9.2"

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

{
  val liftVersion = "2.6-SNAPSHOT"
  libraryDependencies ++= Seq(
    "net.liftweb" %% "lift-webkit" % liftVersion
  )
}

libraryDependencies ++= Seq(
  "com.chuusai" %% "shapeless" % "1.2.4",
  "org.specs2" %% "specs2" % "1.12.3" % "test"
)

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

scalacOptions in Test ++= Seq("-Yrangepos")

Add specs2 dependency, fatal warnings.

Add specs2 dependency, fatal warnings.


name := "join"

version := "0.0.1"

scalaVersion := "2.11.0"

libraryDependencies += "org.scala-lang" % "scala-reflect" % "2.11.0"

Use Scala 2.11.0, and the scala-reflect library

Scala-reflect is required for the macros to work.


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.3"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.2.3" % Test,
      compilerPlugin("com.github.ghik" %% "silencer-plugin" % "1.7.1" cross CrossVersion.full),
      "com.github.ghik" %% "silencer-lib" % "1.7.1" % 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.69"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.3"

lazy val root = project
  .in(file("."))
  .settings(
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "3.2.3" % Test,
      compilerPlugin("com.github.ghik" %% "silencer-plugin" % "1.7.1" cross CrossVersion.full),
      "com.github.ghik" %% "silencer-lib" % "1.7.1" % 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.71"

autocommit: Update configuration to record version 0.2.71


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"

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

autocommit: Update configuration to record version 0.0.15


import AssemblyKeys._

assemblySettings

name := "Clasp"

jarName in assembly := "Clasp-Assembly.jar"

version := "1.0"

scalaVersion := "2.10.0"

maxErrors := 5

scalaSource in Compile <<= baseDirectory(_ / "src")

unmanagedJars in Compile +=
    file("lib/hyperic-sigar-1.6.4/sigar-bin/lib/sigar.jar")

unmanagedJars in Compile +=
    file("lib/akka-2.1.0/akka/slf4j-api-1.7.2.jar")

unmanagedJars in Compile +=
    file("lib/akka-2.1.0/akka/akka-actor_2.10-2.1.0.jar")

unmanagedJars in Compile +=
    file("lib/akka-2.1.0/akka/config-1.0.0.jar")

unmanagedJars in Compile +=
    file("lib/commons-net-3.2/commons-net-3.2.jar")

unmanagedJars in Compile +=
    file("lib/logback-1.0.9/logback-classic-1.0.9.jar")

unmanagedJars in Compile +=
    file("lib/logback-1.0.9/logback-core-1.0.9.jar")

libraryDependencies += "org.scala-lang" % "scala-actors" % "2.10.0-M6"

Add scala-actors as a dependency.

Clasp: Add scala-actors as a dependency.


scalacOptions := Seq(
  "-deprecation"
)

// For MimeLoader plugin. Dogfooding and hoping it doesn't clash with
// our other sbt plugins.
libraryDependencies ++= List(
  "com.eed3si9n" %% "treehugger" % "0.4.3",
  "io.circe" %% "circe-generic" % "0.11.1",
  "org.http4s" %% "http4s-blaze-client" % "0.20.4",
  "org.http4s" %% "http4s-circe" % "0.20.4",
)

// Hack around a binary conflict in scalameta's dependency on
// fastparse as specified by sbt-doctest-0.9.5.
libraryDependencies += "org.scalameta" %% "scalameta" % "4.2.0"

scalacOptions := Seq(
  "-deprecation"
)

// For MimeLoader plugin. Dogfooding and hoping it doesn't clash with
// our other sbt plugins.
libraryDependencies ++= List(
  "com.eed3si9n" %% "treehugger" % "0.4.3",
  "io.circe" %% "circe-generic" % "0.11.1",
  "org.http4s" %% "http4s-blaze-client" % "0.20.6",
  "org.http4s" %% "http4s-circe" % "0.20.6",
)

// Hack around a binary conflict in scalameta's dependency on
// fastparse as specified by sbt-doctest-0.9.5.
libraryDependencies += "org.scalameta" %% "scalameta" % "4.2.0"

Update http4s-blaze-client, http4s-circe to 0.20.6


package org.http4s.internal

import cats.effect.{Bracket, Resource}
import fs2.Stream

private[http4s] trait BackendBuilder[F[_], A] {
  protected implicit def F: Bracket[F, Throwable]

  /** Returns the backend as a resource.  Resource acquire waits
    * until the backend is ready to process requests.
    */
  def resource: Resource[F, A]

  /** Returns the backend as a single-element stream.  The stream
    * does not emit until the backend is ready to process requests.
    * The backend is shut down when the stream is finalized.
    */
  def stream: Stream[F, A] = Stream.resource(resource)

  @deprecated("Use allocated instead", "0.20.0-RC1")
  final def allocate: F[(A, F[Unit])] = allocated

  /** Returns an effect that allocates a backend and an `F[Unit]` to
    * release it.  The returned `F` waits until the backend is ready
    * to process requests.  The second element of the tuple shuts
    * down the backend when run.
    *
    * Unlike [[resource]] and [[stream]], there is no automatic
    * release of the backend.  This function is intended for REPL
    * sessions, tests, and other situations where composing a
    * [[cats.effect.Resource]] or [[fs2.Stream]] is not tenable.
    * [[resource]] or [[stream]] is recommended wherever possible.
    */
  def allocated: F[(A, F[Unit])] = resource.allocated
}

package org.http4s.internal

import cats.effect.{Bracket, Resource}
import fs2.Stream

private[http4s] trait BackendBuilder[F[_], A] {
  protected implicit def F: Bracket[F, Throwable]

  /** Returns the backend as a resource.  Resource acquire waits
    * until the backend is ready to process requests.
    */
  def resource: Resource[F, A]

  /** Returns the backend as a single-element stream.  The stream
    * does not emit until the backend is ready to process requests.
    * The backend is shut down when the stream is finalized.
    */
  def stream: Stream[F, A] = Stream.resource(resource)

  /** Returns an effect that allocates a backend and an `F[Unit]` to
    * release it.  The returned `F` waits until the backend is ready
    * to process requests.  The second element of the tuple shuts
    * down the backend when run.
    *
    * Unlike [[resource]] and [[stream]], there is no automatic
    * release of the backend.  This function is intended for REPL
    * sessions, tests, and other situations where composing a
    * [[cats.effect.Resource]] or [[fs2.Stream]] is not tenable.
    * [[resource]] or [[stream]] is recommended wherever possible.
    */
  def allocated: F[(A, F[Unit])] = resource.allocated
}

Remove allocate totally in favor of allocated


package helpers.steps.hooks

import cucumber.api.java.{After, Before}
import helpers.webbrowser.TestGlobal
import play.api.test.{FakeApplication, TestServer}

final class TestServerHooks {
  import TestServerHooks._
  private val testServer: TestServer = TestServer(port = port, application = fakeAppWithTestGlobal)

  @Before(order = 500)
  def startServer() = {
    testServer.start()
  }

  @After(order = 500)
  def stopServer() = {
    testServer.stop()
  }
}

object TestServerHooks {
  private final val port: Int = 9003
  private lazy val fakeAppWithTestGlobal: FakeApplication = FakeApplication(withGlobal = Some(TestGlobal))
}

package helpers.steps.hooks

import cucumber.api.java.{After, Before}
import helpers.webbrowser.TestGlobal
import play.api.test.{FakeApplication, TestServer}

final class TestServerHooks {
  import TestServerHooks._
  private val testServer: TestServer = TestServer(port = port, application = fakeAppWithTestGlobal)

  @Before(order = 500)
  def startServer() = {
    testServer.start()
  }

  @After(order = 500)
  def stopServer() = {
    testServer.stop()
  }
}

object TestServerHooks {
  private final val port: Int = 9005
  private lazy val fakeAppWithTestGlobal: FakeApplication = FakeApplication(withGlobal = Some(TestGlobal))
}

Change port number so build server can run in parallel


package app.utils

import app.utils.ConvertException
import app.utils.types._

object Converter {

  implicit class stringConverter(s: String) {

    /**
     * Convert [[SearchRelations]] type from string.
     *
     * @param relation Name of relation.
     * @return [[SearchRelations]]
     */
    def toSearchRelation: SearchRelations = {
      s.toUpperCase match {
        case "CONTAINS" => SearchRelations.CONTAINS
        case "EXCLUDES" => SearchRelations.EXCLUDES
        case "STARTSWITH" => SearchRelations.STARTSWITH
        case "ENDSWITH" => SearchRelations.ENDSWITH
        case "EQUAL" => SearchRelations.EQUAL
        case "NOTEQUAL" => SearchRelations.NOTEQUAL
        case _ => throw new ConvertException(s"Can not convert ${s} to SearchRelations type.")
      }
    }
  }

}

package app.utils

import app.utils.ConvertException
import app.utils.types._

object Converter {

  implicit class stringConverter(s: String) {

    /**
     * Convert [[SearchRelations]] type from string.
     *
     * @return [[SearchRelations]]
     */
    def toSearchRelation: SearchRelations = {
      s.toUpperCase match {
        case "CONTAINS" => SearchRelations.CONTAINS
        case "EXCLUDES" => SearchRelations.EXCLUDES
        case "STARTSWITH" => SearchRelations.STARTSWITH
        case "ENDSWITH" => SearchRelations.ENDSWITH
        case "EQUAL" => SearchRelations.EQUAL
        case "NOTEQUAL" => SearchRelations.NOTEQUAL
        case _ => throw new ConvertException(s"Can not convert ${s} to SearchRelations type.")
      }
    }
  }

}

Delete unused comment of header document


import com.socrata.sbtplugins.StylePlugin.StyleKeys._
import sbt.Keys._
import sbt._

object BuildSettings {
  def buildSettings: Seq[Setting[_]] =
    spray.revolver.RevolverPlugin.Revolver.settings ++
    Defaults.itSettings ++
      Seq(
        // TODO: enable coverage minimum
        scoverage.ScoverageSbtPlugin.ScoverageKeys.coverageFailOnMinimum := false,
        // TODO: enable style checks
        styleCheck in Test := {},
        styleCheck in Compile := {},
        scalaVersion := "2.10.4",

        resolvers += "velvia maven" at "http://dl.bintray.com/velvia/maven"
      )

  def projectSettings(assembly: Boolean = false): Seq[Setting[_]] =
    buildSettings
}

import com.socrata.sbtplugins.StylePlugin.StyleKeys._
import sbt.Keys._
import sbt._
import sbtassembly.AssemblyKeys

object BuildSettings {
  def buildSettings: Seq[Setting[_]] =
    spray.revolver.RevolverPlugin.Revolver.settings ++
    Defaults.itSettings ++
      Seq(
        // TODO: enable coverage minimum
        scoverage.ScoverageSbtPlugin.ScoverageKeys.coverageFailOnMinimum := false,
        // TODO: enable style checks
        styleCheck in Test := {},
        styleCheck in Compile := {},
        scalaVersion := "2.10.4",

        resolvers += "velvia maven" at "http://dl.bintray.com/velvia/maven"
      )

  def projectSettings(assembly: Boolean = false): Seq[Setting[_]] =
    buildSettings ++
    (if (!assembly) Seq(AssemblyKeys.assembly := file(".")) else Nil)
}

Speed up assembly by disabling assembly for projects that don't need it


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

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

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

resolvers += Classpaths.typesafeResolver

resolvers += "scct-github-repository" at "http://mtkopone.github.com/scct/maven-repo"

addSbtPlugin("reaktor" % "sbt-scct" % "0.2-SNAPSHOT")

Add support for code coverage

Add support for code coverage


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

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

Update sbt-jmh plugin to 0.2.15.

Update sbt-jmh plugin to 0.2.15.


package models.elections

import java.net.URI

import models.JsonUtils
import play.api.libs.json.Json

case class CandidateResults(
  name: String,
  states: List[String],
  electoralVotes: Int,
  popularVotes: Int,
  avatar: URI
)

object CandidateResults {
  import JsonUtils._
  implicit val jf = Json.format[CandidateResults]
}

case class ElectionResults(candidates: List[CandidateResults])

object ElectionResults {
  implicit val jf = Json.format[ElectionResults]
}

package models.elections

import java.net.URI

import models.JsonUtils
import play.api.libs.json.Json

case class CandidateResults(
  name: String,
  states: List[String],
  electoralVotes: Int,
  popularVotes: Int,
  avatar: URI,
  colour: String
)

object CandidateResults {
  import JsonUtils._
  implicit val jf = Json.format[CandidateResults]
}

case class ElectionResults(candidates: List[CandidateResults])

object ElectionResults {
  implicit val jf = Json.format[ElectionResults]
}

Add candidate colour field for election notifications


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

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

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

addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")

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

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

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

addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")

Update mdoc, sbt-mdoc to 2.2.20

Update mdoc, sbt-mdoc to 2.2.20


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

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.2")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.2")

addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.9.6")

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.7.0")

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

addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")

val scalaJSVersion =
  Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.0.0")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)

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

// addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")

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

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

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

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.2")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.2")

addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.9.6")

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.7.0")

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.1")

addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")

val scalaJSVersion =
  Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.0.0")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)

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

// addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")

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

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

Update sbt-scalajs, scalajs-compiler to 1.0.1


package modules

import actors.counter.CounterActor
import akka.actor.{ActorRef, ActorSystem}
import com.google.inject.name.Named
import com.google.inject.{AbstractModule, Provides, Singleton}
import net.codingwell.scalaguice.ScalaModule
import services.counter.{ActorCounterServiceImpl, CounterService}

class CounterModule extends AbstractModule with ScalaModule {

  override def configure() {
    bind[CounterService].to[ActorCounterServiceImpl]
  }

  @Provides
  @Singleton
  @Named(CounterActor.name)
  def counterActor(actorSystem: ActorSystem): ActorRef = {
    actorSystem.actorOf(CounterActor.props)
  }
}

package modules

import actors.counter.CounterActor
import akka.actor.{ActorRef, ActorSystem}
import com.google.inject.name.Named
import com.google.inject.{AbstractModule, Provides, Singleton}
import models.counter.Counter
import net.codingwell.scalaguice.ScalaModule
import services.counter.{ActorCounterServiceImpl, CounterService}

class CounterModule extends AbstractModule with ScalaModule {

  override def configure() {
    bind[CounterService].to[ActorCounterServiceImpl]
    bind[Counter.type].toInstance(Counter)
  }

  @Provides
  @Singleton
  @Named(CounterActor.name)
  def counterActor(actorSystem: ActorSystem): ActorRef = {
    actorSystem.actorOf(CounterActor.props)
  }
}

Add bind for the 'Counter' object

Add bind for the 'Counter' object


package com.yammer.dropwizard

import com.google.inject.{Inject, Injector}
import java.io.File
import com.sun.jersey.api.core.{ResourceConfig, ClasspathResourceConfig}
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer
import com.sun.jersey.spi.container.servlet.WebConfig

/**
 * A Guice Jersey container which scans the entire classpath for @Path
 * and @Provider annotated classes.
 *
 * @author coda
 */
class ScanningGuiceContainer @Inject() (injector: Injector) extends GuiceContainer(injector) {
  override def getDefaultResourceConfig(props: java.util.Map[String, Object], webConfig: WebConfig) = {
    val config = new ClasspathResourceConfig(classpath)
    config.getFeatures.put(ResourceConfig.FEATURE_DISABLE_WADL, true)
    config
  }

  private def classpath = System.getProperty("java.class.path").split(File.pathSeparator)
}

package com.yammer.dropwizard

import com.google.inject.{Inject, Injector, Singleton}
import java.io.File
import com.sun.jersey.api.core.{ResourceConfig, ClasspathResourceConfig}
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer
import com.sun.jersey.spi.container.servlet.WebConfig

/**
 * A Guice Jersey container which scans the entire classpath for @Path
 * and @Provider annotated classes.
 *
 * @author coda
 */
@Singleton
class ScanningGuiceContainer @Inject() (injector: Injector) extends GuiceContainer(injector) {
  override def getDefaultResourceConfig(props: java.util.Map[String, Object], webConfig: WebConfig) = {
    val config = new ClasspathResourceConfig(classpath)
    config.getFeatures.put(ResourceConfig.FEATURE_DISABLE_WADL, true)
    config
  }

  private def classpath = System.getProperty("java.class.path").split(File.pathSeparator)
}

Make sure our GuiceContainer is a singleton.


addSbtPlugin("com.typesafe.play" % "sbt-plugin"   % "2.8.12")
addSbtPlugin("org.scalameta"     % "sbt-scalafmt" % "2.4.6")

addSbtPlugin("com.typesafe.play" % "sbt-plugin"   % "2.8.13")
addSbtPlugin("org.scalameta"     % "sbt-scalafmt" % "2.4.6")

Update play-ahc-ws, play-akka-http-server, ... to 2.8.13


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

addSbtPlugin("ch.epfl.scala"  % "sbt-scalafix"       % "0.9.29")
addSbtPlugin("com.github.sbt" % "sbt-pgp"            % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-release"        % "1.1.0")
addSbtPlugin("org.scala-js"   % "sbt-jsdependencies" % "1.0.2")
addSbtPlugin("org.scala-js"   % "sbt-scalajs"        % "1.7.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype"       % "3.9.9")

// addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.10.0")

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

addSbtPlugin("ch.epfl.scala"  % "sbt-scalafix"       % "0.9.30")
addSbtPlugin("com.github.sbt" % "sbt-pgp"            % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-release"        % "1.1.0")
addSbtPlugin("org.scala-js"   % "sbt-jsdependencies" % "1.0.2")
addSbtPlugin("org.scala-js"   % "sbt-scalajs"        % "1.7.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype"       % "3.9.9")

// addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.10.0")

Update sbt-scalafix, scalafix-core to 0.9.30


package com.lucidchart.piezo.admin.controllers

import org.quartz.{SimpleScheduleBuilder, TriggerBuilder, JobBuilder, Scheduler}
import com.lucidchart.piezo.jobs.monitoring.HeartBeat

/**
  */
object TestUtil {
  val jobGroup = "testJobGroup"
  val jobName = "testJobName"
  val triggerGroup = "testTriggerGroup"
  val triggerName = "testTriggerName"

  def createJob(scheduler: Scheduler) = {
    val jobDetail = JobBuilder.newJob(classOf[HeartBeat]).withIdentity(jobName, jobGroup).build()
    val trigger = TriggerBuilder.newTrigger
      .withIdentity(triggerName, triggerGroup)
      .withDescription("test job description")
      .withSchedule(
      SimpleScheduleBuilder.simpleSchedule
        .withIntervalInSeconds(5)
        .withRepeatCount(1))
        .withDescription("test trigger description")
      .build()
    scheduler.deleteJob(jobDetail.getKey())
    scheduler.scheduleJob(jobDetail, trigger)
  }
}

package com.lucidchart.piezo.admin.controllers

import org.quartz.{SimpleScheduleBuilder, TriggerBuilder, JobBuilder, Scheduler}
import com.lucidchart.piezo.jobs.monitoring.HeartBeat

/**
  */
object TestUtil {
  val jobGroup = "testJobGroup"
  val jobName = "testJobName"
  val triggerGroup = "testTriggerGroup"
  val triggerName = "testTriggerName"

  def createJob(scheduler: Scheduler) = {
    val jobDetail = JobBuilder.newJob(classOf[HeartBeat])
      .withIdentity(jobName, jobGroup)
      .withDescription("test job description")
      .build()
    val trigger = TriggerBuilder.newTrigger
      .withIdentity(triggerName, triggerGroup)
      .withDescription("test trigger description")
      .withSchedule(
      SimpleScheduleBuilder.simpleSchedule
        .withIntervalInSeconds(5)
        .withRepeatCount(1))
        .withDescription("test schedule description")
      .build()
    scheduler.deleteJob(jobDetail.getKey())
    scheduler.scheduleJob(jobDetail, trigger)
  }
}

Update job data setup in test utils to try to fix build part 2.


package com.twitter.finatra.utils

import com.twitter.finagle.Deadline
import com.twitter.finagle.context.Contexts
import com.twitter.inject.Logging
import org.joda.time.DateTime

object DeadlineValues extends Logging {

  /**
   * Note: Deadline already contains an remaining and expired method, but they use Twitter time
   * to calculate "now", however we'd like to continue using Joda-Time (http://www.joda.org/joda-time/)
   * for consistency in how we mock time in testing.
   */
  def current(): Option[DeadlineValues] = {
    for (deadline <- Contexts.broadcast.get(Deadline)) yield {
      debug("Current Deadline: " + deadline)
      val nowMillis = DateTime.now.getMillis
      DeadlineValues(
        elapsed = nowMillis - deadline.timestamp.inMillis,
        remaining = deadline.deadline.inMillis - nowMillis)
    }
  }
}

case class DeadlineValues(
  elapsed: Long,
  remaining: Long) {
  def expired = remaining <= 0
}

package com.twitter.finatra.utils

import com.twitter.finagle.context.{Contexts, Deadline}
import com.twitter.inject.Logging
import org.joda.time.DateTime

object DeadlineValues extends Logging {

  /**
   * Note: Deadline already contains an remaining and expired method, but they use Twitter time
   * to calculate "now", however we'd like to continue using Joda-Time (http://www.joda.org/joda-time/)
   * for consistency in how we mock time in testing.
   */
  def current(): Option[DeadlineValues] = {
    for (deadline <- Contexts.broadcast.get(Deadline)) yield {
      debug("Current Deadline: " + deadline)
      val nowMillis = DateTime.now.getMillis
      DeadlineValues(
        elapsed = nowMillis - deadline.timestamp.inMillis,
        remaining = deadline.deadline.inMillis - nowMillis)
    }
  }
}

case class DeadlineValues(
  elapsed: Long,
  remaining: Long) {
  def expired = remaining <= 0
}

finagle: Move Deadline into c.t.f.context package

Problem

As we add more keys onto a requests's context, those
objects are organized in the com.twitter.finagle.context
package. Deadline should also move into this package.

Solution

Move com.twitter.finagle.Deadline into
com.twitter.finagle.context.Deadline.

RB_ID=864148
TBR=true


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

import sbt._
import sbt.Keys._

object ZincBuild extends Build {
  val sbtVersion = "0.13.0"

  val resolveSbtLocally = SettingKey[Boolean]("resolve-sbt-locally")

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

  lazy val zinc = Project(
    "zinc",
    file("."),
    settings = buildSettings ++ Version.settings ++ Publish.settings ++ Scriptit.settings ++ Seq(
      resolveSbtLocally := false,
      resolvers <+= resolveSbtLocally { local => if (local) Resolver.mavenLocal else Opts.resolver.sonatypeSnapshots },
      libraryDependencies ++= Seq(
        "com.typesafe.sbt" % "incremental-compiler" % sbtVersion,
        "com.typesafe.sbt" % "compiler-interface" % sbtVersion classifier "sources",
        "com.martiansoftware" % "nailgun-server" % "0.9.1" % "optional"
      ),
      scalacOptions ++= Seq("-feature", "-deprecation", "-Xlint")
    )
  )

  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.13.1-SNAPSHOT"

  val resolveSbtLocally = SettingKey[Boolean]("resolve-sbt-locally")

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

  lazy val zinc = Project(
    "zinc",
    file("."),
    settings = buildSettings ++ Version.settings ++ Publish.settings ++ Scriptit.settings ++ Seq(
      resolveSbtLocally := false,
      resolvers <+= resolveSbtLocally { local => if (local) Resolver.mavenLocal else Opts.resolver.sonatypeSnapshots },
      libraryDependencies ++= Seq(
        "com.typesafe.sbt" % "incremental-compiler" % sbtVersion,
        "com.typesafe.sbt" % "compiler-interface" % sbtVersion classifier "sources",
        "com.martiansoftware" % "nailgun-server" % "0.9.1" % "optional"
      ),
      scalacOptions ++= Seq("-feature", "-deprecation", "-Xlint")
    )
  )

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

Update sbt version to 0.13.1-SNAPSHOT

Update sbt version to 0.13.1-SNAPSHOT


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.68"

exportJars := true

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

exportJars := true

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


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.34"

exportJars := true

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.35"

exportJars := true

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


organization := "com.thoughtworks"

name := "rest-rpc"

//lazy val root = project in file(".")

lazy val `rest-rpc-core` = project

lazy val `rest-rpc-play` = project dependsOn `rest-rpc-core`

lazy val `rest-rpc-sample` = project dependsOn `rest-rpc-play`

organization := "com.thoughtworks"

name := "rest-rpc"

lazy val `rest-rpc-core` = project

lazy val `rest-rpc-play` = project dependsOn `rest-rpc-core`

lazy val `rest-rpc-sample` = project dependsOn `rest-rpc-play`

Delete default root project comment

Delete default root project comment


name := "cosmos-platform"

version := "0.1-SNAPSHOT"

organization in ThisBuild := "es.tid.cosmos"

scalaVersion in ThisBuild := "2.10.1"

resolvers in ThisBuild ++= Seq(
    DefaultMavenRepository,
    "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
    Resolver.url("Play", url("http://download.playframework.org/ivy-releases/"))(Resolver.ivyStylePatterns)
)

libraryDependencies in ThisBuild ++= Seq(
    "org.scalatest" %% "scalatest" % "1.9.1" % "test",
    "org.scalatest" %% "scalatest" % "1.9.1" % "it",
    "org.mockito" % "mockito-all" % "1.9.5" % "test"
)

name := "cosmos-platform"

version := "0.10-SNAPSHOT"

organization in ThisBuild := "es.tid.cosmos"

scalaVersion in ThisBuild := "2.10.1"

resolvers in ThisBuild ++= Seq(
    DefaultMavenRepository,
    "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
    Resolver.url("Play", url("http://download.playframework.org/ivy-releases/"))(Resolver.ivyStylePatterns)
)

libraryDependencies in ThisBuild ++= Seq(
    "org.scalatest" %% "scalatest" % "1.9.1" % "test",
    "org.scalatest" %% "scalatest" % "1.9.1" % "it",
    "org.mockito" % "mockito-all" % "1.9.5" % "test"
)

Align Scala version with Maven version

Align Scala version with Maven version


name := "SpaceTurtle"

version := "1.0"

scalaVersion := "2.12.1"

libraryDependencies ++= Seq(
  "io.netty" % "netty-all" % "4.0.4.Final",
  "org.apache.curator" % "curator-framework" % "3.3.0",
  "org.apache.curator" % "curator-test" % "3.3.0",
  "com.typesafe.scala-logging" %% "scala-logging" % "3.5.0",
  "org.scalatest" %% "scalatest" % "3.0.1" % "test",
  "ch.qos.logback" % "logback-classic" % "1.1.7",
  "com.typesafe" % "config" % "1.3.1"
)

parallelExecution in Test := false

testGrouping <<= definedTests in Test map { tests =>
  tests.map { test =>
    import Tests._
    new Group(
      name = test.name,
      tests = Seq(test),
      runPolicy = InProcess)
  }.sortWith(_.name < _.name)
}

Add sequential testing for sbt

Add sequential testing for sbt


package repository

import play.api.Logger
import reactivemongo.api.indexes.{CollectionIndexesManager, Index, IndexType}
import reactivemongo.bson.{BSONInteger, BSONString}

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

trait Indexed {
  def indexesManager: CollectionIndexesManager

  def toDescription(index: Index): String = index.name.getOrElse {
    index.key.map { case (field, indexType) => (field, toDescription(indexType))}.toString()
  }

  def toDescription(indexType: IndexType): String = indexType.value match {
    case BSONInteger(i) => i.toString
    case BSONString(s) => s
    case _ => throw new IllegalArgumentException("unsupported index type")
  }

  def ensureIndex(index: Index): Future[Unit] =
    indexesManager.ensure(index).map {
      case true => Logger.info(s"Created index [${toDescription(index)}] for profile repository")
      case false => Logger.info(s"Index [${toDescription(index)}] not created for profile repository")
    }
}

package repository

import play.api.Logger
import reactivemongo.api.indexes.{CollectionIndexesManager, Index, IndexType}
import reactivemongo.bson.{BSONInteger, BSONString}

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

trait Indexed {
  def indexesManager: CollectionIndexesManager

  def toDescription(index: Index): String = index.name.getOrElse {
    index.key.map { case (field, indexType) => (field, toDescription(indexType))}.mkString("[", ",", "]")
  }

  def toDescription(indexType: IndexType): String = indexType.value match {
    case BSONInteger(i) => i.toString
    case BSONString(s) => s
    case _ => throw new IllegalArgumentException("unsupported index type")
  }

  def ensureIndex(index: Index): Future[Unit] =
    indexesManager.ensure(index).map {
      case true => Logger.info(s"Created index ${toDescription(index)} for profile repository")
      case false => Logger.info(s"Index ${toDescription(index)} not created for profile repository")
    }
}

Clean up logging for index creation.

Clean up logging for index creation.


/*
 * Copyright © 2015 Typesafe, Inc. <http://www.typesafe.com>
 */

import sbt._

object Version {
  val foundation = "5.1.1"
  val jtidy      = "r938"
  val pegdown    = "1.6.0"
  val prettify   = "4-Mar-2013"
  val sbtWeb     = "1.1.1"
  val scalatest  = "2.2.5"
  val st4        = "4.0.8"
}

object Library {
  val foundation = "org.webjars"       % "foundation" % Version.foundation
  val jtidy      = "net.sf.jtidy"      % "jtidy"      % Version.jtidy
  val pegdown    = "org.pegdown"       % "pegdown"    % Version.pegdown
  val prettify   = "org.webjars"       % "prettify"   % Version.prettify
  val sbtWeb     = "com.typesafe.sbt"  % "sbt-web"    % Version.sbtWeb
  val scalatest  = "org.scalatest"    %% "scalatest"  % Version.scalatest
  val st4        = "org.antlr"         % "ST4"        % Version.st4
}

/*
 * Copyright © 2015 Typesafe, Inc. <http://www.typesafe.com>
 */

import sbt._

object Version {
  val foundation = "6.2.3"
  val jtidy      = "r938"
  val pegdown    = "1.6.0"
  val prettify   = "4-Mar-2013"
  val sbtWeb     = "1.1.1"
  val scalatest  = "2.2.5"
  val st4        = "4.0.8"
}

object Library {
  val foundation = "org.webjars"       % "foundation" % Version.foundation
  val jtidy      = "net.sf.jtidy"      % "jtidy"      % Version.jtidy
  val pegdown    = "org.pegdown"       % "pegdown"    % Version.pegdown
  val prettify   = "org.webjars"       % "prettify"   % Version.prettify
  val sbtWeb     = "com.typesafe.sbt"  % "sbt-web"    % Version.sbtWeb
  val scalatest  = "org.scalatest"    %% "scalatest"  % Version.scalatest
  val st4        = "org.antlr"         % "ST4"        % Version.st4
}

Upgrade theme to foundation 6

Upgrade theme to foundation 6


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Add Typesafe repository for Play 2.0.3 (disabled)