package info.spielproject.spiel
package plugins

import dalvik.system._

import java.io.File
import java.net.URL
import java.util.Collections

import collection.JavaConversions._
import collection.mutable.ListBuffer

import android.content.Context
import android.util.Log

class Plugin

object PluginManager {

  private val plugins = ListBuffer[Plugin]()

  def apply(context:Context) {
    val foundPlugins:List[Class[_]] = try {
      val classLoader = context.getClassLoader
      val findResources = classOf[BaseDexClassLoader].getDeclaredMethod("findResources", classOf[String])
      findResources.setAccessible(true)
      val dexs = Collections.list[URL](findResources.invoke(classLoader, "classes.dex").asInstanceOf[java.util.Enumeration[URL]])
      dexs.map { dex =>
        val apk = dex.getFile.split(":").last.split("!").head
        val dexFile = new DexFile(apk)
        val entries = Collections.list[String](dexFile.entries)
        entries.map(utils.classForName(_)).flatten
        .filter { c =>
          c != classOf[Plugin] && classOf[Plugin].isAssignableFrom(c)
        }.toList
      }.toList.flatten
    } catch {
      case e =>
        Log.d("spielcheck", "Automatic plugin loading failed", e)
        Nil
    }
    plugins ++= foundPlugins.map(_.newInstance().asInstanceOf[Plugin])
  }

}

package info.spielproject.spiel
package plugins

import dalvik.system._

import java.io.File
import java.net.URL
import java.util.Collections

import collection.JavaConversions._
import collection.mutable.ListBuffer

import android.content.Context
import android.util.Log

class Plugin

object PluginManager {

  private val plugins = ListBuffer[Plugin]()

  def apply(context:Context) {
    val foundPlugins:List[Class[_]] = try {
      val classLoader = context.getClassLoader
      val findResources = classOf[BaseDexClassLoader].getDeclaredMethod("findResources", classOf[String])
      findResources.setAccessible(true)
      val dexs = Collections.list[URL](findResources.invoke(classLoader, "classes.dex").asInstanceOf[java.util.Enumeration[URL]])
      dexs.map { dex =>
        val apk = dex.getFile.split(":").last.split("!").head
        val dexFile = new DexFile(apk)
        val entries = Collections.list[String](dexFile.entries)
        entries.map(utils.classForName(_)).flatten
        .filter { c =>
          c != classOf[Plugin] && classOf[Plugin].isAssignableFrom(c)
        }.toList
      }.toList.flatten
    } catch {
      case e =>
        Log.d("spielcheck", "Automatic plugin loading failed", e)
        Nil
    }
    plugins ++= foundPlugins.map(_.newInstance().asInstanceOf[Plugin])
  }

  def plugin[T <: Plugin:ClassManifest]:List[T] =
    plugins.filter(classManifest[T].erasure.isInstance(_)).toList.asInstanceOf[List[T]]

}

Add method to look up a plugin by class.


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.61"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.62"

exportJars := true

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

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

autocommit: Update configuration to record version 0.0.62


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.44"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.45"

exportJars := true

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

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

autocommit: Update configuration to record version 0.0.45


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.7"

crossScalaVersions := Seq("2.11.7")

version := "0.0.48"

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

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

import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.7"

crossScalaVersions := Seq("2.11.7")

version := "0.0.49"

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

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

autocommit: Update configuration to record version 0.0.49


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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

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

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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

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

autocommit: Update configuration to record version 0.1.3


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

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

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

// silence all warnings on autogenerated files
scalacOptions += "-P:silencer:pathFilters=src/main/scala/io/flow/generated/.*"

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

version := "0.2.19"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

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

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

// silence all warnings on autogenerated files
scalacOptions += "-P:silencer:pathFilters=src/main/scala/io/flow/generated/.*"

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

version := "0.2.20"

autocommit: Update configuration to record version 0.2.20


name := "play-mockws"

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

organization := "de.leanovate.play-mockws"

val playVersion = "2.7.3"

fork := true

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

libraryDependencies ++= Seq(
  "com.typesafe.play" %% "play"        % playVersion % "provided",
  "com.typesafe.play" %% "play-ahc-ws" % playVersion % "provided",
  "com.typesafe.play" %% "play-test"   % playVersion % "provided"
)

libraryDependencies ++= Seq(
  "org.scalatest"  %% "scalatest"   % "3.0.8",
  "org.scalacheck" %% "scalacheck"  % "1.14.3",
  "org.mockito"    % "mockito-core" % "3.2.4"
).map(_ % Test)

Release.settings

name := "play-mockws"

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

organization := "de.leanovate.play-mockws"

val playVersion = "2.7.3"

fork := true

resolvers += "Typesafe repository".at("https://repo.typesafe.com/typesafe/releases/")

libraryDependencies ++= Seq(
  "com.typesafe.play" %% "play"        % playVersion % "provided",
  "com.typesafe.play" %% "play-ahc-ws" % playVersion % "provided",
  "com.typesafe.play" %% "play-test"   % playVersion % "provided"
)

libraryDependencies ++= Seq(
  "org.scalatest"  %% "scalatest"   % "3.0.8",
  "org.scalacheck" %% "scalacheck"  % "1.14.3",
  "org.mockito"    % "mockito-core" % "3.2.4"
).map(_ % Test)

Release.settings

Use HTTPS for typesafe resolver URL

Use HTTPS for typesafe resolver URL

```
[warn] insecure HTTP request is deprecated http://repo.typesafe.com/typesafe/releases/; switch to HTTPS ...
```


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.33"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.34"

exportJars := true

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

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

autocommit: Update configuration to record version 0.1.34


package org.jetbrains.plugins.scala
package findUsages

import com.intellij.psi._
import impl.search.{SimpleAccessorReferenceSearcher, MethodTextOccurrenceProcessor, ConstructorReferencesSearchHelper}
import search.searches.{MethodReferencesSearch, ReferencesSearch}
import search.{UsageSearchContext, SearchScope, SearchRequestCollector}
import com.intellij.openapi.application.QueryExecutorBase
import com.intellij.util.Processor
import org.jetbrains.annotations.NotNull
import org.jetbrains.plugins.scala.util.ScalaUtils

/**
 * Searches for scala methods defined inside of local scopes, ie methods for which .getContainingClass == null.
 *
 * These are not considered by [com.intellij.psi.impl.search.MethodUsagesSearcher]
 */
class NonMemberMethodUsagesSearcher extends QueryExecutorBase[PsiReference, MethodReferencesSearch.SearchParameters] {
  def processQuery(@NotNull p: MethodReferencesSearch.SearchParameters, @NotNull consumer: Processor[PsiReference]) {
    val method: PsiMethod = p.getMethod
    val collector: SearchRequestCollector = p.getOptimizer
    val searchScope: SearchScope = p.getScope
    var result = false
    ScalaUtils.runReadAction(new Runnable {
      def run() {
        result = method.isConstructor
      }
    }, method.getProject, "NonMemberMethodUsagesSearcher")
    if (result) {
      return
    }
    ReferencesSearch.searchOptimized(method, searchScope, false, collector, consumer)
  }
}

package org.jetbrains.plugins.scala
package findUsages

import com.intellij.psi._
import impl.search.{SimpleAccessorReferenceSearcher, MethodTextOccurrenceProcessor, ConstructorReferencesSearchHelper}
import search.searches.{MethodReferencesSearch, ReferencesSearch}
import search.{UsageSearchContext, SearchScope, SearchRequestCollector}
import com.intellij.openapi.application.QueryExecutorBase
import com.intellij.util.Processor
import org.jetbrains.annotations.NotNull
import org.jetbrains.plugins.scala.util.ScalaUtils

/**
 * Searches for scala methods defined inside of local scopes, ie methods for which .getContainingClass == null.
 *
 * These are not considered by [com.intellij.psi.impl.search.MethodUsagesSearcher]
 */
class NonMemberMethodUsagesSearcher extends QueryExecutorBase[PsiReference, MethodReferencesSearch.SearchParameters] {
  def processQuery(@NotNull p: MethodReferencesSearch.SearchParameters, @NotNull consumer: Processor[PsiReference]) {
    val method: PsiMethod = p.getMethod
    val collector: SearchRequestCollector = p.getOptimizer
    val searchScope: SearchScope = p.getScope
    val newConsumer = new Processor[PsiReference] {
      def process(t: PsiReference): Boolean = {
        if (!method.isConstructor) return false
        consumer.process(t)
      }
    }
    ReferencesSearch.searchOptimized(method, searchScope, false, collector, newConsumer)
  }
}

Read action access (right fix).

Read action access (right fix).


package dotc

import test._

object comptest extends CompilerTest {

  val posDir = "/Users/odersky/workspace/dotty/tests/pos/"
  val negDir = "/Users/odersky/workspace/dotty/tests/neg/"
  val dotcDir = "/Users/odersky/workspace/dotty/src/dotty/"

  def main(args: Array[String]) =
    compileArgs(Array(
      dotcDir + "tools/dotc/CompilationUnit.scala",
      dotcDir + "tools/dotc/core/Types.scala",
      dotcDir + "tools/dotc/ast/Trees.scala",
      "#runs", "2",
      "-Ylog:frontend",
      "-Xprompt"))

//    compileDir(dotcDir + "tools/dotc/printing", List("-Xprompt", "-Ylog:frontend", "#runs", "2", "-uniqid"))
}

package dotc

import test._

object comptest extends CompilerTest {

  val posDir = "./tests/pos/"
  val negDir = "./tests/neg/"
  val dotcDir = "./src/dotty/"

  def main(args: Array[String]) =
    compileArgs(Array(
      dotcDir + "tools/dotc/CompilationUnit.scala",
      dotcDir + "tools/dotc/core/Types.scala",
      dotcDir + "tools/dotc/ast/Trees.scala",
      "#runs", "2",
      "-Ylog:frontend",
      "-Xprompt"))

//    compileDir(dotcDir + "tools/dotc/printing", List("-Xprompt", "-Ylog:frontend", "#runs", "2", "-uniqid"))
}

Update some paths to relative

Update some paths to relative


package fr.janalyse.split

import scala.annotation.tailrec

object CsvSplit {

  /**
   * Smart CSV oriented line split that takes into account quote, double quotes.
   *
   * @param line     the line to split into a vector a substrings
   * @param sep      the cell separator
   * @param maxcount max size for the results vector
   * @return vector of substrings
   */
  final def split(line: String, sep: Char = ',', maxcount: Int = 0): Vector[String] = {
    def isSpace(ch: Char): Boolean = ch.isSpaceChar || ch == '\r' || ch == '\t'
    @tailrec
    def worker(me: String, accumulator: Vector[String] = Vector.empty, hasNext:Boolean=false): Vector[String] = {
      if (me.isEmpty) {
        if (hasNext) accumulator:+"" else accumulator
      } else {
        val ch = me.head
        if (isSpace(ch)) worker(me.tail, accumulator, hasNext)
        else if (maxcount > 0 && accumulator.size + 1 == maxcount) accumulator :+ me.trim
        else if (ch == '"' || ch == '\'') {
          val (left, right) = me.tail.span(_ != ch)
          worker(right.tail.trim.drop(1), accumulator :+ left)
        } else {
          val (left, right) = me.span(_ != sep)
          worker(right.trim.drop(1), accumulator :+ left.trim, !right.isEmpty)
        }
      }
    }
    worker(line)
  }
}

package fr.janalyse.split

import scala.annotation.tailrec

object CsvSplit {

  /**
   * Smart CSV oriented line split that takes into account quote, double quotes.
   *
   * @param line     the line to split into a vector a substrings
   * @param sep      the cell separator
   * @param maxcount max size for the results vector
   * @return vector of substrings
   */
  final def split(line: String, sep: Char = ',', maxcount: Int = 0): Vector[String] = {
    def isSpace(ch: Char): Boolean = ch.isSpaceChar || ch == '\r' || ch == '\t'
    @tailrec
    def worker(me: String, accumulator: Vector[String] = Vector.empty, hasNext:Boolean=false): Vector[String] = {
      if (me.isEmpty) {
        if (hasNext) accumulator:+"" else accumulator
      } else {
        val ch = me.head
        if (isSpace(ch)) worker(me.tail, accumulator, hasNext)
        else if (maxcount > 0 && accumulator.size + 1 == maxcount) accumulator :+ me.trim
        else if (ch == '"' || ch == '\'') {
          val (left, right) = me.tail.span(_ != ch)
          worker(right.drop(1).trim.drop(1), accumulator :+ left)
        } else {
          val (left, right) = me.span(_ != sep)
          worker(right.trim.drop(1), accumulator :+ left.trim, !right.isEmpty)
        }
      }
    }
    worker(line)
  }
}

Fix for older scala release

Fix for older scala release


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.95"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.96"

exportJars := true

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

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

autocommit: Update configuration to record version 0.0.96


import ReleaseTransformations._

sbtPlugin := true

name := "sbt-protoc"

organization := "com.trueaccord.scalapb"

libraryDependencies ++= Seq(
  "com.trueaccord.scalapb" %% "protoc-bridge" % "0.1"
)

scalacOptions += "-target:jvm-1.7"

releasePublishArtifactsAction := PgpKeys.publishSigned.value

releaseProcess := Seq[ReleaseStep](
  checkSnapshotDependencies,
  inquireVersions,
  runClean,
  runTest,
  setReleaseVersion,
  commitReleaseVersion,
  tagRelease,
  ReleaseStep(action = Command.process("publishSigned", _)),
  setNextVersion,
  commitNextVersion,
  pushChanges,
  ReleaseStep(action = Command.process("sonatypeReleaseAll", _))
)

import ReleaseTransformations._

sbtPlugin := true

name := "sbt-protoc"

organization := "com.trueaccord.scalapb"

libraryDependencies ++= Seq(
  "com.trueaccord.scalapb" %% "protoc-bridge" % "0.1.4"
)

scalacOptions += "-target:jvm-1.7"

releasePublishArtifactsAction := PgpKeys.publishSigned.value

releaseProcess := Seq[ReleaseStep](
  checkSnapshotDependencies,
  inquireVersions,
  runClean,
  runTest,
  setReleaseVersion,
  commitReleaseVersion,
  tagRelease,
  ReleaseStep(action = Command.process("publishSigned", _)),
  setNextVersion,
  commitNextVersion,
  pushChanges,
  ReleaseStep(action = Command.process("sonatypeReleaseAll", _))
)

Update protoc bridge dependency to 0.1.4


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

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

version := "0.2.3"

exportJars := true

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

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

credentials += Credentials(
  "Artifactory Realm",
  "flow.jfrog.io",
  System.getenv("ARTIFACTORY_USERNAME"),
  System.getenv("ARTIFACTORY_PASSWORD")
)

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

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

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.7"

version := "0.2.4"

exportJars := true

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

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

credentials += Credentials(
  "Artifactory Realm",
  "flow.jfrog.io",
  System.getenv("ARTIFACTORY_USERNAME"),
  System.getenv("ARTIFACTORY_PASSWORD")
)

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

autocommit: Update configuration to record version 0.2.4


val franklin_heisenberg_bridge = Project(id = "franklin-heisenberg-bridge", base = file("."))
  .settings(
    organization := "se.gigurra",
    version := getVersion,
    scalaVersion := "2.11.7",
    scalacOptions ++= Seq("-feature", "-unchecked", "-deprecation"),

    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest"    % "2.2.4"   % "test",
      "org.mockito"   % "mockito-core"  % "1.10.19" % "test"
    ),

    resolvers += "Typesafe Releases" at "https://repo.typesafe.com/typesafe/releases/"
  )
  .dependsOn(uri("git://github.com/GiGurra/franklin.git#0.1.10"))
  .dependsOn(uri("git://github.com/GiGurra/heisenberg.git#0.2.6"))

def getVersion: String = {

  val v = scala.util.Properties.envOrNone("FRANKLIN_HEISENBERG_BRIDGE_VERSION").getOrElse {
    println(s"No 'FRANKLIN_HEISENBERG_BRIDGE_VERSION' defined - defaulting to SNAPSHOT")
    "SNAPSHOT"
  }

  println(s"Building Franklin Heisenberg Bridge v. $v")
  v
}

val franklin_heisenberg_bridge = Project(id = "franklin-heisenberg-bridge", base = file("."))
  .settings(
    organization := "se.gigurra",
    version := getVersion,
    scalaVersion := "2.11.7",
    scalacOptions ++= Seq("-feature", "-unchecked", "-deprecation"),

    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest"    % "2.2.4"   % "test",
      "org.mockito"   % "mockito-core"  % "1.10.19" % "test"
    ),

    resolvers += "Typesafe Releases" at "https://repo.typesafe.com/typesafe/releases/"
  )
  .dependsOn(uri("https://github.com/GiGurra/franklin.git#0.1.10"))
  .dependsOn(uri("https://github.com/GiGurra/heisenberg.git#0.2.6"))

def getVersion: String = {

  val v = scala.util.Properties.envOrNone("FRANKLIN_HEISENBERG_BRIDGE_VERSION").getOrElse {
    println(s"No 'FRANKLIN_HEISENBERG_BRIDGE_VERSION' defined - defaulting to SNAPSHOT")
    "SNAPSHOT"
  }

  println(s"Building Franklin Heisenberg Bridge v. $v")
  v
}

Change to github dependencies using https


name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

version := "0.3.6"

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

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

name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

version := "0.3.7"

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

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

autocommit: Update configuration to record version 0.3.7


organization := "com.allstarcvs"

name := "tbone"

version := "0.1.0-SNAPSHOT"

// scalaVersion := "2.11.5"

// exclude scala-lang dependency in pom
autoScalaLibrary := false

// disable using the Scala version in output paths and artifacts
crossPaths := false

// disable Java8 javadoc errors
javacOptions ++= Seq("-Xdoclint:none")

libraryDependencies ++= Seq(
	"org.teavm" % "teavm-dom" % "0.2.1",
	"org.teavm" % "teavm-html4j" % "0.2.1"
)

libraryDependencies ++= Seq(
  "junit"             % "junit"           % "4.12"  % "test"
)

publishTo := {
  if (isSnapshot.value)
	Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository")))
  else
	Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository")))
}

organization := "com.allstarcvs"

name := "tbone"

version := "0.1.0-SNAPSHOT"

// scalaVersion := "2.11.5"

// exclude scala-lang dependency in pom
autoScalaLibrary := false

// disable using the Scala version in output paths and artifacts
crossPaths := false

// disable Java8 javadoc errors
javacOptions ++= Seq("-Xdoclint:none")

libraryDependencies ++= Seq(
	"org.teavm" % "teavm-classlib" % "0.2.1" % "provided",
	"org.teavm" % "teavm-jso" % "0.2.1" % "provided",
	"org.teavm" % "teavm-dom" % "0.2.1" % "provided",
	"org.teavm" % "teavm-html4j" % "0.2.1" % "provided"
)

libraryDependencies ++= Seq(
  "junit"             % "junit"           % "4.12"  % "test"
)

publishTo := {
  if (isSnapshot.value)
	Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository")))
  else
	Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository")))
}

Add missing library and "provided" scope. But still not working correctly when being depended by other projects.


name := """play-java"""

version := "1.0-SNAPSHOT"

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

scalaVersion := "2.11.6"

libraryDependencies ++= Seq(
  "be.objectify"  %% "deadbolt-java"     % "2.4.4",
  "com.feth"      %% "play-authenticate" % "0.7.1",
  "org.mongodb" % "mongo-java-driver" % "3.2.1",
  "org.mongodb.morphia" % "morphia" % "1.0.1",
  "org.mongodb.morphia" % "morphia-logging-slf4j" % "1.0.1",
  "org.mongodb.morphia" % "morphia-validation" % "1.0.1",
  "org.webjars" % "bootstrap" % "3.0.0",
  javaJdbc,
  cache,
  javaWs
)

resolvers ++= Seq(
  "Apache" at "http://repo1.maven.org/maven2/",
  "jBCrypt Repository" at "http://repo1.maven.org/maven2/org/",
  Resolver.url("Objectify Play Repository", url("http://schaloner.github.io/releases/"))(Resolver.ivyStylePatterns),
  "play-authenticate (release)" at "http://joscha.github.io/play-authenticate/repo/releases/",
  "play-authenticate (snapshot)" at "http://joscha.github.io/play-authenticate/repo/snapshots/"
)

name := """play-java"""

version := "1.0-SNAPSHOT"

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

scalaVersion := "2.11.6"

libraryDependencies ++= Seq(
  "be.objectify"  %% "deadbolt-java"     % "2.4.4",
  "com.feth"      %% "play-authenticate" % "0.7.1",
  "org.mongodb" % "mongo-java-driver" % "3.2.1",
  "org.mongodb.morphia" % "morphia" % "1.0.1",
  "org.mongodb.morphia" % "morphia-logging-slf4j" % "1.0.1",
  "org.mongodb.morphia" % "morphia-validation" % "1.0.1",
  "org.webjars" % "bootstrap" % "3.0.0",
  "org.seleniumhq.selenium" % "selenium-java" % "2.52.0" % "test",
  javaJdbc,
  cache,
  javaWs
)

resolvers ++= Seq(
  "Apache" at "http://repo1.maven.org/maven2/",
  "jBCrypt Repository" at "http://repo1.maven.org/maven2/org/",
  Resolver.url("Objectify Play Repository", url("http://schaloner.github.io/releases/"))(Resolver.ivyStylePatterns),
  "play-authenticate (release)" at "http://joscha.github.io/play-authenticate/repo/releases/",
  "play-authenticate (snapshot)" at "http://joscha.github.io/play-authenticate/repo/snapshots/"
)

Upgrade selenium-java to 2.52.0, 2.44.0 has a bug not able to load sslContext


package io.flow.oneapi

case class Module(name: String, serviceNames: Seq[String])

object Module {

  val General = Module("general", Seq("common", "healthcheck", "organization", "search", "token", "user"))
  val Webhook = Module("webhook", Seq("webhook"))

  val All = Seq(
    Module("localization", Seq("catalog", "experience")),
    Module("pricing", Seq("currency")),
    Module("landed cost", Seq("harmonization")),
    Module("payment", Seq("payment")),
    Module("logistics", Seq("fulfillment", "inventory", "label", "ratecard", "return", "tracking")),
    Webhook,
    Module("customer service", Nil),
    Module("geolocation", Seq("location")),
    Module("reference", Seq("reference")),
    Module("partner", Seq("partner")),
    General
  )

  def findByServiceName(name: String): Option[Module] = {
    All.find(_.serviceNames.contains(name.toLowerCase))
  }

  def findByModuleName(name: String): Option[Module] = {
    All.find(_.name == name.toLowerCase)
  }

  def moduleSortIndex(name: String): Int = {
    val module = findByModuleName(name).getOrElse {
      sys.error(s"Invalid module[$name]")
    }

    val i = All.indexOf(module)
    assert(i >= 0, s"Could not find module: $module")
    i
  }
}

package io.flow.oneapi

case class Module(name: String, serviceNames: Seq[String])

object Module {

  val General = Module("general", Seq("common", "healthcheck", "organization", "search", "session", "token", "user"))
  val Webhook = Module("webhook", Seq("webhook"))

  val All = Seq(
    Module("localization", Seq("catalog", "experience")),
    Module("pricing", Seq("currency")),
    Module("landed cost", Seq("harmonization")),
    Module("payment", Seq("payment")),
    Module("logistics", Seq("fulfillment", "inventory", "label", "ratecard", "return", "tracking")),
    Webhook,
    Module("customer service", Nil),
    Module("geolocation", Seq("location")),
    Module("reference", Seq("reference")),
    Module("partner", Seq("partner")),
    General
  )

  def findByServiceName(name: String): Option[Module] = {
    All.find(_.serviceNames.contains(name.toLowerCase))
  }

  def findByModuleName(name: String): Option[Module] = {
    All.find(_.name == name.toLowerCase)
  }

  def moduleSortIndex(name: String): Int = {
    val module = findByModuleName(name).getOrElse {
      sys.error(s"Invalid module[$name]")
    }

    val i = All.indexOf(module)
    assert(i >= 0, s"Could not find module: $module")
    i
  }
}

Add session to general module

Add session to general module


package hmda.query.repository.institutions

import java.time.{Instant, LocalDateTime, ZoneId}

import hmda.model.institution.Institution
import hmda.query.model.institutions.InstitutionQuery

import scala.language.implicitConversions
import scala.util.Try

object InstitutionConverter {

  implicit def toInstitutionQuery(i: Institution): InstitutionQuery = {
    val dateTime = LocalDateTime.ofInstant(Instant.now(), ZoneId.systemDefault())
    val emails = i.emailDomains.toList
    val year = dateTime.getYear
    InstitutionQuery(
      i.id,
      i.agency.value,
      year,
      i.activityYear,
      i.respondent.externalId.id,
      i.institutionType.entryName,
      i.cra,
      Try(emails(0)).getOrElse(""),
      Try(emails(1)).getOrElse(""),
      Try(emails(2)).getOrElse(""),
      i.respondent.name,
      i.respondent.state,
      i.respondent.city,
      i.respondent.fipsStateNumber,
      i.hmdaFilerFlag,
      i.parent.respondentId,
      i.parent.idRssd,
      i.parent.name,
      i.parent.city,
      i.parent.state,
      i.assets,
      i.otherLenderCode,
      i.topHolder.idRssd,
      i.topHolder.name,
      i.topHolder.city,
      i.topHolder.state,
      i.topHolder.country
    )
  }
}

package hmda.query.repository.institutions

import java.time.{ Instant, LocalDateTime, ZoneId }

import hmda.model.institution.Institution
import hmda.query.model.institutions.InstitutionQuery

import scala.language.implicitConversions
import scala.util.Try

object InstitutionConverter {

  implicit def toInstitutionQuery(i: Institution): InstitutionQuery = {
    val dateTime = LocalDateTime.ofInstant(Instant.now(), ZoneId.systemDefault())
    val emails = i.emailDomains.toList
    val year = dateTime.getYear
    InstitutionQuery(
      i.id,
      i.agency.value,
      year,
      i.activityYear,
      i.respondent.externalId.id,
      i.institutionType.entryName,
      i.cra,
      Try(emails(0)).getOrElse(""),
      Try(emails(1)).getOrElse(""),
      Try(emails(2)).getOrElse(""),
      i.respondent.name,
      i.respondent.state,
      i.respondent.city,
      i.respondent.fipsStateNumber,
      i.hmdaFilerFlag,
      i.parent.respondentId,
      i.parent.idRssd,
      i.parent.name,
      i.parent.city,
      i.parent.state,
      i.assets,
      i.otherLenderCode,
      i.topHolder.idRssd,
      i.topHolder.name,
      i.topHolder.city,
      i.topHolder.state,
      i.topHolder.country
    )
  }
}

Format imports correctly for compiler

Format imports correctly for compiler


lazy val specs2Version = "4.8.1"
lazy val catsVersion   = "2.0.0"

libraryDependencies in Global ++=
  cats ++
  specs2

resolvers ++= Seq(
    Resolver.sonatypeRepo("releases")
  , Resolver.typesafeRepo("releases")
  , Resolver.url("ambiata-oss", new URL("https://ambiata-oss.s3.amazonaws.com"))(Resolver.ivyStylePatterns))

lazy val cats = Seq(
  "org.typelevel" %% "cats-core" % catsVersion)

lazy val specs2 = Seq(
    "org.specs2" %% "specs2-core"
  , "org.specs2" %% "specs2-matcher-extra"
  , "org.specs2" %% "specs2-scalacheck"
  , "org.specs2" %% "specs2-html"
  , "org.specs2" %% "specs2-junit").map(_ % specs2Version % "test")

lazy val specs2Version = "4.8.3"
lazy val catsVersion   = "2.0.0"

libraryDependencies in Global ++=
  cats ++
  specs2

resolvers ++= Seq(
    Resolver.sonatypeRepo("releases")
  , Resolver.typesafeRepo("releases")
  , Resolver.url("ambiata-oss", new URL("https://ambiata-oss.s3.amazonaws.com"))(Resolver.ivyStylePatterns))

lazy val cats = Seq(
  "org.typelevel" %% "cats-core" % catsVersion)

lazy val specs2 = Seq(
    "org.specs2" %% "specs2-core"
  , "org.specs2" %% "specs2-matcher-extra"
  , "org.specs2" %% "specs2-scalacheck"
  , "org.specs2" %% "specs2-html"
  , "org.specs2" %% "specs2-junit").map(_ % specs2Version % "test")

Update specs2-core, specs2-html, ... to 4.8.3


package org.langmeta.internal

import java.io.File
import java.io.FileOutputStream
import org.langmeta.internal.semanticdb.{vfs => v}
import org.langmeta.io._
import scala.meta.internal.{semanticdb3 => s}

package object semanticdb {
  final val DeprecationMessage =
    "This API is no longer suppported. Use scala.meta.internal.semanticdb3._ instead, but note that this API is subject to breaking changes without notice."
  implicit class XtensionSchemaTextDocuments(sdocuments: s.TextDocuments) {
    def toVfs(targetroot: AbsolutePath): v.Database = {
      val ventries = sdocuments.documents.toIterator.map { sentry =>
        // TODO: Would it make sense to support multiclasspaths?
        // One use-case for this would be in-place updates of semanticdb files.
        val vpath = v.SemanticdbPaths.fromScala(RelativePath(sentry.uri))
        val fragment = Fragment(targetroot, vpath)
        val bytes = s.TextDocuments(List(sentry)).toByteArray
        v.Entry.InMemory(fragment, bytes)
      }
      v.Database(ventries.toList)
    }
  }

  implicit class XtensionSymbolInformationProperty(info: s.SymbolInformation) {
    def has(prop: s.SymbolInformation.Property): Boolean =
      (info.properties & prop.value) != 0
  }

}

package org.langmeta.internal

import java.io.File
import java.io.FileOutputStream
import org.langmeta.internal.semanticdb.{vfs => v}
import org.langmeta.io._
import scala.meta.internal.{semanticdb3 => s}

package object semanticdb {
  final val DeprecationMessage =
    "This API is no longer supported. Use scala.meta.internal.semanticdb3._ instead, but note that this API is subject to binary and source breaking changes without notice."
  implicit class XtensionSchemaTextDocuments(sdocuments: s.TextDocuments) {
    def toVfs(targetroot: AbsolutePath): v.Database = {
      val ventries = sdocuments.documents.toIterator.map { sentry =>
        // TODO: Would it make sense to support multiclasspaths?
        // One use-case for this would be in-place updates of semanticdb files.
        val vpath = v.SemanticdbPaths.fromScala(RelativePath(sentry.uri))
        val fragment = Fragment(targetroot, vpath)
        val bytes = s.TextDocuments(List(sentry)).toByteArray
        v.Entry.InMemory(fragment, bytes)
      }
      v.Database(ventries.toList)
    }
  }

  implicit class XtensionSymbolInformationProperty(info: s.SymbolInformation) {
    def has(prop: s.SymbolInformation.Property): Boolean =
      (info.properties & prop.value) != 0
  }

}

Fix typo in deprecation message

Fix typo in deprecation message


addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")

// TODO: are the resolvers needed?
resolvers ++= Seq(Resolver.typesafeIvyRepo("releases"), Resolver.sbtPluginRepo("releases"))

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")

Revert "upgrade sbt-pgp to 2.1.2"

Revert "upgrade sbt-pgp to 2.1.2"

This reverts commit d3f219789bb3513199e89f940f1757591a9762ae.


package uk.gov.dvla.vehicles.presentation.common.views

import uk.gov.dvla.vehicles.presentation.common.helpers.UiSpec

import uk.gov.dvla.vehicles.presentation.common.pages
import uk.gov.dvla.vehicles.presentation.common
import common.helpers.webbrowser.TestHarness
import pages.VersionPage
import scala.io.Source.fromInputStream

class VersionIntegrationSpec extends UiSpec with TestHarness {
  "Version endpoint" should {
    "be declared and should include the build-details.txt from classpath" in new WebBrowser {
      go.to(VersionPage)
      val t = fromInputStream(getClass.getResourceAsStream("/build-details.txt")).getLines().toList

      info(s"""The class path build-details.txt "$t" should be contained in the verstion string "${page.source}"""")
      t.filterNot(page.source.lines.contains(_)) should be(empty)
    }
  }
}

package uk.gov.dvla.vehicles.presentation.common.views

import uk.gov.dvla.vehicles.presentation.common.helpers.UiSpec

import uk.gov.dvla.vehicles.presentation.common.pages
import uk.gov.dvla.vehicles.presentation.common
import common.helpers.webbrowser.TestHarness
import pages.VersionPage
import scala.io.Source.fromInputStream

class VersionIntegrationSpec extends UiSpec with TestHarness {
  "Version endpoint" should {
    "be declared and should include the build-details.txt from classpath" in new WebBrowser {
      go.to(VersionPage)
      val t = fromInputStream(getClass.getResourceAsStream("/build-details.txt")).getLines().toList

//      info(s"""The class path build-details.txt "$t" should be contained in the verstion string "${page.source}"""")
      t.filterNot(page.source.lines.contains(_)) should be(empty)
    }
  }
}

Remove a line that might have broke the build


/*
 * Copyright 2019 HM Revenue & Customs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package config

import com.google.inject.Inject
import uk.gov.hmrc.crypto.PlainText
import uk.gov.hmrc.play.bootstrap.filters.frontend.crypto.SessionCookieCrypto
import uk.gov.hmrc.play.partials.HeaderCarrierForPartialsConverter

class AmlsHeaderCarrierForPartialsConverter @Inject()(val sessionCookieCrypto: SessionCookieCrypto) extends HeaderCarrierForPartialsConverter {
  override def crypto: String => String = cookie => sessionCookieCrypto.crypto.encrypt(PlainText(cookie)).value
}

/*
 * Copyright 2019 HM Revenue & Customs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package config

import com.google.inject.Inject
import uk.gov.hmrc.crypto.PlainText
import uk.gov.hmrc.play.bootstrap.filters.frontend.crypto.SessionCookieCrypto
import uk.gov.hmrc.play.partials.HeaderCarrierForPartialsConverter

class AmlsHeaderCarrierForPartialsConverter @Inject()(val sessionCookieCrypto: SessionCookieCrypto) extends HeaderCarrierForPartialsConverter {
  override def crypto: String => String = identity
}

Fix to crypto for HC converter for Play 2.6


/**
  * Copyright 2015 Otto (GmbH & Co KG)
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
package org.schedoscope.dsl.transformations

import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.{SparkConf, SparkContext}

/**
  * Implements a simple Spark job that runs the Hive / SparkSQL statement passed as its argument.
  * As no result is returned, this makes only sense for running DDL statements.
  */
object SparkSQLRunner {

  def main(args: Array[String]) {

    val sc = new SparkContext(new SparkConf())
    val hc = new HiveContext(sc)

    try {

      if (args.length != 1)
        throw new IllegalArgumentException(s"Pass a SQL statement as an argument")

      val statement = args(0)

      println("Executing query:")
      println("================")
      println(statement)

      hc.sql(statement)

    } catch {
      case t: Throwable =>
        t.printStackTrace()
        System.exit(1)
    } finally
      sc.stop()

    System.exit(0)
  }
}

/**
  * Copyright 2015 Otto (GmbH & Co KG)
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
package org.schedoscope.dsl.transformations

import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.{SparkConf, SparkContext}

/**
  * Implements a simple Spark job that runs the Hive / SparkSQL statement passed as its argument.
  * As no result is returned, this makes only sense for running DDL statements.
  */
object SparkSQLRunner {

  def main(args: Array[String]) {

    val sc = new SparkContext(new SparkConf())
    val hc = new HiveContext(sc)

    try {

      if (args.length != 1)
        throw new IllegalArgumentException(s"Pass a SQL statement as an argument")

      val statement = args(0)

      println("Executing query:")
      println("================")
      println(statement)

      hc.sql(statement)

    } catch {
      case t: Throwable =>
        t.printStackTrace()
        System.exit(1)
    } finally
      sc.stop()

  }
}

Delete System.exit(0) since it produces exitCode 16 in Spark 2.2


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

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

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

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

Set project version to 0.3.14-BETA

Set project version to 0.3.14-BETA


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

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

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

addSbtPlugin("com.heroku" % "sbt-heroku" % "0.3.0")

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

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

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

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

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

addSbtPlugin("com.heroku" % "sbt-heroku" % "0.1.6")

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

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

Revert "sbt plugin version bumps"

Revert "sbt plugin version bumps"

This reverts commit 8f64397d778b14dfcec2dfe288a58be7f9a22a6f.

Build seem to fail consistently looking for org.jenkins-ci#annotation-indexer;1.4!annotation-indexer.jar
https://travis-ci.org/guardian/prout/builds/44555212


//NOTE: KEEP VERSIONS IN SYNC WITH ultimate/project/plugins.sbt
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")
addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "3.17.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

// Only used for local development purposes, not in CI/CD.
// Should not be present in the scala-plugin-for-ultimate repos.
// See ../README.md for some examples of how to generate reports locally.
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.9.3")

libraryDependencies += "io.get-coursier" %% "coursier" % "2.0.16"

//NOTE: KEEP VERSIONS IN SYNC WITH ultimate/project/plugins.sbt
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")
addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "3.17.3")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

// Only used for local development purposes, not in CI/CD.
// Should not be present in the scala-plugin-for-ultimate repos.
// See ../README.md for some examples of how to generate reports locally.
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.9.3")

libraryDependencies += "io.get-coursier" %% "coursier" % "2.0.16"

Update sbt-idea-plugin to 3.17.3 to pick up classpath changes for ant.jar


addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.4")

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

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

addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.4.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.2.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.0")

addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.4")

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

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

addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.2.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.0")

Downgrade sbt-bintray to a working version


import sbt._
import Keys._
import twirl.sbt.TwirlPlugin._
import com.linkedin.sbt.MintPlugin

object Sleipnir extends Build {

  val twirlSettings = Twirl.settings ++ Seq(
    libraryDependencies := libraryDependencies.value.filterNot(_.organization == "io.spray")
  )

  lazy val sleipnirGenerator = project.in(file("generator"))
    .settings(
      libraryDependencies ++= Seq(
        "org.clapper" %% "grizzled-slf4j" % "1.0.1",
        "org.slf4j" % "slf4j-simple" % "1.7.2",
        "com.linkedin.pegasus" % "data" % "1.15.9",
        "org.scalariform" %% "scalariform" % "0.1.4",
        "org.scala-lang" % "scala-reflect" % "2.10.3",
        "org.apache.commons" % "commons-lang3" % "3.3.2"
      )
    )
    .settings(twirlSettings: _*)
    .settings(commands ++= Seq(MintPlugin.buildCmd))

  lazy val sleipnirSbtPlugin = project.in(file("sbt-plugin"))
    .settings(
      sbtPlugin := true
    )
    .settings(commands ++= Seq(MintPlugin.buildCmd))
    .dependsOn(sleipnirGenerator)
    .aggregate(sleipnirGenerator)

  lazy val sleipnir = project.in(file(".")).aggregate(sleipnirGenerator, sleipnirSbtPlugin)

}

import sbt._
import Keys._
import twirl.sbt.TwirlPlugin._
import com.linkedin.sbt.MintPlugin
import com.linkedin.sbt.core.ext.LiKeys._

object Sleipnir extends Build {

  //TODO: dyefremo: filter out all "spray.io" dependencies as we don't have them in the artifactory
  val twirlSettings = Twirl.settings ++ Seq(
    libraryDependencies := libraryDependencies.value.filterNot(_.organization == "io.spray")
  )

  lazy val sleipnirGenerator = project.in(file("generator"))
    .settings(
      productSpecDependencies ++= Seq(
        "external.grizzled-slf4j",
        "external.slf4j-simple",
        "external.commons-lang",
        "external.scalariform",
        "external.scala-reflect",
        "product.pegasus.data"
      )
    )
    .settings(twirlSettings: _*)
    .settings(commands ++= Seq(MintPlugin.buildCmd))

  lazy val sleipnirSbtPlugin = project.in(file("sbt-plugin"))
    .settings(
      sbtPlugin := true
    )
    .settings(commands ++= Seq(MintPlugin.buildCmd))
    .dependsOn(sleipnirGenerator)
    .aggregate(sleipnirGenerator)

  lazy val sleipnir = project.in(file(".")).aggregate(sleipnirGenerator, sleipnirSbtPlugin)

}

Switch all dependencies to product-spec.json


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

object ApplicationBuild extends Build {

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

  val appDependencies = Seq(
    "org.reactivemongo" %% "reactivemongo" % "0.9-SNAPSHOT",
    "org.reactivemongo" %% "play2-reactivemongo" % "0.9-SNAPSHOT",
    "org.scalatest" % "scalatest_2.10" % "1.9.1" % "test",
    "com.typesafe.akka" %% "akka-testkit" % "2.1.1"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    resolvers += "Local Play Repository" at "file://usr/local/Cellar/play/2.1.0/libexec/repository/local",
    resolvers += "Sonatype Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
  )
}

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

object ApplicationBuild extends Build {

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

  val appDependencies = Seq(
    "org.reactivemongo" %% "reactivemongo" % "0.9",
    "org.reactivemongo" %% "play2-reactivemongo" % "0.9",
    "org.scalatest" % "scalatest_2.10" % "1.9.1" % "test",
    "com.typesafe.akka" %% "akka-testkit" % "2.1.1"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    resolvers += "Local Play Repository" at "file://usr/local/Cellar/play/2.1.0/libexec/repository/local",
    resolvers += "Sonatype Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
  )
}

Replace ReactiveMongo 0.9-SNAPSHOT with released 0.9


addSbtPlugin("com.jsuereth"         % "sbt-pgp"               % "2.0.1")
addSbtPlugin("com.typesafe.sbt"     % "sbt-ghpages"           % "0.6.3")
addSbtPlugin("com.typesafe.sbt"     % "sbt-site"              % "1.4.1")
addSbtPlugin("org.scoverage"        % "sbt-scoverage"         % "1.6.0")
addSbtPlugin("com.typesafe.sbt"     % "sbt-git"               % "1.0.0")
addSbtPlugin("org.scala-js"         % "sbt-scalajs"           % "1.3.0")
addSbtPlugin("org.portable-scala"   % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.xerial.sbt"       % "sbt-sonatype"          % "3.9.5")
addSbtPlugin("ohnosequences"        % "sbt-github-release"    % "0.7.0")
addSbtPlugin("com.eed3si9n"         % "sbt-buildinfo"         % "0.10.0")

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

addSbtPlugin("com.jsuereth"         % "sbt-pgp"               % "2.0.1")
addSbtPlugin("com.typesafe.sbt"     % "sbt-ghpages"           % "0.6.3")
addSbtPlugin("com.typesafe.sbt"     % "sbt-site"              % "1.4.1")
addSbtPlugin("org.scoverage"        % "sbt-scoverage"         % "1.6.0")
addSbtPlugin("com.typesafe.sbt"     % "sbt-git"               % "1.0.0")
addSbtPlugin("org.scala-js"         % "sbt-scalajs"           % "1.3.1")
addSbtPlugin("org.portable-scala"   % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.xerial.sbt"       % "sbt-sonatype"          % "3.9.5")
addSbtPlugin("ohnosequences"        % "sbt-github-release"    % "0.7.0")
addSbtPlugin("com.eed3si9n"         % "sbt-buildinfo"         % "0.10.0")

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

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


//NOTE: KEEP VERSIONS IN SYNC WITH ultimate/project/plugins.sbt
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")
addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "3.15.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

// Only used for local development purposes, not in CI/CD.
// Should not be present in the scala-plugin-for-ultimate repos.
// See ../README.md for some examples of how to generate reports locally.
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.9.3")

libraryDependencies += "io.get-coursier" %% "coursier" % "2.0.16"

//NOTE: KEEP VERSIONS IN SYNC WITH ultimate/project/plugins.sbt
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")
addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "3.15.3")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

// Only used for local development purposes, not in CI/CD.
// Should not be present in the scala-plugin-for-ultimate repos.
// See ../README.md for some examples of how to generate reports locally.
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.9.3")

libraryDependencies += "io.get-coursier" %% "coursier" % "2.0.16"

Update sbt-idea-plugin to version 3.15.3 with support for downloading JBR on aarch64 machines


// we use pom-util to read metadata from the Maven POMs
libraryDependencies += "com.samskivert" % "sbt-pom-util" % "0.3-SNAPSHOT"

// we use proguard to package up our tools
libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-proguard-plugin" % (v+"-0.1.1"))

// this is needed to wire up LWJGL when running the java version
addSbtPlugin("com.github.philcali" % "sbt-lwjgl-plugin" % "3.1.3")

// we use pom-util to read metadata from the Maven POMs
libraryDependencies += "com.samskivert" % "sbt-pom-util" % "0.3"

// we use proguard to package up our tools
libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-proguard-plugin" % (v+"-0.1.1"))

// this is needed to wire up LWJGL when running the java version
addSbtPlugin("com.github.philcali" % "sbt-lwjgl-plugin" % "3.1.3")

Move off the sbt-pom-util snapshot.

Move off the sbt-pom-util snapshot.


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

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

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

// But use -SNAPSHOT, because there's no -RC2 in the Typesafe or local repo: (right now, buggy build)
addSbtPlugin("play" % "sbt-plugin" % "2.0-SNAPSHOT")

// The SBT-Idea plugin, https://github.com/mpeltonen/sbt-idea
// ---------------------------------------------------------------
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"

// libraryDependencies += "com.github.mpeltonen" %% "sbt-idea" % "0.10.0"
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0")

Add the Idea SBT plugin.

Add the Idea SBT plugin.


import Common._
import bintray.Keys._

val commonSettings = Seq(
  sbtPlugin := true,
  scalaVersion := scalaVersionString,
  organization := organisationString,
  organizationName := organisationNameString,
  scalacOptions := scalaOptionsSeq,
  publishTo.<<=(publishResolver),
  credentials += sbtCredentials,
  licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
  BintrayCredentials.bintrayCredentialsTask
) ++ Seq (
  bintrayOrganization := None,
  repository := "maven"
) ++ bintrayPublishSettings

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

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

publish := {}

import Common._
import bintray.Keys._

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

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

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

publish := {}

Comment out publishing ot bintray for develop


package com.github.dkanellis.skyspark.scala.api.helpers

import com.github.dkanellis.skyspark.scala.api.algorithms.Point
import org.apache.spark.SparkContext

object TextFileToPointRdd {

  def convert(sparkContext: SparkContext, filePath: String, delimiter: String) = {
    sparkContext.textFile(filePath)
      .map(pointFromTextLine(_, delimiter))
  }

  private def pointFromTextLine(textLine: String, delimiter: String) = {
    val numberArray = textLine
      .trim
      .split(delimiter)
      .map(_.toDouble)
    new Point(numberArray: _*)
  }
}

package com.github.dkanellis.skyspark.scala.api.helpers

import com.github.dkanellis.skyspark.scala.api.algorithms.Point
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD

object TextFileToPointRdd {

  def convert(sparkContext: SparkContext, filePath: String, delimiter: String): RDD[Point] = {
    sparkContext.textFile(filePath)
      .map(pointFromTextLine(_, delimiter))
  }

  private def pointFromTextLine(textLine: String, delimiter: String) = {
    val numberArray = textLine
      .trim
      .split(delimiter)
      .map(_.toDouble)
    new Point(numberArray: _*)
  }
}

Add explicit return to file conversion

Add explicit return to file conversion


package com.campudus.scycle

import rxscalajs.subscription.AnonymousSubscription
import rxscalajs.{Observable, Subject}

trait Driver[A] {

  def createSubject(): Subject[A] = Subject()

  def subscribe(inputs: Observable[A]): AnonymousSubscription = inputs.subscribe(_ => null)

}

package com.campudus.scycle

import rxscalajs.subscription.AnonymousSubscription
import rxscalajs.{Observable, Subject}

trait Driver[A] {

  def createSubject(): Subject[A] = {
    org.scalajs.dom.console.log("in Driver.createSubject()")
    val s = Subject.apply[A]()
    org.scalajs.dom.console.log("after Driver.createSubject:Subject.apply()")
    s
  }

  def subscribe(inputs: Observable[A]): AnonymousSubscription = inputs.subscribe(_ => null)

}

Add debug to driver - cannot see any further

Signed-off-by: Joern Bernhardt <7b85a41a628204b76aba4326273a3ccc74bd009a@campudus.com>


latestVersion in ThisBuild := "0.13.0-RC1"

unreleasedModuleNames in ThisBuild := Set()

binaryCompatibleVersions in ThisBuild := Set(
  "0.13.0-RC1"
)

latestVersion in ThisBuild := "0.13.0-RC1"

unreleasedModuleNames in ThisBuild := Set()

binaryCompatibleVersions in ThisBuild := Set()

Change to not check milestone compatibility


latestVersion in ThisBuild := "0.12.1"

unreleasedModuleNames in ThisBuild := Set()

binaryCompatibleVersions in ThisBuild := Set()

latestVersion in ThisBuild := "0.13.0-RC1"

unreleasedModuleNames in ThisBuild := Set()

binaryCompatibleVersions in ThisBuild := Set(
  "0.13.0-RC1"
)

Set latest version to 0.13.0-RC1

Set latest version to 0.13.0-RC1


addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.4")

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

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.5")

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

Update sbt-scalafmt to 2.4.5 in master

Update sbt-scalafmt to 2.4.5 in master


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

addSbtPlugin("com.typesafe"                      % "sbt-mima-plugin"       % "1.1.0")
addSbtPlugin("com.typesafe.sbt"                  % "sbt-osgi"              % "0.9.6")
addSbtPlugin("com.eed3si9n"                      % "sbt-buildinfo"         % "0.11.0")
addSbtPlugin("com.github.sbt"                    % "sbt-ci-release"        % "1.5.10")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings"      % "3.0.2")
addSbtPlugin("org.scala-js"                      % "sbt-scalajs"           % "1.10.1")
addSbtPlugin("org.scala-native"                  % "sbt-scala-native"      % "0.4.7")
addSbtPlugin("org.portable-scala"                % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala"                % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("com.codecommit"                    % "sbt-github-actions"    % "0.13.0")

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

addSbtPlugin("com.typesafe"                      % "sbt-mima-plugin"       % "1.1.0")
addSbtPlugin("com.typesafe.sbt"                  % "sbt-osgi"              % "0.9.6")
addSbtPlugin("com.eed3si9n"                      % "sbt-buildinfo"         % "0.11.0")
addSbtPlugin("com.github.sbt"                    % "sbt-ci-release"        % "1.5.10")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings"      % "3.0.2")
addSbtPlugin("org.scala-js"                      % "sbt-scalajs"           % "1.11.0")
addSbtPlugin("org.scala-native"                  % "sbt-scala-native"      % "0.4.7")
addSbtPlugin("org.portable-scala"                % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala"                % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("com.codecommit"                    % "sbt-github-actions"    % "0.13.0")

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


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

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

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

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

addSbtPlugin("com.typesafe.sbt" % "sbt-license-report" % "1.0.0")

addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.0.0")

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

resolvers ++= Seq(
    "socrata maven" at "https://repository-socrata-oss.forge.cloudbees.com/release",
    "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/"
)

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

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

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

addSbtPlugin("com.typesafe.sbt" % "sbt-license-report" % "1.0.0")

addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.0.0")

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

Use https for repos where possible.

Use https for repos where possible.


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

val sbtSoftwareMillVersion = "2.0.4"
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.21")

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

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

val sbtSoftwareMillVersion = "2.0.5"
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.21")

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

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


lazy val settings = Seq(organization := "com.sageserpent",
  name := "plutonium",
  version := "1.0.0-SNAPSHOT",
  scalaVersion := "2.11.7",
  scalacOptions += "-Xexperimental",
  libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test",
  libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.12.4" % "test",
  libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.2.0",
  libraryDependencies += "org.scalaz" %% "scalaz-scalacheck-binding" % "7.1.3" % "test",
  libraryDependencies += "org.spire-math" %% "spire" % "0.10.1",
  libraryDependencies += "io.github.nicolasstucki" %% "multisets" % "0.3",
  libraryDependencies += "cglib" % "cglib" % "3.2.0",
  libraryDependencies += "com.sageserpent" %% "americium" % "0.1.0",
  libraryDependencies += "com.jsuereth" %% "scala-arm" % "1.4",
  libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.2" % "test",
  publishMavenStyle := true,
  publishTo := Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository"))))

lazy val plutonium = (project in file(".")).settings(settings: _*)

resolvers += Resolver.jcenterRepo

lazy val settings = Seq(organization := "com.sageserpent",
  name := "plutonium",
  version := "1.0.0-SNAPSHOT",
  scalaVersion := "2.11.7",
  scalacOptions += "-Xexperimental",
  libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test",
  libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.12.4" % "test",
  libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.2.2",
  libraryDependencies += "org.scalaz" %% "scalaz-scalacheck-binding" % "7.1.3" % "test",
  libraryDependencies += "io.github.nicolasstucki" %% "multisets" % "0.3",
  libraryDependencies += "cglib" % "cglib" % "3.2.0",
  libraryDependencies += "com.sageserpent" %% "americium" % "0.1.0",
  libraryDependencies += "com.jsuereth" %% "scala-arm" % "1.4",
  libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.2" % "test",
  publishMavenStyle := true,
  publishTo := Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository"))))

lazy val plutonium = (project in file(".")).settings(settings: _*)

resolvers += Resolver.jcenterRepo

Remove unused dependency on Spire library, and update ScalaZ dependency to 7.2.0.


name := "apibuilder-validation"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.8"

crossScalaVersions := Seq("2.12.8")

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

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

autocommit: Update configuration to record version 0.4.9


package de.bripkens.ha

import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import com.fasterxml.jackson.databind.ObjectMapper
import de.bripkens.ha.reporting.{SlackReporter, ConsoleReporter}

object AppActor {

  final val Name = "app"

  def props(mapper: ObjectMapper, config: Configuration) = Props(new AppActor(mapper, config))
}

class AppActor(val mapper: ObjectMapper, val config: Configuration) extends Actor
                                                                    with ActorLogging {

  val reporters = config.reporters.map(config2Actor)

  def config2Actor(entry: (String, AbstractReporterConfig)): (String, ActorRef) = {
    val consoleReporterClass = classOf[ConsoleReporter]
    val slackReporterClass = classOf[SlackReporter]

    val props = entry._2.implementation match {
      case consoleReporterClass => Props(new ConsoleReporter(mapper, config.asInstanceOf[ConsoleReporterConfig]))
      case slackReporterClass => Props(new SlackReporter(mapper, config.asInstanceOf[SlackReporterConfig]))
    }

    val actor = context.actorOf(props, s"reporter-${entry._1}")
    (entry._1, actor)
  }

  config.endpoints.foreach { endpoint =>
    if (!reporters.contains(endpoint.reporter)) {
      log.error(s"Reporter ${endpoint.reporter} does not exist.")
      System.exit(1)
    }
    val reporter = reporters(endpoint.reporter)
    context.actorOf(
      HealthCheckActor.props(mapper, config, endpoint, reporter),
      s"healthCheck-${endpoint.id}"
    )
  }

  override def receive: Receive = {
    case unsupported => log.error(s"Unsupported message received: $unsupported")
  }
}

package de.bripkens.ha

import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import com.fasterxml.jackson.databind.ObjectMapper
import de.bripkens.ha.reporting.{ConsoleReporter, SlackReporter}

object AppActor {

  final val Name = "app"

  def props(mapper: ObjectMapper, config: Configuration) = Props(new AppActor(mapper, config))
}

class AppActor(val mapper: ObjectMapper, val config: Configuration) extends Actor
                                                                    with ActorLogging {

  val reporters = config.reporters.map(config2Actor)

  def config2Actor(entry: (String, AbstractReporterConfig)): (String, ActorRef) = {
    val props = entry._2 match {
      case crc@ConsoleReporterConfig(_)           => Props(new ConsoleReporter(mapper, crc))
      case src@SlackReporterConfig(_, _, _, _, _) => Props(new SlackReporter(mapper, src))
    }

    val actor = context.actorOf(props, s"reporter-${entry._1}")
    (entry._1, actor)
  }

  config.endpoints.foreach { endpoint =>
    if (!reporters.contains(endpoint.reporter)) {
      log.error(s"Reporter ${endpoint.reporter} does not exist.")
      System.exit(1)
    }
    val reporter = reporters(endpoint.reporter)
    context.actorOf(
      HealthCheckActor.props(mapper, config, endpoint, reporter),
      s"healthCheck-${endpoint.id}"
    )
  }

  override def receive: Receive = {
    case unsupported => log.error(s"Unsupported message received: $unsupported")
  }
}

Use pattern matching to implement type check


package de.bripkens.ha

import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import com.fasterxml.jackson.databind.ObjectMapper
import de.bripkens.ha.reporting.{ConsoleReporter, SlackReporter}

object AppActor {

  final val Name = "app"

  def props(mapper: ObjectMapper, config: Configuration) = Props(new AppActor(mapper, config))
}

class AppActor(val mapper: ObjectMapper, val config: Configuration) extends Actor
                                                                    with ActorLogging {

  val reporters = config.reporters.map(config2Actor)

  def config2Actor(entry: (String, ReporterConfig)): (String, ActorRef) = {
    val props = entry._2 match {
      case config@ConsoleReporterConfig(_)           => ConsoleReporter.props(mapper, config)
      case config@SlackReporterConfig(_, _, _, _, _) => SlackReporter.props(mapper, config)
    }

    val actor = context.actorOf(props, s"reporter-${entry._1}")
    (entry._1, actor)
  }

  config.endpoints.foreach { endpoint =>
    if (!reporters.contains(endpoint.reporter)) {
      log.error(s"Reporter ${endpoint.reporter} does not exist.")
      System.exit(1)
    }
    val reporter = reporters(endpoint.reporter)
    context.actorOf(
      HealthCheckActor.props(mapper, config, endpoint, reporter),
      s"healthCheck-${endpoint.id}"
    )
  }

  override def receive: Receive = {
    case unsupported => log.error(s"Unsupported message received: $unsupported")
  }
}

package de.bripkens.ha

import akka.actor.{Actor, ActorLogging, Props}
import com.fasterxml.jackson.databind.ObjectMapper
import de.bripkens.ha.reporting.{ConsoleReporter, SlackReporter}

object AppActor {

  final val Name = "app"

  def props(mapper: ObjectMapper, config: Configuration) = Props(new AppActor(mapper, config))
}

class AppActor(val mapper: ObjectMapper, val config: Configuration) extends Actor
                                                                    with ActorLogging {

  val reporters = config.reporters.map{ case (name, reporterConfig) =>
    val props = reporterConfig match {
      case config@ConsoleReporterConfig(_)           => ConsoleReporter.props(mapper, config)
      case config@SlackReporterConfig(_, _, _, _, _) => SlackReporter.props(mapper, config)
    }

    val actor = context.actorOf(props, s"reporter-$name")
    (name, actor)
  }

  config.endpoints.foreach { endpoint =>
    if (!reporters.contains(endpoint.reporter)) {
      log.error(s"Reporter ${endpoint.reporter} does not exist.")
      System.exit(1)
    }
    val reporter = reporters(endpoint.reporter)
    context.actorOf(
      HealthCheckActor.props(mapper, config, endpoint, reporter),
      s"healthCheck-${endpoint.id}"
    )
  }

  override def receive: Receive = {
    case unsupported => log.error(s"Unsupported message received: $unsupported")
  }
}

Revert to an inline mapping function, which is simpler after refactoring reporter instantiation


package nbmtools

import java.io.InputStream
import java.util.zip.ZipInputStream

object appendExternal {
    def apply(s: String): String = s + ".external"
    def unapply(s: String): Option[String] = {
        if (s.endsWith(".external"))
            Some(s.stripSuffix(".external"))
        else None
    }
}

class NbmInputStream(is: InputStream) extends ZipInputStream(is) {
    private var externalStream: Option[InputStream] = None

    override def getNextEntry() = {
        val originalEntry = super.getNextEntry
        originalEntry.getName match {
            case appendExternal(name) => {
                    val external = ???
                    // val externalSteam = ??? // TODO
                    val entry = createZipEntry(name)
                    entry
            }
            case name => {
                    externalStream = None
                    originalEntry
            }
        }
    }

    override def read(b: Array[Byte], off: Int, len: Int): Int = {
        externalStream match {
            case None => super.read(b, off, len)
            case Some(es) => es.read(b, off, len)
        }
    }
}

package nbmtools

import java.io.InputStream
import java.util.zip.ZipInputStream

object appendExternal {
    def apply(s: String): String = s + ".external"
    def unapply(s: String): Option[String] = {
        if (s.endsWith(".external"))
            Some(s.stripSuffix(".external"))
        else None
    }
}

class NbmInputStream(is: InputStream) extends ZipInputStream(is) {
    private var externalStream: Option[InputStream] = None

    override def getNextEntry() = {
        val originalEntry = super.getNextEntry
        originalEntry.getName match {
            case appendExternal(name) => {
                    val external = External.from(this)
                    externalStream = Some(external.openStream())
                    val entry = createZipEntry(name)
                    entry
            }
            case name => {
                    externalStream = None
                    originalEntry
            }
        }
    }

    override def read(b: Array[Byte], off: Int, len: Int): Int = {
        externalStream match {
            case None => super.read(b, off, len)
            case Some(es) => es.read(b, off, len)
        }
    }
}

Set externalStream if entry name ends with .external


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Update sbt-wartremover, wartremover to 3.0.2


addSbtPlugin("com.github.sbt"       % "sbt-pgp"                       % "2.1.2")
addSbtPlugin("com.typesafe.sbt"     % "sbt-git"                       % "1.0.2")
addSbtPlugin("org.scala-js"         % "sbt-scalajs"                   % "1.8.0")
addSbtPlugin("org.portable-scala"   % "sbt-scalajs-crossproject"      % "1.1.0")
addSbtPlugin("org.portable-scala"   % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("org.xerial.sbt"       % "sbt-sonatype"                  % "3.9.11")
addSbtPlugin("ohnosequences"        % "sbt-github-release"            % "0.7.0")
addSbtPlugin("com.eed3si9n"         % "sbt-buildinfo"                 % "0.10.0")
addSbtPlugin("org.scala-native"     % "sbt-scala-native"              % "0.4.3")

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

addSbtPlugin("com.github.sbt"       % "sbt-pgp"                       % "2.1.2")
addSbtPlugin("com.typesafe.sbt"     % "sbt-git"                       % "1.0.2")
addSbtPlugin("org.scala-js"         % "sbt-scalajs"                   % "1.9.0")
addSbtPlugin("org.portable-scala"   % "sbt-scalajs-crossproject"      % "1.1.0")
addSbtPlugin("org.portable-scala"   % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("org.xerial.sbt"       % "sbt-sonatype"                  % "3.9.11")
addSbtPlugin("ohnosequences"        % "sbt-github-release"            % "0.7.0")
addSbtPlugin("com.eed3si9n"         % "sbt-buildinfo"                 % "0.10.0")
addSbtPlugin("org.scala-native"     % "sbt-scala-native"              % "0.4.3")

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

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


addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.13.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.18")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-crossproject" % "0.6.0")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2")

addSbtCoursier

libraryDependencies ++= List(
  "io.github.bonigarcia" % "webdrivermanager" % "3.3.0",
  "com.thesamet.scalapb" %% "compilerplugin-shaded" % "0.8.4",
  "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
)

addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.13.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.18")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.27")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-crossproject" % "0.6.0")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2")

addSbtCoursier

libraryDependencies ++= List(
  "io.github.bonigarcia" % "webdrivermanager" % "3.3.0",
  "com.thesamet.scalapb" %% "compilerplugin-shaded" % "0.8.4",
  "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
)

Update sbt-scalajs, scalajs-compiler to 0.6.27


libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.11"

// https://github.com/coursier/coursier/issues/450
classpathTypes += "maven-plugin"

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34")
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.2.4")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.9.9")
addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.12.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.1")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")

libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.11"

// https://github.com/coursier/coursier/issues/450
classpathTypes += "maven-plugin"

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34")
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.2.4")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.9.9")
addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.13.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.1")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")

Update sbt-http4s-org to 0.13.0 in series/0.22


class Boopy {
    private val s = new Schnuck
    def observer : PartialFunction[ Any, Unit ] = s.observer

    private class Schnuck extends javax.swing.AbstractListModel {
        model =>
        val observer : PartialFunction[ Any, Unit ] = {
            case "Boopy" => fireIntervalAdded( model, 0, 1 )
        }
        def getSize = 0
        def getElementAt( idx: Int ) : AnyRef = "egal"
    }

}

object Test {
  def main(args: Array[String]): Unit = {
    val x = new Boopy
    val o = x.observer
    o( "Boopy" ) // --> throws runtime error
  }
}

class Boopy {
    private val s = new Schnuck
    def observer : PartialFunction[ Any, Unit ] = s.observer

    private class Schnuck extends javax.swing.AbstractListModel {
        model =>
        val observer : PartialFunction[ Any, Unit ] = {
            case "Boopy" => fireIntervalAdded( model, 0, 1 )
        }
        def getSize = 0
        def getElementAt( idx: Int ) = ???
    }

}

object Test {
  def main(args: Array[String]): Unit = {
    val x = new Boopy
    val o = x.observer
    o( "Boopy" ) // --> throws runtime error
  }
}

Tweak test to pass under java 7.

Tweak test to pass under java 7.


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.40"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-lint"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.41"

exportJars := true

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

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

autocommit: Update configuration to record version 0.0.41


scalaVersion := "2.12.1"

addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.3")

libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.2"
libraryDependencies += "org.typelevel" %% "cats" % "0.8.1"

Add akka, shapeless and a few others.

Add akka, shapeless and a few others.


name := "timetrace"

version := "1.0"

scalaVersion := "2.10.4"

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

// Optional dependencies of scalatest, version numbers match those from scalatest's pom file
// https://oss.sonatype.org/content/groups/public/org/scalatest/scalatest_2.10/2.1.0/scalatest_2.10-2.1.0.pom

libraryDependencies += "junit" % "junit" % "4.10" % "test"

libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.11.0" % "test"

org.scalastyle.sbt.ScalastylePlugin.Settings

name := "timetrace"

version := "1.0"

scalaVersion := "2.11.2"

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

// Optional dependencies of scalatest, version numbers match those from scalatest's pom file
// http://mavenbrowse.pauldoo.com/central/org/scalatest/scalatest_2.11/2.2.0/

libraryDependencies += "junit" % "junit" % "4.10" % "test"

libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.11.3" % "test"

org.scalastyle.sbt.ScalastylePlugin.Settings

Update to Scala 2.11.2, and to scalatest 2.2.0.