addSbtPlugin("io.gatling"         % "gatling-build-plugin"  % "4.3.1")
addSbtPlugin("com.github.sbt"     % "sbt-native-packager"   % "1.9.9")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"               % "0.4.3")
addSbtPlugin("net.aichler"        % "sbt-jupiter-interface" % "0.9.1")
addSbtPlugin("com.typesafe.sbt"   % "sbt-site"              % "1.4.1")
addSbtPlugin("org.wartremover"    % "sbt-wartremover"       % "3.0.1")
addSbtPlugin("ch.epfl.scala"      % "sbt-scalafix"          % "0.10.0")
addSbtPlugin("com.hanhuy.sbt"     % "kotlin-plugin"         % "2.0.0")
addSbtPlugin("net.moznion.sbt"    % "sbt-spotless"          % "0.1.3")

addSbtPlugin("io.gatling"         % "gatling-build-plugin"  % "4.3.1")
addSbtPlugin("com.github.sbt"     % "sbt-native-packager"   % "1.9.9")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"               % "0.4.3")
addSbtPlugin("net.aichler"        % "sbt-jupiter-interface" % "0.9.1")
addSbtPlugin("com.typesafe.sbt"   % "sbt-site"              % "1.4.1")
addSbtPlugin("org.wartremover"    % "sbt-wartremover"       % "3.0.2")
addSbtPlugin("ch.epfl.scala"      % "sbt-scalafix"          % "0.10.0")
addSbtPlugin("com.hanhuy.sbt"     % "kotlin-plugin"         % "2.0.0")
addSbtPlugin("net.moznion.sbt"    % "sbt-spotless"          % "0.1.3")

Update sbt-wartremover, wartremover to 3.0.2


package tools.test.osgi

import org.ops4j.pax.exam.CoreOptions._
import org.ops4j.pax.exam
import java.io.File

trait ScalaOsgiHelper {

  private def allBundleFiles = {
    println(new File(".").getAbsolutePath)
    def bundleLocation = new File(sys.props.getOrElse("scala.bundle.dir", "build/osgi"))
    bundleLocation.listFiles filter (_.getName endsWith ".jar")
  }

  private def filteredBundleFiles(names: String*): Array[exam.Option] =
     for(bundle <- allBundleFiles; if names exists (bundle.getName contains _))
     yield makeBundle(bundle)

  private def makeBundle(file: File): exam.Option =
      bundle(file.toURI.toASCIIString)

  def standardOptions: Array[exam.Option]  = {
    val bundles = (allBundleFiles map makeBundle)
    bundles ++ Array[exam.Option](junitBundles())
    // to change the local repo used (for some operations, but not all -- which is why I didn't bother):
    // systemProperty("org.ops4j.pax.url.mvn.localRepository").value(sys.props("maven.repo.local")))
  }

  def justReflectionOptions: Array[exam.Option]  = {
    val bundles = filteredBundleFiles("scala-library", "scala-reflect")
    bundles ++ Array[exam.Option](junitBundles())
  }

  def justCoreLibraryOptions: Array[exam.Option]  = {
    val bundles = filteredBundleFiles("scala-library")
    bundles ++ Array[exam.Option](junitBundles())
  }

}

package tools.test.osgi

import org.ops4j.pax.exam.CoreOptions._
import org.ops4j.pax.exam
import java.io.File

trait ScalaOsgiHelper {

  private def allBundleFiles = {
    def bundleLocation = new File(sys.props.getOrElse("scala.bundle.dir", "build/osgi"))
    bundleLocation.listFiles filter (_.getName endsWith ".jar")
  }

  private def filteredBundleFiles(names: String*): Array[exam.Option] =
     for(bundle <- allBundleFiles; if names exists (bundle.getName contains _))
     yield makeBundle(bundle)

  private def makeBundle(file: File): exam.Option =
      bundle(file.toURI.toASCIIString)

  def standardOptions: Array[exam.Option]  = {
    val bundles = (allBundleFiles map makeBundle)
    bundles ++ Array[exam.Option](junitBundles())
    // to change the local repo used (for some operations, but not all -- which is why I didn't bother):
    // systemProperty("org.ops4j.pax.url.mvn.localRepository").value(sys.props("maven.repo.local")))
  }

  def justReflectionOptions: Array[exam.Option]  = {
    val bundles = filteredBundleFiles("scala-library", "scala-reflect")
    bundles ++ Array[exam.Option](junitBundles())
  }

  def justCoreLibraryOptions: Array[exam.Option]  = {
    val bundles = filteredBundleFiles("scala-library")
    bundles ++ Array[exam.Option](junitBundles())
  }

}

Remove debugging println from the build

Remove debugging println from the build


package com.gu

package object pandomainauth {
  case class PublicKey(key: String)
  case class PrivateKey(key: String)
  case class Secret(secret: String)
}

package com.gu

package object pandomainauth {
  case class PublicKey(key: String) extends AnyVal
  case class PrivateKey(key: String) extends AnyVal
  case class Secret(secret: String) extends AnyVal
}

Use AnyVal to automatically unwrap at compile time


package au.gov.dva.sopapi.tests.parsers;

import java.io.InputStream
import java.nio.charset.Charset

import au.gov.dva.sopapi.sopref.data.Conversions
import au.gov.dva.sopapi.sopref.parsing.factories.SoPFactoryLocator
import au.gov.dva.sopapi.sopref.parsing.implementations.GenericClenser
import au.gov.dva.sopapi.sopref.parsing.traits.GenericTextClenser
import com.google.common.base.Charsets
import com.google.common.io.Resources

import scala.io.Source

object ParserTestUtils {
  def resourceToBytes(resourcePath : String) = {
    val sourceUrl = Resources.getResource(resourcePath);

    val sourceResourceStream: InputStream = Resources.asByteSource(sourceUrl).openStream();
    val bytes =  Stream.continually(sourceResourceStream.read).takeWhile(_ != -1).map(_.toByte).toArray;
    sourceResourceStream.close()
    bytes

  }

  def resourceToString(resourcePath : String) = {

    val sourceUrl = Resources.getResource(resourcePath);
    Resources.toString(sourceUrl,Charsets.UTF_8)
  }

  def executeWholeParsingPipeline(registerId : String, resourcePath : String) = {
    val bytes = resourceToBytes(resourcePath);
    val rawText = Conversions.pdfToPlainText(bytes);
    val genericClenser = new GenericClenser();
    val clensedText = genericClenser.clense(rawText)
    val sopFactory = SoPFactoryLocator.findFactory(registerId)
    val sop = sopFactory.create(registerId,clensedText)
    sop
  }

}

package au.gov.dva.sopapi.tests.parsers;

import java.io.InputStream
import java.nio.charset.Charset

import au.gov.dva.sopapi.sopref.data.Conversions
import au.gov.dva.sopapi.sopref.parsing.factories.SoPFactoryLocator
import au.gov.dva.sopapi.sopref.parsing.implementations.GenericClenser
import au.gov.dva.sopapi.sopref.parsing.traits.GenericTextClenser
import com.google.common.base.Charsets
import com.google.common.io.Resources

import scala.io.Source

object ParserTestUtils {
  def resourceToBytes(resourcePath : String) = {
    val sourceUrl = Resources.getResource(resourcePath);
    Resources.toByteArray(sourceUrl)
  }

  def resourceToString(resourcePath : String) = {

    val sourceUrl = Resources.getResource(resourcePath);
    Resources.toString(sourceUrl,Charsets.UTF_8)
  }

  def executeWholeParsingPipeline(registerId : String, resourcePath : String) = {
    val bytes = resourceToBytes(resourcePath);
    val rawText = Conversions.pdfToPlainText(bytes);
    val genericClenser = new GenericClenser();
    val clensedText = genericClenser.clense(rawText)
    val sopFactory = SoPFactoryLocator.findFactory(registerId)
    val sop = sopFactory.create(registerId,clensedText)
    sop
  }

}

Use google io in parser test utils

Use google io in parser test utils


package org.geoscript.geocss

import org.geotools.styling.Style
import Translator.css2sld

package compat {
  class Impl extends CSS2SLD.Converter {
    override def convert(input: java.io.InputStream): Style =
      CssParser.parse(input) match {
        case CssParser.Success(style, _) => css2sld(style)
        case (ns: CssParser.NoSuccess) => error(ns.toString)
      }
  }
}

package org.geoscript.geocss

import org.geotools.styling.Style

package compat {
  class Impl extends CSS2SLD.Converter {
    override def convert(input: java.io.InputStream): Style =
      CssParser.parse(input) match {
        case CssParser.Success(style, _) => (new Translator).css2sld(style)
        case (ns: CssParser.NoSuccess) => error(ns.toString)
      }
  }
}

Update Java API implementation to new internal API


name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

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

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

name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

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

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

autocommit: Update configuration to record version 0.4.7


// You may use this file to add plugin dependencies for sbt.
resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/"

resolvers += "bintray-spark-packages" at "https://dl.bintray.com/spark-packages/maven/"

addSbtPlugin("org.spark-packages" %% "sbt-spark-package" % "0.2.2")

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

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

// You may use this file to add plugin dependencies for sbt.
resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/"

resolvers += "bintray-spark-packages" at "https://dl.bintray.com/spark-packages/maven/"

addSbtPlugin("org.spark-packages" %% "sbt-spark-package" % "0.2.2")

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

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

Downgrade the version of sbt-coverage from 1.3.1 to 1.1.0


resolvers += Resolver.bintrayIvyRepo("dwijnand", "sbt-plugins")

          addSbtPlugin("com.dwijnand"    % "sbt-dynver"      % "1.0.0-M1")
          addSbtPlugin("io.get-coursier" % "sbt-coursier"    % "1.0.0-M14")
libraryDependencies += "org.scala-sbt"   % "scripted-plugin" % sbtVersion.value
          addSbtPlugin("me.lessis"       % "bintray-sbt"     % "0.3.0")

          addSbtPlugin("com.dwijnand"    % "sbt-dynver"      % "1.0.0")
          addSbtPlugin("io.get-coursier" % "sbt-coursier"    % "1.0.0-M14")
libraryDependencies += "org.scala-sbt"   % "scripted-plugin" % sbtVersion.value
          addSbtPlugin("me.lessis"       % "bintray-sbt"     % "0.3.0")

Drop bintray ivy repo, use sbt-dynver 1.0.0


scalacOptions += "-deprecation"
libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.33"

addSbtPlugin("com.typesafe"                      % "sbt-mima-plugin"       % "1.0.1")
addSbtPlugin("com.typesafe.sbt"                  % "sbt-osgi"              % "0.9.6")
addSbtPlugin("com.eed3si9n"                      % "sbt-buildinfo"         % "0.10.0")
addSbtPlugin("com.github.sbt"                    % "sbt-ci-release"        % "1.5.10")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings"      % "3.0.0")
addSbtPlugin("org.scala-js"                      % "sbt-scalajs"           % "1.8.0")
addSbtPlugin("org.scala-native"                  % "sbt-scala-native"      % "0.4.2")
addSbtPlugin("org.portable-scala"                % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala"                % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("com.codecommit"                    % "sbt-github-actions"    % "0.13.0")

scalacOptions += "-deprecation"
libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.33"

addSbtPlugin("com.typesafe"                      % "sbt-mima-plugin"       % "1.0.1")
addSbtPlugin("com.typesafe.sbt"                  % "sbt-osgi"              % "0.9.6")
addSbtPlugin("com.eed3si9n"                      % "sbt-buildinfo"         % "0.10.0")
addSbtPlugin("com.github.sbt"                    % "sbt-ci-release"        % "1.5.10")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings"      % "3.0.0")
addSbtPlugin("org.scala-js"                      % "sbt-scalajs"           % "1.8.0")
addSbtPlugin("org.scala-native"                  % "sbt-scala-native"      % "0.4.3")
addSbtPlugin("org.portable-scala"                % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala"                % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("com.codecommit"                    % "sbt-github-actions"    % "0.13.0")

Update auxlib, javalib, nativelib, nscplugin, ... to 0.4.3


scalacOptions += "-deprecation"
libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.32"

addSbtPlugin("com.typesafe"                      % "sbt-mima-plugin"       % "1.0.1")
addSbtPlugin("com.typesafe.sbt"                  % "sbt-osgi"              % "0.9.6")
addSbtPlugin("com.eed3si9n"                      % "sbt-buildinfo"         % "0.10.0")
addSbtPlugin("com.github.sbt"                    % "sbt-ci-release"        % "1.5.10")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings"      % "3.0.0")
addSbtPlugin("org.scala-js"                      % "sbt-scalajs"           % "1.7.1")
addSbtPlugin("org.scala-native"                  % "sbt-scala-native"      % "0.4.2")
addSbtPlugin("org.portable-scala"                % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala"                % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("com.codecommit"                    % "sbt-github-actions"    % "0.13.0")

scalacOptions += "-deprecation"
libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.32"

addSbtPlugin("com.typesafe"                      % "sbt-mima-plugin"       % "1.0.1")
addSbtPlugin("com.typesafe.sbt"                  % "sbt-osgi"              % "0.9.6")
addSbtPlugin("com.eed3si9n"                      % "sbt-buildinfo"         % "0.10.0")
addSbtPlugin("com.github.sbt"                    % "sbt-ci-release"        % "1.5.10")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings"      % "3.0.0")
addSbtPlugin("org.scala-js"                      % "sbt-scalajs"           % "1.8.0")
addSbtPlugin("org.scala-native"                  % "sbt-scala-native"      % "0.4.2")
addSbtPlugin("org.portable-scala"                % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala"                % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("com.codecommit"                    % "sbt-github-actions"    % "0.13.0")

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


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

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

addSbtPlugin("com.eed3si9n"       % "sbt-unidoc"           % "0.3.2")
addSbtPlugin("com.github.gseitz"  % "sbt-release"          % "1.0.0")
addSbtPlugin("com.jsuereth"       % "sbt-pgp"              % "1.0.0")
addSbtPlugin("org.tpolecat"       % "tut-plugin"           % "0.4.0")
addSbtPlugin("com.typesafe.sbt"   % "sbt-ghpages"          % "0.5.3")
addSbtPlugin("com.typesafe"       % "sbt-mima-plugin"      % "0.1.7")
addSbtPlugin("com.typesafe.sbt"   % "sbt-site"             % "0.8.1")
addSbtPlugin("net.virtual-void"   % "sbt-dependency-graph" % "0.7.4")
addSbtPlugin("org.xerial.sbt"     % "sbt-sonatype"         % "0.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"              % "0.2.5")

Revert accidental addition of Scala.JS plugin


package antwar
package sandbox

import scala.collection.immutable._

case class BreadthFirstSearch(board: Board, goal: Tile => Boolean) {

  def findTile(startTile: Tile): Option[Tile] = searchQueue(Queue(startTile), Set(startTile))

  private def searchQueue(queue: Queue[Tile], marked: Set[Tile]): Option[Tile] = queue.dequeue match {
    case (tile, rest) => {

      if (goal(tile)) Some(tile)
      else {
        val neighbors = board neighborsOf tile filterNot marked.contains
        val newQueue = rest.enqueue(neighbors)
        searchQueue(newQueue, marked ++ neighbors)
      }

    }
    case _ => None
  }

}

package antwar
package sandbox

import scala.collection.immutable._

case class BreadthFirstSearch(board: Board, goal: Tile => Boolean) {

  case class Node(value: Tile, children: List[Node] = Nil)

  /**
   *  Build a graph for the BFS, with a deep limit to levelLimit
   */
  def graph(tile: Tile, marked: Set[Tile] = Set(), currentLevel: Int = 0, levelLimit: Int = 10): Node = {

    Node(tile,
      if (currentLevel > levelLimit)
        Nil
      else {
        val neighbors = board neighborsOf tile filterNot marked.contains
        neighbors map { n => graph(n, marked ++ neighbors, currentLevel + 1, levelLimit) }
      })

  }

  private def searchGraph(queue: Queue[Node]): Option[Tile] = queue.dequeue match {
    case (node, rest) => {

      if (goal(node.value))
        Some(node.value)
      else
        searchGraph(rest.enqueue(node.children))

    }
    case _ => None
  }

  def findTile(startTile: Tile): Option[Tile] = {
    searchGraph(Queue(graph(startTile)))
  }

}

Use a proper graph for the BFS

Use a proper graph for the BFS


package bot

import javax.inject.{Inject, Singleton}

import net.dv8tion.jda.core.{AccountType, JDA, JDABuilder}

/**
  * Creates a JDA connection from injectible config.
  */
@Singleton
case class JDALauncher @Inject() (
  config: BotConfig,
  bot: BotListener
) {
  val jda: JDA = new JDABuilder(AccountType.BOT)
    .setToken(config.botToken)
    .addEventListener(bot)
    .buildAsync()
}

package bot

import javax.inject.{Inject, Singleton}

import scala.concurrent.Future

import play.api.inject.ApplicationLifecycle

import net.dv8tion.jda.core.{AccountType, JDA, JDABuilder}

/**
  * Creates a JDA connection from injectible config.
  */
@Singleton
case class JDALauncher @Inject() (
  config: BotConfig,
  bot: BotListener,
  applicationLifecycle: ApplicationLifecycle
) {
  val jda: JDA = new JDABuilder(AccountType.BOT)
    .setToken(config.botToken)
    .addEventListener(bot)
    .buildAsync()

  applicationLifecycle.addStopHook(() => Future.successful(jda.shutdown()))
}

Stop JDA when app shuts down or restarts


// Run sbt eclipse to create Eclipse project file
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")

// Run sbt gen-idea to create IntelliJ project file
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")

// Run sbt eclipse to create Eclipse project file
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

Update sbteclipse-plugin and remove sbt-idea (IntelliJ can easily import SBT projects)


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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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.1.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.1.0


addSbtPlugin("com.typesafe.play" % "sbt-plugin"   % "2.8.8")
addSbtPlugin("org.scalameta"     % "sbt-scalafmt" % "2.4.4")

addSbtPlugin("com.typesafe.play" % "sbt-plugin"   % "2.8.9")
addSbtPlugin("org.scalameta"     % "sbt-scalafmt" % "2.4.4")

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


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

addSbtPlugin("org.brianmckenna" % "sbt-wartremover" % "0.11")

resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.6.4")

addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "0.5.2")

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

addSbtPlugin("org.brianmckenna" % "sbt-wartremover" % "0.14")

resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.6.4")

addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "0.5.2")

Update dependency org.brianmckenna:sbt-wartremover to v0.14


resolvers ++= Seq(
  "sbt-idea-repo" at "http://mpeltonen.github.com/maven/",
  Classpaths.typesafeResolver
)

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.0-SNAPSHOT")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse" % "1.4.0")

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

resolvers ++= Seq(
  "sbt-idea-repo" at "http://mpeltonen.github.com/maven/",
  Classpaths.typesafeResolver
)

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.0")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse" % "1.4.0")

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

Upgrade to sbt-idea 0.11.0 final.

Upgrade to sbt-idea 0.11.0 final.


addSbtPlugin("io.gatling"         % "gatling-build-plugin"  % "5.0.0")
addSbtPlugin("com.github.sbt"     % "sbt-native-packager"   % "1.9.9")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"               % "0.4.3")
addSbtPlugin("net.aichler"        % "sbt-jupiter-interface" % "0.10.0")
addSbtPlugin("com.typesafe.sbt"   % "sbt-site"              % "1.4.1")
addSbtPlugin("org.wartremover"    % "sbt-wartremover"       % "3.0.4")
addSbtPlugin("ch.epfl.scala"      % "sbt-scalafix"          % "0.10.1")
addSbtPlugin("com.hanhuy.sbt"     % "kotlin-plugin"         % "2.0.0")
addSbtPlugin("net.moznion.sbt"    % "sbt-spotless"          % "0.1.3")

addSbtPlugin("io.gatling"         % "gatling-build-plugin"  % "5.0.0")
addSbtPlugin("com.github.sbt"     % "sbt-native-packager"   % "1.9.9")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"               % "0.4.3")
addSbtPlugin("net.aichler"        % "sbt-jupiter-interface" % "0.10.0")
addSbtPlugin("com.typesafe.sbt"   % "sbt-site"              % "1.4.1")
addSbtPlugin("org.wartremover"    % "sbt-wartremover"       % "3.0.5")
addSbtPlugin("ch.epfl.scala"      % "sbt-scalafix"          % "0.10.1")
addSbtPlugin("com.hanhuy.sbt"     % "kotlin-plugin"         % "2.0.0")
addSbtPlugin("net.moznion.sbt"    % "sbt-spotless"          % "0.1.3")

Update sbt-wartremover, wartremover to 3.0.5


package org.http4s

import cats.syntax.functor._
import cats.{Functor, ~>}
import cats.data.Kleisli

final case class ContextRequest[F[_], A](context: A, req: Request[F]) {
  def mapK[G[_]](fk: F ~> G): ContextRequest[G, A] =
    ContextRequest(context, req.mapK(fk))

  @deprecated("Use context instead", "0.21.0")
  def authInfo: A = context

}

object ContextRequest {
  def apply[F[_]: Functor, T](
      getContext: Request[F] => F[T]): Kleisli[F, Request[F], ContextRequest[F, T]] =
    Kleisli(request => getContext(request).map(ctx => ContextRequest(ctx, request)))

  implicit def contextRequestInstances[F[_]]: Functor[ContextRequest[F, *]] =
    new Functor[ContextRequest[F, *]] {
      override def map[A, B](fa: ContextRequest[F, A])(f: A => B): ContextRequest[F, B] =
        ContextRequest(f(fa.context), fa.req)
    }
}

package org.http4s

import cats.syntax.functor._
import cats.{Applicative, Eval, Functor, Traverse, ~>}
import cats.data.Kleisli

final case class ContextRequest[F[_], A](context: A, req: Request[F]) {
  def mapK[G[_]](fk: F ~> G): ContextRequest[G, A] =
    ContextRequest(context, req.mapK(fk))

  @deprecated("Use context instead", "0.21.0")
  def authInfo: A = context

}

object ContextRequest {
  def apply[F[_]: Functor, T](
      getContext: Request[F] => F[T]): Kleisli[F, Request[F], ContextRequest[F, T]] =
    Kleisli(request => getContext(request).map(ctx => ContextRequest(ctx, request)))

  implicit def contextRequestInstances[F[_]]: Traverse[ContextRequest[F, *]] =
    new Traverse[ContextRequest[F, *]] {
      override def foldLeft[A, B](fa: ContextRequest[F, A], b: B)(f: (B, A) => B): B =
        f(b, fa.context)
      override def foldRight[A, B](fa: ContextRequest[F, A], lb: Eval[B])(
          f: (A, Eval[B]) => Eval[B]): Eval[B] =
        f(fa.context, lb)

      override def traverse[G[_]: Applicative, A, B](fa: ContextRequest[F, A])(
          f: A => G[B]): G[ContextRequest[F, B]] =
        f(fa.context).map(b => ContextRequest(b, fa.req))
    }
}

Upgrade from Functor to Traverse

Upgrade from Functor to Traverse


import org.json4s.JsonDSL._
import org.json4s.native.JsonMethods._
import services.EvernoteService
import unfiltered.request._
import unfiltered.response._

import scala.collection.JavaConversions._

class App extends unfiltered.filter.Plan with Evernote {

  def intent = {
    case GET(Path("/notes")) & EvernoteAuth(auth) =>
      val service = EvernoteService.create(auth)
      val notes = service.findRecentNotes(0, 100)

      JsonContent ~> ResponseString(compact(render(
        notes.map(note =>
          ("guid" -> note.getGuid) ~
          ("title" -> note.getTitle) ~
          ("created" -> note.getCreated.toString) ~
          ("updated" -> note.getUpdated.toString)
        )
      )))

    case GET(Path(Seg("note" :: guid :: Nil))) & EvernoteAuth(auth) =>
      val service = EvernoteService.create(auth)
      val note = service.getNoteWithContent(guid)

      JsonContent ~> ResponseString(compact(render(
        ("guid" -> note.getGuid) ~
        ("title" -> note.getTitle) ~
        ("created" -> note.getCreated.toString) ~
        ("updated" -> note.getUpdated.toString) ~
        ("content" -> note.getContent) ~
        ("resources" -> note.getResources.map(resource =>
          ("guid" -> resource.getGuid) ~
          ("mime" -> resource.getMime)
        ))
      )))
  }

}

import org.json4s.JsonDSL._
import org.json4s.native.JsonMethods._
import services.EvernoteService
import unfiltered.request._
import unfiltered.response._

import scala.collection.JavaConversions._

class App extends unfiltered.filter.Plan with Evernote {

  def intent = {
    case GET(Path("/notes")) & EvernoteAuth(auth) =>
      val service = EvernoteService.create(auth)
      val notes = service.findRecentNotes(0, 100)

      JsonContent ~> ResponseString(compact(render(
        notes.map(note =>
          ("guid" -> note.getGuid) ~
          ("title" -> note.getTitle) ~
          ("created" -> note.getCreated.toString) ~
          ("updated" -> note.getUpdated.toString)
        )
      )))

    case GET(Path(Seg("note" :: guid :: Nil))) & EvernoteAuth(auth) =>
      val service = EvernoteService.create(auth)
      val note = service.getNoteWithContent(guid)

      JsonContent ~> ResponseString(compact(render(
        ("guid" -> note.getGuid) ~
        ("title" -> note.getTitle) ~
        ("created" -> note.getCreated.toString) ~
        ("updated" -> note.getUpdated.toString) ~
        ("content" -> note.getContent) ~
        ("resources" -> Option(note.getResources).map(_.map(resource =>
          ("guid" -> resource.getGuid) ~
          ("mime" -> resource.getMime)
        )))
      )))
  }

}

Fix NPE if the note has no resource

Fix NPE if the note has no resource


package mesosphere.marathon
package api

import org.eclipse.jetty.servlet.DefaultServlet
import org.eclipse.jetty.util.resource.Resource

class PublicServlet extends DefaultServlet {

  private[this] val path = "public"
  private[this] val pathWithSlash = s"^/$path/"

  // Set resource base to serve resources from classpath available under /public/*.
  override def getInitParameter(name: String): String = name match {
    case "resourceBase" => Option(getClass.getClassLoader.getResource(path)).fold(null: String)(_.toExternalForm)
    case _ => super.getInitParameter(name)
  }

  // The resource requested is /public/{path}
  // Since the resource base already is public, we strip public from the path
  @SuppressWarnings(Array("all"))
  override def getResource(pathInContext: String): Resource = {
    super.getResource(pathInContext.replaceFirst(pathWithSlash, ""))
  }
}

package mesosphere.marathon
package api

import org.eclipse.jetty.servlet.DefaultServlet
import org.eclipse.jetty.util.resource.Resource

class PublicServlet extends DefaultServlet {

  private[this] val path = "public"
  private[this] val pathWithSlash = s"^/$path/"

  // Set resource base to serve resources from classpath available under /public/*.
  override def getInitParameter(name: String): String = name match {
    case "resourceBase" => Option(getClass.getClassLoader.getResource(path)).fold(null: String)(_.toExternalForm)
    case "dirAllowed" => "false"
    case _ => super.getInitParameter(name)
  }

  // The resource requested is /public/{path}
  // Since the resource base already is public, we strip public from the path
  @SuppressWarnings(Array("all"))
  override def getResource(pathInContext: String): Resource = {
    super.getResource(pathInContext.replaceFirst(pathWithSlash, ""))
  }
}

Disable directory listing under /public.

Summary:
The jetty DefaultServlet has directory listing enabled by default.
Even if this only allows access to public documentation, we should disable this.

Test Plan:
Start Marathon and access :8080/public/api/
This should result in an HTTP/1.1 403 Forbidden

Reviewers: meichstedt, unterstein, jenkins

Reviewed By: meichstedt, unterstein, jenkins

Subscribers: marathon-dev

JIRA Issues: DCOS-14539

Differential Revision: https://phabricator.mesosphere.com/D682


import sbt._
import Keys._

object MiniBCSBuild extends Build {

  val buildOptions = Defaults.defaultSettings ++ Seq(
    scalaVersion := "2.10.0-RC1",
    resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
    resolvers += "Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/",
    resolvers += "Central" at "https://oss.sonatype.org/content/repositories/releases/",
    libraryDependencies := Seq(
      // Update these to use %% when 2.10 goes live because I have no idea how to force it to use that.
      "com.typesafe.akka" % "akka-actor_2.10.0-RC1" % "2.1.0-RC1",
      "com.typesafe.akka" % "akka-remote_2.10.0-RC1" % "2.1.0-RC1",
      "org.joda" % "joda-convert" % "1.2",
      "joda-time" % "joda-time" % "2.1"
    ),
    version := "1.0.0",
    scalacOptions ++= Seq(
      "-deprecation",
      "-feature"
    )
  )

  lazy val root = Project(
    "minibcs",
    file("."),
    settings = buildOptions
  ).dependsOn(
    uri("https://github.com/breakpoint-eval/scala-common.git"))

}

import sbt._
import Keys._

object MiniBCSBuild extends Build {

  val buildOptions = Defaults.defaultSettings ++ Seq(
    scalaVersion := "2.10.0-M7",
    resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
    resolvers += "Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/",
    resolvers += "Central" at "https://oss.sonatype.org/content/repositories/releases/",
    libraryDependencies := Seq(
      // Update these to use %% when 2.10 goes live because I have no idea how to force it to use that.
      "com.typesafe.akka" % "akka-actor_2.10.0-M7" % "2.1-M2",
      "com.typesafe.akka" % "akka-remote_2.10.0-M7" % "2.1-M2",
      "org.joda" % "joda-convert" % "1.2",
      "joda-time" % "joda-time" % "2.1"
    ),
    version := "1.0.0",
    scalacOptions ++= Seq(
      "-deprecation",
      "-feature"
    )
  )

  lazy val root = Project(
    "minibcs",
    file("."),
    settings = buildOptions
  ).dependsOn(
    uri("https://github.com/breakpoint-eval/scala-common.git"))

}

Revert Scala bump here since Play2 weekly and bp-eval/scala-common still dep on -M7.

This reverts commit 68107e8819239e87f5a67fec079142e656e5fb71.


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

object Build extends android.AutoBuild
{
	lazy val main = Project( "toolbelt", file( "." ) )
		.settings( buildAar: _* )
		.settings(
			libraryDependencies ++= Seq(
				"org.scala-lang" % "scala-reflect" % scalaVersion.value,
				"com.android.support" % "support-v4" % "20.0.0",
				"com.github.japgolly.android" % "svg-android" % "2.0.6"
			),
			name := "Toolbelt",
			organization := "com.taig.android",
			scalaVersion := "2.11.2",
			scalacOptions ++= Seq(
				"-deprecation",
				"-feature",
				"-language:dynamics",
				"-language:implicitConversions",
				"-language:reflectiveCalls"
			),
			version := "0.1.10-BETA",
			libraryProject in Android := true,
			minSdkVersion in Android := "10",
			targetSdkVersion in Android := "21"
		)
}

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

object Build extends android.AutoBuild
{
	lazy val main = Project( "toolbelt", file( "." ) )
		.settings( buildAar: _* )
		.settings(
			libraryDependencies ++= Seq(
				"org.scala-lang" % "scala-reflect" % scalaVersion.value,
				"com.android.support" % "support-v4" % "20.0.0",
				"com.github.japgolly.android" % "svg-android" % "2.0.6"
			),
			name := "Toolbelt",
			organization := "com.taig.android",
			scalaVersion := "2.11.2",
			scalacOptions ++= Seq(
				"-deprecation",
				"-feature",
				"-language:dynamics",
				"-language:implicitConversions",
				"-language:reflectiveCalls"
			),
			version := "0.1.11-BETA",
			libraryProject in Android := true,
			minSdkVersion in Android := "10",
			targetSdkVersion in Android := "21"
		)
}

Set project version to 0.1.11-BETA

Set project version to 0.1.11-BETA


import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "liumsg"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,
    anorm,
    "com.wordnik" %% "swagger-play2-utils" % "1.2.4",
    "commons-io" % "commons-io" % "2.4"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here
    scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature"),
    resolvers := Seq(
      "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository",
      "sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
      "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases",
      "java-net" at "http://download.java.net/maven/2",
      "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"))
}

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "liumsg"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,
    anorm,
    "com.wordnik" %% "swagger-play2-utils" % "1.2.4",
    "commons-io" % "commons-io" % "2.4",
    "com.typesafe.slick" %% "slick" % "1.0.1",
    "org.xerial" % "sqlite-jdbc" % "3.7.2"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here
    scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature"),
    resolvers := Seq(
      "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository",
      "sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
      "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases",
      "java-net" at "http://download.java.net/maven/2",
      "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"))
}

Add slick and sqlite dependencies

Add slick and sqlite dependencies


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

val sbtSoftwareMillVersion = "2.0.2"
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("ch.epfl.lamp" % "sbt-dotty" % "0.5.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.17")

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

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

val sbtSoftwareMillVersion = "2.0.2"
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("ch.epfl.lamp" % "sbt-dotty" % "0.5.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.17")

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

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


addSbtPlugin("com.eed3si9n"       % "sbt-unidoc"                    % "0.4.3")
addSbtPlugin("com.geirsson"       % "sbt-ci-release"                % "1.5.2")
addSbtPlugin("com.typesafe"       % "sbt-mima-plugin"               % "0.6.4")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"                       % "0.3.7")
addSbtPlugin("org.scala-js"       % "sbt-scalajs"                   % "0.6.32")
addSbtPlugin("org.portable-scala" % "sbt-crossproject"              % "0.6.1")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject"      % "0.6.1")
addSbtPlugin("com.47deg"          % "sbt-microsites"                % "0.9.4")
addSbtPlugin("org.tpolecat"       % "tut-plugin"                    % "0.6.13")

scalacOptions += "-deprecation"

addSbtPlugin("com.eed3si9n"       % "sbt-unidoc"                    % "0.4.3")
addSbtPlugin("com.geirsson"       % "sbt-ci-release"                % "1.5.2")
addSbtPlugin("com.typesafe"       % "sbt-mima-plugin"               % "0.6.4")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"                       % "0.3.7")
addSbtPlugin("org.scala-js"       % "sbt-scalajs"                   % "0.6.32")
addSbtPlugin("org.portable-scala" % "sbt-crossproject"              % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject"      % "1.0.0")
addSbtPlugin("com.47deg"          % "sbt-microsites"                % "0.9.4")
addSbtPlugin("org.tpolecat"       % "tut-plugin"                    % "0.6.13")

scalacOptions += "-deprecation"

Update sbt-crossproject, ... to 1.0.0

Update sbt-crossproject, ... to 1.0.0


addSbtPlugin("com.lightbend.paradox"     % "sbt-paradox"             % "0.8.0")
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.4")
addSbtPlugin("org.scoverage"             % "sbt-scoverage"           % "1.6.1")
addSbtPlugin("com.timushev.sbt"          % "sbt-updates"             % "0.5.1")
addSbtPlugin("pl.project13.scala"        % "sbt-jmh"                 % "0.3.7")
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.15")
addSbtPlugin("org.scalameta"             % "sbt-mdoc"                % "2.2.12" )

addSbtPlugin("com.lightbend.paradox"     % "sbt-paradox"             % "0.8.0")
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.4")
addSbtPlugin("org.scoverage"             % "sbt-scoverage"           % "1.6.1")
addSbtPlugin("com.timushev.sbt"          % "sbt-updates"             % "0.5.1")
addSbtPlugin("pl.project13.scala"        % "sbt-jmh"                 % "0.3.7")
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.15")
addSbtPlugin("org.scalameta"             % "sbt-mdoc"                % "2.2.13" )

Update mdoc, sbt-mdoc to 2.2.13

Update mdoc, sbt-mdoc to 2.2.13


name := "streamz"

organization in ThisBuild := "com.github.krasserm"

version in ThisBuild := "0.5-SNAPSHOT"

scalaVersion in ThisBuild := "2.11.8"

scalacOptions in ThisBuild ++= Seq("-feature", "-language:higherKinds", "-language:implicitConversions", "-deprecation")

libraryDependencies in ThisBuild ++= Seq(
  "co.fs2"            %% "fs2-core"      % Version.Fs2,
  "com.typesafe.akka" %% "akka-testkit"  % Version.Akka          % "test",
  "org.scalatest"     %% "scalatest"     % Version.Scalatest     % "test"
)

lazy val root = project.in(file(".")).aggregate(akkaCamel, akkaStream)

lazy val akkaCamel = project.in(file("streamz-akka-camel"))

lazy val akkaStream = project.in(file("streamz-akka-stream"))

name := "streamz"

organization in ThisBuild := "com.github.krasserm"

version in ThisBuild := "0.6-SNAPSHOT"

scalaVersion in ThisBuild := "2.11.8"

scalacOptions in ThisBuild ++= Seq("-feature", "-language:higherKinds", "-language:implicitConversions", "-deprecation")

libraryDependencies in ThisBuild ++= Seq(
  "co.fs2"            %% "fs2-core"      % Version.Fs2,
  "com.typesafe.akka" %% "akka-testkit"  % Version.Akka          % "test",
  "org.scalatest"     %% "scalatest"     % Version.Scalatest     % "test"
)

lazy val root = project.in(file(".")).aggregate(akkaCamel, akkaStream)

lazy val akkaCamel = project.in(file("streamz-akka-camel"))

lazy val akkaStream = project.in(file("streamz-akka-stream"))

Set development version to 0.6-SNAPSHOT

Set development version to 0.6-SNAPSHOT


androidBuildAar

githubProject := "toolbelt"

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

libraryDependencies ++=
    "com.android.support" % "recyclerview-v7" % "23.2.0" ::
    "com.android.support" % "support-v4" % "23.2.0" ::
    "com.android.support" % "support-v13" % "23.2.0" ::
    Nil

minSdkVersion := "13"

name := "Toolbelt"

organization := "io.taig.android"

platformTarget := "android-23"

publishArtifact in ( Compile, packageDoc ) := false

scalaVersion := "2.11.7"

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

targetSdkVersion := "23"

typedResources := false

version := "0.4.4"

androidBuildAar

githubProject := "toolbelt"

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

libraryDependencies ++=
    "com.android.support" % "recyclerview-v7" % "23.2.1" ::
    "com.android.support" % "support-v4" % "23.2.1" ::
    "com.android.support" % "support-v13" % "23.2.1" ::
    Nil

minSdkVersion := "13"

name := "Toolbelt"

organization := "io.taig.android"

platformTarget := "android-23"

publishArtifact in ( Compile, packageDoc ) := false

scalaVersion := "2.11.7"

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

targetSdkVersion := "23"

typedResources := false

version := "0.4.4"

Upgrade to android support library 23.2.1


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

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

autocommit: Update configuration to record version 0.1.97


//
// Project metadata
//

name := "tempgres-client"

organization := "dk.cwconsult"

version := "1.1-SNAPSHOT"

//
// sbt-pgp settings
//

useGpg := true

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

crossPaths := false

autoScalaLibrary := false

//
// Compiler settings
//

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

//
// Project metadata
//

name := "tempgres-client"

organization := "dk.cwconsult"

version := "1.1.0-SNAPSHOT"

//
// sbt-pgp settings
//

useGpg := true

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

crossPaths := false

autoScalaLibrary := false

//
// Compiler settings
//

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

Change to three-component version number


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.79"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.80"

exportJars := true

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

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

autocommit: Update configuration to record version 0.0.80


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

name := "proxy"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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

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

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

autocommit: Update configuration to record version 0.0.13


name := "machines"

resolvers += "Scala Tools Snapshots" at "http://scala-tools.org/repo-snapshots/"

libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.0-SNAPSHOT"

libraryDependencies += "org.scalaz" %% "scalaz-effect" % "7.0-SNAPSHOT"

scalaVersion := "2.9.2"

scalacOptions ++= Seq("-deprecation", "-Ydependent-method-types", "-unchecked")

name := "machines"

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

libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.0-SNAPSHOT"

libraryDependencies += "org.scalaz" %% "scalaz-effect" % "7.0-SNAPSHOT"

scalaVersion := "2.9.2"

scalacOptions ++= Seq("-deprecation", "-Ydependent-method-types", "-unchecked")

Update snapshot repository url because scala-tools.org is no longer serving jars.


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.3.17"

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

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

import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.3.18"

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


ThisBuild / organization := "com.socrata"

ThisBuild / testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oFD")

ThisBuild / scalaVersion := "2.12.8"

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

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

val coordinatorExternal = (project in file("coordinator-external")).
  configs(IntegrationTest).
  settings(Defaults.itSettings)

val coordinatorlib = (project in file("coordinatorlib")).
  configs(IntegrationTest).
  settings(Defaults.itSettings)

val coordinator = (project in file("coordinator")).
  dependsOn(coordinatorlib, coordinatorExternal)

val secondarylib = (project in file("secondarylib")).
  dependsOn(coordinatorlib)

val dummySecondary = (project in file("dummy-secondary")).
  dependsOn(secondarylib % "provided")

val secondarylibFeedback = (project in file("secondarylib-feedback")).
  dependsOn(secondarylib)

publish / skip := true

releaseProcess -= ReleaseTransformations.publishArtifacts

disablePlugins(AssemblyPlugin)

ThisBuild / organization := "com.socrata"

ThisBuild / testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oFD")

ThisBuild / scalaVersion := "2.12.8"

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

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

ThisBuild / classLoaderLayeringStrategy in Test := ClassLoaderLayeringStrategy.ScalaLibrary

val coordinatorExternal = (project in file("coordinator-external")).
  configs(IntegrationTest).
  settings(Defaults.itSettings)

val coordinatorlib = (project in file("coordinatorlib")).
  configs(IntegrationTest).
  settings(Defaults.itSettings)

val coordinator = (project in file("coordinator")).
  dependsOn(coordinatorlib, coordinatorExternal)

val secondarylib = (project in file("secondarylib")).
  dependsOn(coordinatorlib)

val dummySecondary = (project in file("dummy-secondary")).
  dependsOn(secondarylib % "provided")

val secondarylibFeedback = (project in file("secondarylib-feedback")).
  dependsOn(secondarylib)

publish / skip := true

releaseProcess -= ReleaseTransformations.publishArtifacts

disablePlugins(AssemblyPlugin)

Set the classLoaderLayeringStrategty to ScalaLibrary

Running out of metaspace in Jenkins, and this is a hint SBT gives for
solving that.


name := "moe"

version := "0.0.0"

scalaVersion := "2.10.0"

scalacOptions ++= Seq("-deprecation")

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

name := "moe"

version := "0.0.0"

scalaVersion := "2.10.0"

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

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

Add unchecked flag to scalacOptions

Add unchecked flag to scalacOptions


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.75"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.76"

exportJars := true

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

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

autocommit: Update configuration to record version 0.0.76


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.6"

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

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

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

scalacOptions ++= allScalacOptions

version := "0.3.7"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.6"

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

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

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

scalacOptions ++= allScalacOptions

version := "0.3.8"

autocommit: Update configuration to record version 0.3.8


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

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.17"

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

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

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

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.18"

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

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

autocommit: Update configuration to record version 0.0.18


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

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

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

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

autocommit: Update configuration to record version 0.1.91


lazy val build = (project in file(".")).
  settings(BuildSettings.buildSettings ++ Seq(
    autoScalaLibrary := false,
    publishArtifact := false
  )).
  dependsOn(socrataHttpCommon, socrataHttpServer, socrataHttpJetty, socrataHttpCuratorBroker, socrataHttpClient).
  aggregate(socrataHttpCommon, socrataHttpServer, socrataHttpJetty, socrataHttpCuratorBroker, socrataHttpClient)

lazy val socrataHttpCommon = (project in file("socrata-http-common")).
  settings(SocrataHttpCommon.settings)

lazy val socrataHttpServer = (project in file("socrata-http-server")).
  settings(SocrataHttpServer.settings).
  dependsOn(socrataHttpCommon)

lazy val socrataHttpJetty = (project in file("socrata-http-jetty")).
  settings(SocrataHttpJetty.settings).
  dependsOn(socrataHttpServer)

lazy val socrataHttpCuratorBroker = (project in file("socrata-http-curator-broker")).
  settings(SocrataHttpCuratorBroker.settings).
  dependsOn(socrataHttpJetty)

lazy val socrataHttpClient = (project in file("socrata-http-client")).
  settings(SocrataHttpClient.settings).
  dependsOn(socrataHttpCommon)

lazy val build = (project in file(".")).
  settings(BuildSettings.buildSettings ++ Seq(
    publish / skip := true
  )).
  dependsOn(socrataHttpCommon, socrataHttpServer, socrataHttpJetty, socrataHttpCuratorBroker, socrataHttpClient).
  aggregate(socrataHttpCommon, socrataHttpServer, socrataHttpJetty, socrataHttpCuratorBroker, socrataHttpClient)

lazy val socrataHttpCommon = (project in file("socrata-http-common")).
  settings(SocrataHttpCommon.settings)

lazy val socrataHttpServer = (project in file("socrata-http-server")).
  settings(SocrataHttpServer.settings).
  dependsOn(socrataHttpCommon)

lazy val socrataHttpJetty = (project in file("socrata-http-jetty")).
  settings(SocrataHttpJetty.settings).
  dependsOn(socrataHttpServer)

lazy val socrataHttpCuratorBroker = (project in file("socrata-http-curator-broker")).
  settings(SocrataHttpCuratorBroker.settings).
  dependsOn(socrataHttpJetty)

lazy val socrataHttpClient = (project in file("socrata-http-client")).
  settings(SocrataHttpClient.settings).
  dependsOn(socrataHttpCommon)

Use publish / skip to prevent publishing the root project


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

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

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


package so.eval
import so.eval.languages._

import akka.actor.Actor

object Router {
  /* The list of languages we can evaluate. Keep alphabetical. */
  val languages = Map(
    "c" -> C,
    "c++" -> `C++`,
    "clojure" -> Clojure,
    "go" -> Go,
    "io" -> Io,
    "java" -> Java,
    "perl" -> Perl,
    "php" -> PHP,
    "python" -> Python,
    "ruby" -> Ruby,
    "scala" -> Scala
  )

  /** LEGACY: Return a subclass of [[SandboxedLanguage]], configured to run an eval. */
  def route(language: String, code: String) = languages.get(language).map(_(EvaluationRequest(code)))

  /** Return a subclass of [[SandboxedLanguage]], configured to run an eval via Akka.
    *
    * Using this method, you can get an instance of a class that extends
    * [[SandboxedLanguage]]. This is useful to prepare a message to send to the
    * [[Router]] actor defined below.
    *
    * All new clients implementing BCS should use this method as opposed to
    * route[String, String](), even if they just call `.evaluate()` on the
    * resulting class.
    */
  def route(language: String, evaluation: EvaluationRequest) = languages.get(language).map(_(evaluation))
}

class Router extends Actor {
  def receive = {
    case s: SandboxedLanguage => sender ! s.evaluate
  }
}

package so.eval
import so.eval.languages._

import akka.actor.Actor

object Router {
  /* The list of languages we can evaluate. Keep alphabetical. */
  val languages = Map(
    "c" -> C,
    "c++" -> `C++`,
    "clojure" -> Clojure,
    //"go" -> Go,
    "io" -> Io,
    "java" -> Java,
    "perl" -> Perl,
    "php" -> PHP,
    "python" -> Python,
    "ruby" -> Ruby,
    "scala" -> Scala
  )

  /** LEGACY: Return a subclass of [[SandboxedLanguage]], configured to run an eval. */
  def route(language: String, code: String) = languages.get(language).map(_(EvaluationRequest(code)))

  /** Return a subclass of [[SandboxedLanguage]], configured to run an eval via Akka.
    *
    * Using this method, you can get an instance of a class that extends
    * [[SandboxedLanguage]]. This is useful to prepare a message to send to the
    * [[Router]] actor defined below.
    *
    * All new clients implementing BCS should use this method as opposed to
    * route[String, String](), even if they just call `.evaluate()` on the
    * resulting class.
    */
  def route(language: String, evaluation: EvaluationRequest) = languages.get(language).map(_(evaluation))
}

class Router extends Actor {
  def receive = {
    case s: SandboxedLanguage => sender ! s.evaluate
  }
}

Comment it out for @raynes. :P

Comment it out for @raynes. :P


import language.`3.1`
object Test:

  def cat1(s1: String)(s2: String) = s1 + s2
  val fcat1 = cat1

Fix source version for test

Fix source version for test


package dotty.tools.scaladoc

sealed trait EngineQuery
case class EngineMatchersQuery(matchers: List[Matchers]) extends EngineQuery
case class BySignature(signature: String) extends EngineQuery

sealed trait Matchers extends Function1[PageEntry, Int]

case class ByName(query: String) extends Matchers:
  val tokens = StringUtils.createCamelCaseTokens(query)
  def apply(p: PageEntry): Int = {
    val nameOption = Option(p.shortName.toLowerCase)
    //Edge case for empty query string
    if query == "" then 1
    else {
      val results = List(
        nameOption.filter(_.contains(query.toLowerCase)).fold(-1)(_.size - query.size),
        if p.tokens.size >= tokens.size && p.tokens.zip(tokens).forall( (token, query) => token.startsWith(query))
          then p.tokens.size - tokens.size + 1
          else -1
        //acronym.filter(_.contains(query)).fold(-1)(_.size - query.size + 1)
      )
      if results.forall(_ == -1) then -1 else results.filter(_ != -1).min
    }
  }

case class ByKind(kind: String) extends Matchers:
  def apply(p: PageEntry): Int = p.fullName.split(" ").headOption.filter(_.equalsIgnoreCase(kind)).fold(-1)(_ => 1)

package dotty.tools.scaladoc

sealed trait EngineQuery
case class EngineMatchersQuery(matchers: List[Matchers]) extends EngineQuery
case class BySignature(signature: String) extends EngineQuery

sealed trait Matchers extends Function1[PageEntry, Int]

case class ByName(query: String) extends Matchers:
  val tokens = StringUtils.createCamelCaseTokens(query)
  def apply(p: PageEntry): Int = {
    val nameOption = Option(p.shortName.toLowerCase)
    //Edge case for empty query string
    if query == "" then 1
    else {
      val results = List(
        nameOption.filter(_.contains(query.toLowerCase)).fold(-1)(_.size - query.size),
        if p.tokens.size >= tokens.size && p.tokens.zip(tokens).forall( (token, query) => token.startsWith(query))
          then p.tokens.size - tokens.size + 1
          else -1
        //acronym.filter(_.contains(query)).fold(-1)(_.size - query.size + 1)
      )
      if results.forall(_ == -1) then -1 else results.filter(_ != -1).min
    }
  }

case class ByKind(kind: String) extends Matchers:
  def apply(p: PageEntry): Int = if p.kind.equalsIgnoreCase(kind) then 1 else -1

Fix match by kind in searchbar

Fix match by kind in searchbar


package com.nrinaudo.csv

import java.io.{Closeable, PrintStream}

class CsvWriter[A] private[csv] (private val out: PrintStream, val sep: Char, private val format: A => List[String])
  extends Closeable {

  private def escape(str: String): String =
    if(str.contains("\""))                                                  "\"" + str.replaceAll("\"", "\"\"") + "\""
    else if (str.contains(sep) || str.contains("\n") || str.contains("\r")) "\"" + str + "\""
    else                                                                    str

  private def write(ss: List[String]): Unit = ss.map(escape) match {
    case h :: t =>
      out.print(h)
      t.foreach { a =>
        out.print(',')
        out.print(a)
      }
      out.println()
    case _ => // Empty rows are not printed.
  }

  def write(a: A): Unit = write(format(a))

  override def close(): Unit = out.close()

  def contramap[B](f: B => A): CsvWriter[B] = new CsvWriter[B](out, sep, f andThen format)
}

package com.nrinaudo.csv

import java.io.{Closeable, PrintStream}

class CsvWriter[A] private[csv] (private val out: PrintStream, val sep: Char, private val format: A => List[String])
  extends Closeable {

  private def escape(str: String): String =
    if(str.contains("\""))                                                  "\"" + str.replaceAll("\"", "\"\"") + "\""
    else if (str.contains(sep) || str.contains("\n") || str.contains("\r")) "\"" + str + "\""
    else                                                                    str

  private def write(ss: List[String]): Unit = ss.map(escape) match {
    case h :: t =>
      out.print(h)
      t.foreach { a =>
        out.print(sep)
        out.print(a)
      }
      out.println()
    case _ => // Empty rows are not printed.
  }

  def write(a: A): Unit = write(format(a))

  override def close(): Unit = out.close()

  def contramap[B](f: B => A): CsvWriter[B] = new CsvWriter[B](out, sep, f andThen format)
}

Fix separator issue when writing to CSV streams.

The separator ended up being hard-coded to ','.


name := "play-scala-intro"

version := "1.0-SNAPSHOT"

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

scalaVersion := "%SCALA_VERSION%"

libraryDependencies ++= Seq(
  "com.typesafe.play" %% "play-slick" % "%PLAY_SLICK_VERSION%",
  "com.typesafe.play" %% "play-slick-evolutions" % "%PLAY_SLICK_VERSION%",
  "com.h2database" % "h2" % "1.4.177",
  specs2 % Test
)

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

name := "play-scala-intro"

version := "1.0-SNAPSHOT"

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

scalaVersion := "%SCALA_VERSION%"

libraryDependencies ++= Seq(
  "com.typesafe.play" %% "play-slick" % "%PLAY_SLICK_VERSION%",
  "com.typesafe.play" %% "play-slick-evolutions" % "%PLAY_SLICK_VERSION%",
  "com.h2database" % "h2" % "1.4.190",
  specs2 % Test
)

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

Use the latest version of H2 in play-scala-intro template


package scala.xml

import java.io._

object JavaByteSerialization {
  def roundTrip[T](obj: T): T = {
    def serialize(in: T): Array[Byte] = {
      val bos = new ByteArrayOutputStream()
      val oos = new ObjectOutputStream(bos)
      oos.writeObject(in)
      oos.flush()
      bos.toByteArray()
    }

    def deserialize(in: Array[Byte]): T = {
      val bis = new ByteArrayInputStream(in)
      val ois = new ObjectInputStream(bis)
      ois.readObject.asInstanceOf[T]
    }

    deserialize(serialize(obj))
  }
}

package scala.xml

import java.io._

object JavaByteSerialization {
  def roundTrip[T](obj: T): T = {
    deserialize[T](serialize[T](obj))
  }

  def serialize[T](in: T): Array[Byte] = {
    val bos = new ByteArrayOutputStream()
    val oos = new ObjectOutputStream(bos)
    oos.writeObject(in)
    oos.flush()
    bos.toByteArray()
  }

  def deserialize[T](in: Array[Byte]): T = {
    val bis = new ByteArrayInputStream(in)
    val ois = new ObjectInputStream(bis)
    ois.readObject.asInstanceOf[T]
  }
}

Make serialization test methods available


package strawman.collection

import scala.deprecated

package object generic {
  @deprecated("Clearable was moved from collection.generic to collection.mutable", "2.13.0")
  type Clearable = strawman.collection.mutable.Clearable
}

package strawman.collection

import scala.deprecated

package object generic {
  @deprecated("Clearable was moved from collection.generic to collection.mutable", "2.13.0")
  type Clearable = strawman.collection.mutable.Clearable
  @deprecated("Use scala.collection.BuildFrom instead", "2.13.0")
  type CanBuildFrom[-From, -A, +C] = strawman.collection.BuildFrom[From, A, C]
}

Add deprecated CanBuildFrom alias to BuildFrom


package net.ceedubs.ficus
package readers

import com.typesafe.config.ConfigFactory

class ConfigReaderSpec extends Spec with ConfigReader with AnyValReaders { def is =
  "The Config value reader should" ^
    "read a config" ! readConfig

  def readConfig = {
    val cfg = ConfigFactory.parseString(
      """
        |myConfig {
        |  myValue = true
        |}
      """.stripMargin)
    configValueReader.read(cfg, "myConfig").getBoolean("myValue") must beTrue
  }
}

package net.ceedubs.ficus
package readers

import com.typesafe.config.ConfigFactory

class ConfigReaderSpec extends Spec with ConfigReader with AnyValReaders { def is =
  "The Config value reader should" ^
    "read a config" ! readConfig

  def readConfig = prop { i: Int =>
    val cfg = ConfigFactory.parseString(
      s"""
        |myConfig {
        |  myValue = $i
        |}
      """.stripMargin)
    configValueReader.read(cfg, "myConfig").getInt("myValue") must beEqualTo(i)
  }
}

Use ScalaCheck for config reader spec

Use ScalaCheck for config reader spec


trait Equal[-A] {
  def equal(a1: A, a2: A): Boolean
}
object Test {
  implicit def TraversableEqual[CC[X] <: collection.TraversableLike[X, CC[X]] with Traversable[X], A: Equal]: Equal[CC[A]] = error("")
}

trait Equal[-A] {
  def equal(a1: A, a2: A): Boolean
}
object Test {
  implicit def TraversableEqual[CC[X] <: collection.TraversableLike[X, CC[X]] with Traversable[X], A: Equal]: Equal[CC[A]] = sys.error("")
}

Fix compilation of dotty sbt scripted tests


package ch.usi.inf.l3.sana.ooj.ast

import ch.usi.inf.l3.sana
import sana.tiny
import sana.ooj
import sana.calcj

import tiny.types.Type
import ooj.types.NullType
import calcj.ast.Constant

case object NullConstant extends Constant {
  type Value = Null

  def value: Null = ???

  val tpe: Type = NullType
}

package ch.usi.inf.l3.sana.ooj.ast

import ch.usi.inf.l3.sana
import sana.tiny
import sana.ooj
import sana.calcj

import tiny.types.Type
import ooj.types.{NullType, TypeUtils}
import calcj.ast.Constant

case object NullConstant extends Constant {
  type Value = Null

  def value: Null = ???

  val tpe: Type = NullType
}

case class StringConstant(value: String) extends Constant {
  type Value = String

  val tpe: Type = TypeUtils.stringClassType
}

Add a subclass of Constant to represent String lit


import scala.io.Source
/**
  * @author loustler
  * @since 01/14/2017 18:21
  */

def widthofLength(s: String)  = s.length.toString.length

// 예제와는 다름, travis에서 compile error를 방지 하기 위함
def wordCountInFile(fileName: String): Unit = {
  if (args.length > 0) {
    val lines = Source.fromFile(fileName).getLines().toList

    /**
      * Return longest line in lines.
      *
      * reduceLeft to LinearSeqOptimzed#reduceLeft(function)
      *
      * Reduce from left to right do function.
      *
      */
    val longestLine = lines.reduceLeft(
      (a, b) => if (a.length > b.length) a else b
    )

    val maxWidth  = widthofLength(longestLine)

    for ( line <- lines) {
      val numSpaces = maxWidth - widthofLength(line)
      val padding = " " * numSpaces
      println(padding + line.length + " | " + line)
    }
  }
  else
    Console.err.println("Please enter filename")
}

import scala.io.Source
/**
  * @author loustler
  * @since 01/14/2017 18:21
  */

/*
 * If you want to use it, remove the comment that encloses this scala script.

def widthofLength(s: String)  = s.length.toString.length

// 예제와는 다름, travis에서 compile error를 방지 하기 위함
def wordCountInFile(fileName: String): Unit = {
  if (args.length > 0) {
    val lines = Source.fromFile(fileName).getLines().toList

    /**
      * Return longest line in lines.
      *
      * reduceLeft to LinearSeqOptimzed#reduceLeft(function)
      *
      * Reduce from left to right do function.
      *
      */
    val longestLine = lines.reduceLeft(
      (a, b) => if (a.length > b.length) a else b
    )

    val maxWidth  = widthofLength(longestLine)

    for ( line <- lines) {
      val numSpaces = maxWidth - widthofLength(line)
      val padding = " " * numSpaces
      println(padding + line.length + " | " + line)
    }
  }
  else
    Console.err.println("Please enter filename")
}
*/

Fix compile error on travis-ci

Fix compile error on travis-ci

- Enclose script to use comment


package DB

import com.orm.SugarRecord

class Posts(app_name: String = "", app_url: String = "", app_id: String = "", content: String, entity: String, id: String, published: String, `type`: String) extends SugarRecord {

  val application_name = app_name
  val application_url = app_url
  val application_id = app_id
  val text = content
  val posting_entity = entity
  val post_id = id
  val published_at = published
  val post_type = `type`

}

package DB

import com.orm.SugarRecord
import android.content.Context

class Posts(context: Context, app_name: String = "", app_url: String = "", app_id: String = "", content: String, entity: String, id: String, published: String, `type`: String) extends SugarRecord(context: Context) {

  val application_name = app_name
  val application_url = app_url
  val application_id = app_id
  val text = content
  val posting_entity = entity
  val post_id = id
  val published_at = published
  val post_type = `type`

}

Add Context to fix stuff

Add Context to fix stuff


package org.http4s.client

import java.io.IOException
import java.net.InetSocketAddress

import org.http4s.blaze.util.TickWheelExecutor

import scala.concurrent.duration._

import scalaz.\/
import scalaz.concurrent.Strategy.DefaultExecutorService

package object blaze {

  type AddressResult = \/[IOException, InetSocketAddress]

  // Centralize some defaults
  private[blaze] val DefaultTimeout: Duration = 60.seconds
  private[blaze] val DefaultBufferSize: Int = 8*1024
  private[blaze] def ClientDefaultEC = DefaultExecutorService
  private[blaze] val ClientTickWheel = new TickWheelExecutor()

  /** Default blaze client */
  val defaultClient = SimpleHttp1Client(DefaultTimeout, DefaultBufferSize, ClientDefaultEC, None)
}

package org.http4s.client

import java.io.IOException
import java.net.InetSocketAddress
import java.util.concurrent.TimeUnit
import java.util.concurrent._

import org.http4s.blaze.util.TickWheelExecutor

import scala.concurrent.duration._

import scalaz.\/

package object blaze {

  type AddressResult = \/[IOException, InetSocketAddress]

  // Centralize some defaults
  private[blaze] val DefaultTimeout: Duration = 60.seconds
  private[blaze] val DefaultBufferSize: Int = 8*1024
  private[blaze] val ClientDefaultEC = {
    val threadFactory = new ThreadFactory {
      val defaultThreadFactory = Executors.defaultThreadFactory()
      def newThread(r: Runnable): Thread = {
        val t = defaultThreadFactory.newThread(r)
        t.setDaemon(true)
        t
      }
    }

    new ThreadPoolExecutor(
      2,
      Runtime.getRuntime.availableProcessors() * 6,
      60L, TimeUnit.SECONDS,
      new LinkedBlockingQueue[Runnable](),
      threadFactory
    )
  }

  private[blaze] val ClientTickWheel = new TickWheelExecutor()

  /** Default blaze client */
  val defaultClient = SimpleHttp1Client(DefaultTimeout, DefaultBufferSize, ClientDefaultEC, None)
}

Change default blaze client Executor to a variable sized ExecutorService.


package org.http4s.server
package middleware

import cats.data.Kleisli
import cats._
import cats.implicits._
import org.http4s._

object ErrorHandling {

  def apply[F[_], G[_], A](k: Kleisli[F, Request[G], Response[G]])(
      implicit F: MonadError[F, Throwable],
      G: Applicative[G]): Kleisli[F, Request[G], Response[G]] =
    Kleisli { req =>
      val pf = inDefaultServiceErrorHandler[F, G](F, G)(req)
      k.run(req).handleErrorWith {
        case pf(resp) => resp
        case e => F.raiseError(e)
      }
    }

}

package org.http4s.server
package middleware

import cats.data.Kleisli
import cats._
import cats.implicits._
import org.http4s._

object ErrorHandling {

  def apply[F[_], G[_], A](k: Kleisli[F, Request[G], Response[G]])(
      implicit F: MonadError[F, Throwable],
      G: Applicative[G]): Kleisli[F, Request[G], Response[G]] =
    Kleisli { req =>
      val pf: PartialFunction[Throwable, F[Response[G]]] = inDefaultServiceErrorHandler[F, G](F, G)(req)
      k.run(req).handleErrorWith { e =>
        pf.lift(e) match {
          case Some(resp)=> resp
          case None => F.raiseError(e)
        }
      }
    }

}

Use More Generic PartialFunction application


import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "liumsg"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,
    anorm,
    "com.wordnik" %% "swagger-play2-utils" % "1.2.4"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here
    resolvers := Seq(
      "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository",
      "sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
      "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases",
      "java-net" at "http://download.java.net/maven/2",
      "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"))
}

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "liumsg"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,
    anorm,
    "com.wordnik" %% "swagger-play2-utils" % "1.2.4"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here
    scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature"),
    resolvers := Seq(
      "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository",
      "sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
      "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases",
      "java-net" at "http://download.java.net/maven/2",
      "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"))
}

Add compiler flags for deprecated features


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

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

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

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

Revert "Upgrade sbt-codacy-coverage plugin 1.2.1 -> 1.3.0"

This reverts commit c3d9a3d0d15f38940b1f44d642d0e5dcd1a45ff1.


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

val sbtSoftwareMillVersion = "1.9.14"
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("ch.epfl.lamp" % "sbt-dotty" % "0.4.5")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.12")

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

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

val sbtSoftwareMillVersion = "1.9.14"
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("ch.epfl.lamp" % "sbt-dotty" % "0.4.5")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.12")

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

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


logLevel := Level.Warn

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

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") // fot sbt-0.13.5 or higher

Add Sbt plugin for sonatype

Add Sbt plugin for sonatype


//addSbtPlugin(("com.typesafe.sbt" % "sbt-pgp" % "0.7").cross(CrossVersion.full))

Disable pgp while pushing to mth.io for now.

Former-commit-id: 408563f137396975c4387a2cf9ed04a9fc1e9e86


package edu.agh.mindmap.model

import java.util.UUID

class MindMap private(val uuid: UUID,
                      val lastMod: Long,
                      isNew: Boolean) {

  val root = if (isNew) MindNode.create(this)
  else MindNode.findRootOf(this)

}

object MindMap {

  def create = {
    new MindMap(UUID.randomUUID, (new java.util.Date).getTime, true)
  }

  def findAll: List[MindMap] = {
    val a = create; a.root.content = Some("mapa A")
    val b = create; b.root.content = Some("mapa B")
    val c = create; c.root.content = Some("mapa C")

    a :: b :: c :: Nil
  }

}

package edu.agh.mindmap.model

import java.util.UUID

class MindMap private(val uuid: UUID,
                      val lastMod: Long,
                      isNew: Boolean) {

  val root = if (isNew) MindNode.create(this)
  else MindNode.findRootOf(this)

}

object MindMap {

  def create = {
    new MindMap(UUID.randomUUID, (new java.util.Date).getTime, true)
  }

  def findAll: List[MindMap] = {
    val a = create; a.root.content = Some("mapa A")
    val b = create; b.root.content = Some("mapa B")
    val c = create; c.root.content = Some("mapa C")

    a :: b :: c :: Nil
  }

  def importFrom(file: Nothing): MindMap = ???

}

Add XMind importing method stub

Add XMind importing method stub


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

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

  lazy val jodaTime = Seq(
    "joda-time" % "joda-time" % "2.10.14",
    "org.joda" % "joda-convert" % "2.2.2"
  )
  lazy val jackson = Seq(
    "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.3"
  )
  lazy val scalaz_core = Def.setting(
    "org.scalaz" %%% "scalaz-core" % "7.3.6"
  )
  lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.8"
  lazy val scalatest = Def.setting(
    Seq("org.scalatest" %%% "scalatest-wordspec" % "3.2.12" % "test")
  )
  lazy val scalatestScalacheck = Def.setting(
    Seq("org.scalatestplus" %%% "scalacheck-1-16" % "3.2.12.0" % "test")
  )

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

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

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

  lazy val jodaTime = Seq(
    "joda-time" % "joda-time" % "2.10.14",
    "org.joda" % "joda-convert" % "2.2.2"
  )
  lazy val jackson = Seq(
    "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.3"
  )
  lazy val scalaz_core = Def.setting(
    "org.scalaz" %%% "scalaz-core" % "7.3.6"
  )
  lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.8"
  lazy val scalatest = Def.setting(
    Seq("org.scalatest" %%% "scalatest-wordspec" % "3.2.12" % "test")
  )
  lazy val scalatestScalacheck = Def.setting(
    Seq("org.scalatestplus" %%% "scalacheck-1-16" % "3.2.13.0" % "test")
  )

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

Update scalacheck-1-16 to 3.2.13.0 in master


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

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

  lazy val jodaTime = Seq(
    "joda-time" % "joda-time" % "2.11.2",
    "org.joda" % "joda-convert" % "2.2.2"
  )
  lazy val jackson = Seq(
    "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4"
  )
  lazy val scalaz_core = Def.setting(
    "org.scalaz" %%% "scalaz-core" % "7.3.6"
  )
  lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.8"
  lazy val scalatest = Def.setting(
    Seq("org.scalatest" %%% "scalatest-wordspec" % "3.2.14" % "test")
  )
  lazy val scalatestScalacheck = Def.setting(
    Seq("org.scalatestplus" %%% "scalacheck-1-16" % "3.2.13.0" % "test")
  )

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

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

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

  lazy val jodaTime = Seq(
    "joda-time" % "joda-time" % "2.11.2",
    "org.joda" % "joda-convert" % "2.2.2"
  )
  lazy val jackson = Seq(
    "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4"
  )
  lazy val scalaz_core = Def.setting(
    "org.scalaz" %%% "scalaz-core" % "7.3.6"
  )
  lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.8"
  lazy val scalatest = Def.setting(
    Seq("org.scalatest" %%% "scalatest-wordspec" % "3.2.14" % "test")
  )
  lazy val scalatestScalacheck = Def.setting(
    Seq("org.scalatestplus" %%% "scalacheck-1-16" % "3.2.14.0" % "test")
  )

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

Update scalacheck-1-16 to 3.2.14.0 in master


package knub.master_thesis

import java.io.File
import java.util.regex.Pattern

import cc.mallet.pipe.{Pipe, SerialPipes}
import cc.mallet.pipe._

import scala.collection.mutable
import scala.collection.JavaConverters._

object PreprocessingPipe {
    def pipeList(stopWordsFileName: String): mutable.ArrayBuffer[Pipe] = {

        mutable.ArrayBuffer[Pipe](
            new CharSequenceLowercase(),
            // Regex explanation: lowercase [lowercase punctuation]+ lowercase  --- at least three characters,
            // no punctuation at the end
            new CharSequence2TokenSequence(Pattern.compile("\\p{L}[\\p{L}\\p{P}]+\\p{L}")),
            new UseOnlyFirstNWordsOfDocument(1000),
            new TokenSequenceRemoveStopwords(
                new File(stopWordsFileName), "UTF-8", false, false, false),
            new TokenSequence2FeatureSequence()
        )
    }
    def pipe(stopWordsFileName: String): Pipe = {
        new SerialPipes(pipeList(stopWordsFileName).asJava)

    }
}

package knub.master_thesis

import java.io.File
import java.util.regex.Pattern

import cc.mallet.pipe.{Pipe, SerialPipes}
import cc.mallet.pipe._

import scala.collection.mutable
import scala.collection.JavaConverters._

object PreprocessingPipe {
    def pipeList(stopWordsFileName: String): mutable.ArrayBuffer[Pipe] = {

        mutable.ArrayBuffer[Pipe](
            new CharSequenceLowercase(),
            // Regex explanation: lowercase [lowercase punctuation]+ lowercase  --- at least three characters,
            // no punctuation at the end
            new CharSequence2TokenSequence(Pattern.compile("\\p{L}[\\p{L}\\p{P}]+\\p{L}")),
//            new UseOnlyFirstNWordsOfDocument(1000),
            new TokenSequenceRemoveStopwords(
                new File(stopWordsFileName), "UTF-8", false, false, false),
            new TokenSequence2FeatureSequence()
        )
    }
    def pipe(stopWordsFileName: String): Pipe = {
        new SerialPipes(pipeList(stopWordsFileName).asJava)

    }
}

Use all words in topic modelling

Use all words in topic modelling