addSbtPlugin("org.scala-tools.sbt" % "sbt-android-plugin" % "0.6.0")

resolvers += "nexus snapshots" at "http://nexus.scala-tools.org/content/repositories/snapshots"

addSbtPlugin("org.scala-tools.sbt" % "sbt-android-plugin" % "0.6.1-SNAPSHOT")

Update to use 0.6.1-SNAPSHOT Android plugin.

--HG--
extra : convert_revision : 0839c48cc8b24348fa0ee41e31c5046ce2255d17


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

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

Upgrade play version to 2.5.8

Upgrade play version to 2.5.8


addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
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.9.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.4")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")

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

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.9.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.4")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")

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

Update sbt-scala-native-crossproject, ... to 1.2.0 in master


addSbtPlugin("com.eed3si9n"       % "sbt-unidoc"                    % "0.4.2")
addSbtPlugin("com.github.gseitz"  % "sbt-release"                   % "1.0.11")
addSbtPlugin("com.geirsson"       % "sbt-ci-release"                % "1.2.6")
addSbtPlugin("com.typesafe"       % "sbt-mima-plugin"               % "0.3.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"                       % "0.3.7")
addSbtPlugin("org.scala-js"       % "sbt-scalajs"                   % "0.6.28")
addSbtPlugin("org.portable-scala" % "sbt-crossproject"              % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject"      % "0.6.0")
addSbtPlugin("com.47deg"          % "sbt-microsites"                % "0.7.27")
addSbtPlugin("org.tpolecat"       % "tut-plugin"                    % "0.6.12")

scalacOptions += "-deprecation"

addSbtPlugin("com.eed3si9n"       % "sbt-unidoc"                    % "0.4.2")
addSbtPlugin("com.github.gseitz"  % "sbt-release"                   % "1.0.11")
addSbtPlugin("com.geirsson"       % "sbt-ci-release"                % "1.2.6")
addSbtPlugin("com.typesafe"       % "sbt-mima-plugin"               % "0.3.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh"                       % "0.3.7")
addSbtPlugin("org.scala-js"       % "sbt-scalajs"                   % "0.6.28")
addSbtPlugin("org.portable-scala" % "sbt-crossproject"              % "0.6.1")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject"      % "0.6.1")
addSbtPlugin("com.47deg"          % "sbt-microsites"                % "0.7.27")
addSbtPlugin("org.tpolecat"       % "tut-plugin"                    % "0.6.12")

scalacOptions += "-deprecation"

Update sbt-crossproject, ... to 0.6.1

Update sbt-crossproject, ... to 0.6.1


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

addSbtPlugin("com.jsuereth"        % "sbt-pgp"               % "1.0.0")
addSbtPlugin("com.github.gseitz"   % "sbt-release"           % "1.0.0")
addSbtPlugin("com.eed3si9n"        % "sbt-unidoc"            % "0.3.3")
addSbtPlugin("com.eed3si9n"        % "sbt-buildinfo"         % "0.3.2")
addSbtPlugin("pl.project13.scala"  % "sbt-jmh"               % "0.1.6")
addSbtPlugin("org.scoverage"       % "sbt-scoverage"         % "1.2.0")
addSbtPlugin("org.scalastyle"     %% "scalastyle-sbt-plugin" % "0.7.0")
addSbtPlugin("com.typesafe.sbt"    % "sbt-git"               % "0.8.4")
addSbtPlugin("org.scala-js"        % "sbt-scalajs"           % "0.6.5")
libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.12"

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

addSbtPlugin("com.jsuereth"        % "sbt-pgp"               % "1.0.0")
addSbtPlugin("com.github.gseitz"   % "sbt-release"           % "1.0.0")
addSbtPlugin("com.eed3si9n"        % "sbt-unidoc"            % "0.3.3")
addSbtPlugin("com.eed3si9n"        % "sbt-buildinfo"         % "0.3.2")
addSbtPlugin("pl.project13.scala"  % "sbt-jmh"               % "0.1.6")
addSbtPlugin("org.scoverage"       % "sbt-scoverage"         % "1.2.0")
addSbtPlugin("org.scalastyle"     %% "scalastyle-sbt-plugin" % "0.7.0")
addSbtPlugin("com.typesafe.sbt"    % "sbt-git"               % "0.8.4")
addSbtPlugin("org.scala-js"        % "sbt-scalajs"           % "0.6.8")
libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.12"

Update to Scala.js 0.6.8 (for Scala 2.11.8)


package monads.scalax

import scala.io.Source

object Words extends App {
  val keywords = Source.fromURL(getClass.getResource("keywords")).getLines.toSet

  val words: List[String] = ???

  val foundKeywords: List[String] = ???
  println("All keywords: " + foundKeywords.mkString("[",",","]"))

  val upperCaseWords: List[String] = ???
  println("All words in uppercase: " + upperCaseWords.mkString("[",",","]"))
}

package monads.scalax

import scala.io.Source

object Words extends App {
  val keywords = Source.fromInputStream(getClass.getResourceAsStream("/keywords.txt")).getLines.toSet

  val words: List[String] = ???

  val foundKeywords: List[String] = ???
  println("All keywords: " + foundKeywords.mkString("[",",","]"))

  val upperCaseWords: List[String] = ???
  println("All words in uppercase: " + upperCaseWords.mkString("[",",","]"))
}

Fix 180 bug in scalax code

Fix 180 bug in scalax code


/*
 * Copyright 2016 Spotify AB.
 *
 * 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 com.spotify.scio.examples.extra

import com.spotify.scio.ContextAndArgs
import com.spotify.scio.proto.SimpleV2.SimplePB
import com.spotify.scio.proto.Track.TrackPB

// Read protobuf on input, and write another protobuf on output
object ProtobufExample {
  def main(cmdlineArgs: Array[String]): Unit = {
    val (sc, args) = ContextAndArgs(cmdlineArgs)

    sc.protobufFile[SimplePB](args("input"))
      .map(p => TrackPB.newBuilder().setTrackId(p.getTrackId))
      .saveAsTextFile(args("output"))

    sc.close()
  }
}

/*
 * Copyright 2016 Spotify AB.
 *
 * 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 com.spotify.scio.examples.extra

import com.spotify.scio.ContextAndArgs
import com.spotify.scio.proto.SimpleV2.SimplePB
import com.spotify.scio.proto.Track.TrackPB

// Read protobuf on input, and write another protobuf on output
object ProtobufExample {
  def main(cmdlineArgs: Array[String]): Unit = {
    val (sc, args) = ContextAndArgs(cmdlineArgs)

    sc.protobufFile[SimplePB](args("input"))
      .map(p => TrackPB.newBuilder().setTrackId(p.getTrackId).build())
      .saveAsProtobufFile(args("output"))

    sc.close()
  }
}

Fix protobuf example - write protos

Fix protobuf example - write protos


import scalaxb.compiler.Config
import scalaxb.compiler.ConfigEntry._

class AttributesPrefixTest extends TestBase {
  val inFile  = resource("attrPrefixSchema.xsd")

  lazy val generated = module.process(inFile,
    Config.default.update(PackageNames(Map(None -> Some("attr")))).
      update(Outdir(tmp)).
      update(AttributePrefix("a")))

  val targetXml =
    (<metricsPort id="metricsId" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <name>metricsName</name>
      <attributes>
        <attribute>
          <name>attr1</name>
          <value>val1</value>
        </attribute>
        <attribute>
          <name>attr2</name>
          <value>val2</value>
        </attribute>
      </attributes>
    </metricsPort>).toString.replace("\n", "")

  "When xsd has elements with name `attributes` and `attribute` " +
    "generated code should compile with config `AttributePrefix`" in repl(generated)(s"""
    import attr._

    val metricsPort = scalaxb.fromXML[MetricsPort]($targetXml)
    "true"
  """,
    """true"""
  )
}

import scalaxb.compiler.Config
import scalaxb.compiler.ConfigEntry._

class AttributesPrefixTest extends TestBase {
  val inFile  = resource("attrPrefixSchema.xsd")

  lazy val generated = module.process(inFile,
    Config.default.update(PackageNames(Map(None -> Some("attr")))).
      update(Outdir(tmp)).
      update(AttributePrefix("a_")))

  val targetXml =
    (<metricsPort id="metricsId" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <name>metricsName</name>
      <attributes>
        <attribute>
          <name>attr1</name>
          <value>val1</value>
        </attribute>
        <attribute>
          <name>attr2</name>
          <value>val2</value>
        </attribute>
      </attributes>
    </metricsPort>).toString.replace("\n", "")

  "When xsd has elements with name `attributes` and `attribute` " +
    "generated code should compile with config `AttributePrefix`" in repl(generated)(s"""
    import attr._

    val metricsPort = scalaxb.fromXML[MetricsPort]($targetXml)
    metricsPort.a_attributes("@id").value
  """,
    """metricsId"""
  )
}

Test that a_ is added

Test that a_ is added


scalacOptions := Seq(
  "-deprecation"
)

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

scalacOptions := Seq(
  "-deprecation"
)

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

Update http4s-blaze-client, ... to 0.21.18


/*
 * Copyright 2017 Mediative
 *
 * 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 com.mediative.sangria.codegen
package starwars

import org.scalatest.{WordSpec, Matchers}

class StarWarsAnnotationSpec extends WordSpec with Matchers {
  "GraphQLDomain" should {
    "support the Star Wards schema and operations" in {
      sangria.introspection.introspectionQuery
      """
      import com.mediative.sangria.codegen.GraphQLDomain

      @GraphQLDomain(
        "sangria-codegen/src/test/resources/starwars/schema.graphql",
        "sangria-codegen/src/test/resources/starwars/MultiQuery.graphql"
      )
      object StarWarsDomain
      """ should compile
    }
  }
}

/*
 * Copyright 2017 Mediative
 *
 * 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 com.mediative.sangria.codegen
package starwars

import org.scalatest.{WordSpec, Matchers}

class StarWarsAnnotationSpec extends WordSpec with Matchers {
  "GraphQLDomain" should {
    "support the Star Wars schema and operations" in {
      sangria.introspection.introspectionQuery
      """
      import com.mediative.sangria.codegen.GraphQLDomain

      @GraphQLDomain(
        "sangria-codegen/src/test/resources/starwars/schema.graphql",
        "sangria-codegen/src/test/resources/starwars/MultiQuery.graphql"
      )
      object StarWarsDomain
      """ should compile
    }
  }
}

Fix typo in test name

Fix typo in test name


package scala.tools
package partest

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

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

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

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

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

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

  def timeout     = "1200000"
}

package scala.tools
package partest

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

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

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

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

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

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

  def timeout     = "1200000"
}

Put back the XXX line in partest.

Put back the XXX line in partest.

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


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

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

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

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

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

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

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

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

Update mdoc, sbt-mdoc to 2.2.23

Update mdoc, sbt-mdoc to 2.2.23


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.25")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29")
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.6.1",
  "com.thesamet.scalapb" %% "compilerplugin-shaded" % "0.9.1",
  "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.25")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29")
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.6.1",
  "com.thesamet.scalapb" %% "compilerplugin-shaded" % "0.9.4",
  "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
)

Update compilerplugin-shaded, ... to 0.9.4


resolvers ++= Seq(
  Classpaths.sbtPluginReleases,
  Resolver.sonatypeRepo("releases"),
  Resolver.bintrayIvyRepo("jetbrains", "sbt-plugins")
)

addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.20")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.9.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1")

resolvers ++= Seq(
  Classpaths.sbtPluginReleases,
  Resolver.sonatypeRepo("releases"),
  Resolver.bintrayIvyRepo("jetbrains", "sbt-plugins")
)

addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.21")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.9.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1")

Update mdoc, sbt-mdoc to 2.2.21

Update mdoc, sbt-mdoc to 2.2.21


addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.10.1")

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

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

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

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

addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.10.1")

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Update sbt-wartremover, wartremover to 2.4.17


addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.12.0")

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

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

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

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

addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.12.0")

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

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

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

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

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


addSbtPlugin("io.get-coursier" % "sbt-coursier" % coursier.util.Properties.version)

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.1")
addSbtPlugin("org.scala-js"       % "sbt-scalajs"              % "0.6.28")
addSbtPlugin("com.jsuereth"       % "sbt-pgp"                  % "1.1.2")
addSbtPlugin("com.github.gseitz"  % "sbt-release"              % "1.0.11")

addSbtPlugin("io.get-coursier" % "sbt-coursier" % coursier.util.Properties.version)

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.1")
addSbtPlugin("org.scala-js"       % "sbt-scalajs"              % "0.6.31")
addSbtPlugin("com.jsuereth"       % "sbt-pgp"                  % "1.1.2")
addSbtPlugin("com.github.gseitz"  % "sbt-release"              % "1.0.11")

Update sbt-scalajs, scalajs-compiler to 0.6.31


resolvers += Resolver.jcenterRepo

addSbtPlugin("net.aichler"       % "sbt-jupiter-interface" % "0.8.3")
addSbtPlugin("org.scalameta"     % "sbt-scalafmt"          % "2.4.2")
addSbtPlugin("org.scalameta"     % "sbt-scalafmt"          % "2.4.2")
addSbtPlugin("org.foundweekends" % "sbt-bintray"           % "0.5.6")
addSbtPlugin("com.github.sbt"    % "sbt-release"           % "1.0.15")
addSbtPlugin("org.scoverage"     % "sbt-scoverage"         % "1.6.1")

resolvers += Resolver.jcenterRepo

addSbtPlugin("net.aichler"       % "sbt-jupiter-interface" % "0.8.3")
addSbtPlugin("org.scalameta"     % "sbt-scalafmt"          % "2.4.2")
addSbtPlugin("org.foundweekends" % "sbt-bintray"           % "0.6.1")
addSbtPlugin("com.github.sbt"    % "sbt-release"           % "1.0.15")
addSbtPlugin("org.scoverage"     % "sbt-scoverage"         % "1.6.1")

Update plugin dependencies and remove a duplicated entry.


          addSbtPlugin("com.dwijnand"      % "sbt-dynver"      % "4.0.0")
          addSbtPlugin("io.get-coursier"   % "sbt-coursier"    % "1.0.3")
libraryDependencies += "org.scala-sbt"    %% "scripted-plugin" % sbtVersion.value
          addSbtPlugin("com.typesafe"      % "sbt-mima-plugin" % "0.6.0")
          addSbtPlugin("org.foundweekends" % "sbt-bintray"     % "0.5.5")

          addSbtPlugin("com.dwijnand"      % "sbt-dynver"      % "4.0.0")
libraryDependencies += "org.scala-sbt"    %% "scripted-plugin" % sbtVersion.value
          addSbtPlugin("com.typesafe"      % "sbt-mima-plugin" % "0.6.0")
          addSbtPlugin("org.foundweekends" % "sbt-bintray"     % "0.5.5")

Drop sbt-coursier while using sbt 1.3

Drop sbt-coursier while using sbt 1.3


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

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

Update mdoc, sbt-mdoc to 2.2.16

Update mdoc, sbt-mdoc to 2.2.16


ThisBuild / doc / scalacOptions += "-Xsomething"

ThisBuild / shellPrompt := { state => "sbt> " }

lazy val lintBuildTest = taskKey[Unit]("")

lazy val root = (project in file("."))
  .settings(
    lintBuildTest := {
      val state = Keys.state.value
      val includeKeys = (includeLintKeys in Global).value map { _.scopedKey.key.label }
      val excludeKeys = (excludeLintKeys in Global).value map { _.scopedKey.key.label }
      val result = sbt.internal.LintUnused.lintUnused(state, includeKeys, excludeKeys)
      result foreach {
        case (_, "ThisBuild / doc / scalacOptions", _) => ()
        case (_, "app / globalAutoPluginSetting", _)   => ()
        case (_, "root / globalAutoPluginSetting", _)  => ()
        case (_, str, _)                               => sys.error(str)
      }
    }
  )

lazy val app = project

ThisBuild / doc / scalacOptions += "-Xsomething"

ThisBuild / shellPrompt := { state => "sbt> " }

// watch related settings
ThisBuild / sbt.nio.Keys.watchTriggers := Seq()
ThisBuild / sbt.nio.Keys.watchPersistFileStamps := true

lazy val lintBuildTest = taskKey[Unit]("")

lazy val root = (project in file("."))
  .settings(
    lintBuildTest := {
      val state = Keys.state.value
      val includeKeys = (lintIncludeFilter in Global).value
      val excludeKeys = (lintExcludeFilter in Global).value
      val result = sbt.internal.LintUnused.lintUnused(state, includeKeys, excludeKeys)
      result foreach {
        case (_, "ThisBuild / doc / scalacOptions", _) => ()
        case (_, "app / globalAutoPluginSetting", _)   => ()
        case (_, "root / globalAutoPluginSetting", _)  => ()
        case (_, str, _)                               => sys.error(str)
      }
    }
  )

lazy val app = project

Use lint***Filter instead of ***LintKeys  for more reliable test

Below functions pass lintIncludeFilter and lintExcludeFilter to lintUnusedinstead of includeLintKeys and excludeLintKeys respectively.
- sbt.internal.LintUnused#lintUnusedTask
- sbt.internal.LintUnused#lintUnusedFunc
Therefore, in the test, we had better to use lint***Filter instead of ***LintKeys.


package com.softwaremill.codebrag.service.config

import com.softwaremill.codebrag.common.config.ConfigWithDefault

trait LicenceConfig extends ConfigWithDefault {

  lazy val expiresInDays = getInt("codebrag.licence-expiration-days", 45)

}

package com.softwaremill.codebrag.service.config

import com.softwaremill.codebrag.common.config.ConfigWithDefault

trait LicenceConfig extends ConfigWithDefault {

  lazy val expiresInDays = getInt("codebrag.licence-expiration-days", 30)

}

Revert trial licence back to 30 days

Revert trial licence back to 30 days


package textapp

class CommandLineArgumentProcessor(args: Array[String]) {
  def getParam(longName: String, shortName: String): Option[String] = {
    val longFormat = "--%s".format(longName)
    val shortFormat = "-%s".format(shortName)

    val paramsWithValues = argPairs.flatMap { case (first, second) =>
      if (first == longFormat || first == shortFormat) {
        if (!isParam(second)) Some(second)
        else None
      }
      else None
    }.toList

    val paramsWithoutValues = args.flatMap { arg =>
      if (arg == longFormat || arg == shortFormat) Some("")
      else None
    }.toList
    (paramsWithValues ::: paramsWithoutValues).firstOption
  }

  private def argPairs = args.zip(args.drop(1))
  private def isParam(s: String) = s.startsWith("-")
}

package textapp

class CommandLineArgumentProcessor(args: Array[String]) {
  def getParam(longName: String, shortName: String): Option[String] = {
    val longFormat = "--%s".format(longName)
    val shortFormat = "-%s".format(shortName)

    val paramsWithValues = argPairs.flatMap { case (first, second) =>
      if (first == longFormat || first == shortFormat) {
        if (!isParam(second)) Some(second)
        else None
      }
      else None
    }.toList

    val paramsWithoutValues = args.flatMap { arg =>
      if (arg == longFormat || arg == shortFormat) Some("")
      else None
    }.toList
    (paramsWithValues ::: paramsWithoutValues).headOption
  }

  private def argPairs = args.zip(args.drop(1))
  private def isParam(s: String) = s.startsWith("-")
}

Replace deprecated firstOption with headOption

Signed-off-by: Sami Rosendahl <b33c757bb777642ab0d59c699f8d5782929a814f@reaktor.fi>
Signed-off-by: Antti Mattila <422fa99ecc9af171a83eb3d69d51885324be22a3@reaktor.fi>
Acked-by: Aki Saarinen <2c8035bb80cf98a391872dcbe797b269d759f6d9@reaktor.fi>


object Version {

  val logback    = "1.2.1"
  val scalaTest  = "3.0.1"
  val scalaCheck = "1.13.4"
  val scalaz     = "7.2.12"
  val akka       = "2.5.1"
  val akkaClusterManagement = "0.3"
  val akkaHttp   = "10.0.8"
  val leveldb    = "0.7"
  val leveldbjni = "1.8"
  val cassandra  = "0.28"
  val config     = "1.3.1"
  val enumeratum = "1.5.12"
  val inMemoryPersistence = "2.4.17.1"
  val slick      = "3.2.0"
  val h2         = "1.4.193"
  val postgresql = "42.0.0.jre7"
  val scalaCsv = "1.3.4"
  val constructrVersion = "0.17.0"
  val constructrZookeeperVersion = "0.3.3"
  val cassandraUnit = "3.1.3.2"
  val alpakka = "0.9"
  val cassandraDriver = "3.2.0"
}

object Version {

  val logback    = "1.2.1"
  val scalaTest  = "3.0.1"
  val scalaCheck = "1.13.4"
  val scalaz     = "7.2.12"
  val akka       = "2.5.1"
  val akkaClusterManagement = "0.3"
  val akkaHttp   = "10.0.8"
  val leveldb    = "0.7"
  val leveldbjni = "1.8"
  val cassandra  = "0.28"
  val config     = "1.3.1"
  val enumeratum = "1.5.12"
  val inMemoryPersistence = "2.5.1.1"
  val slick      = "3.2.0"
  val h2         = "1.4.193"
  val postgresql = "42.0.0.jre7"
  val scalaCsv = "1.3.4"
  val constructrVersion = "0.17.0"
  val constructrZookeeperVersion = "0.3.3"
  val cassandraUnit = "3.1.3.2"
  val alpakka = "0.9"
  val cassandraDriver = "3.2.0"
}

Update akka-persistence-inmemory to be compatible with akka 2.5.1


import io.hydrosphere.mist.lib.MistJob

object SimpleContext extends MistJob {
  /** Contains implementation of spark job with ordinary [[org.apache.spark.SparkContext]]
    * Abstract method must be overridden
    *
    * @param numbers list of int to process
    * @return result of the job
    */
  def doStuff(numbers: List[Int], multiplier: Option[Int]): Map[String, Any] = {
    val rdd = context.parallelize(numbers)
    Map("result" -> rdd.map(x => x * multiplier.getOrElse(2)).collect())
  }
}

import io.hydrosphere.mist.lib.MistJob

object SimpleContext extends MistJob {
  /** Contains implementation of spark job with ordinary [[org.apache.spark.SparkContext]]
    * Abstract method must be overridden
    *
    * @param numbers list of int to process
    * @return result of the job
    */
  def doStuff(numbers: List[Int], multiplier: Option[Int]): Map[String, Any] = {
    val multiplierValue = multiplier.getOrElse(2)
    val rdd = context.parallelize(numbers)
    Map("result" -> rdd.map(x => x * multiplierValue).collect())
  }
}

Fix optional values in examples

Fix optional values in examples


package domain.model.chat.channel

import domain.model.chat.member.{Member, MemberId}
import domain.model.{Entity, ValueObject}

case class ChannelId(value: Long) extends ValueObject {
  def isUndefined: Boolean = {
    value == ChannelId.undefinedValue
  }
}

object UndefinedId {
  def toChannelId: ChannelId = ChannelId(value = ChannelId.undefinedValue)
}

object ChannelId {
  val undefinedValue = 0L
}

case class ChannelName(name: String) extends ValueObject {
  require(name.length > 0 && name.length <= 128)
}

case class Channel(id: ChannelId, name: ChannelName, participants: Set[MemberId]) extends Entity {

  def join(member: Member): Channel = {
    this.copy(participants = participants + member.id)
  }

  def leave(member: Member): Channel = {
    this.copy(participants = participants - member.id)
  }

  def changeName(name: ChannelName): Channel = {
    this.copy(name = name)
  }

}

package domain.model.chat.channel

import domain.model.chat.member.{Member, MemberId}
import domain.model.{Entity, ValueObject}

case class ChannelId(value: Long) extends ValueObject {
  def isUndefined: Boolean = {
    value == ChannelId.undefinedValue
  }
}

object UndefinedId {
  def toChannelId: ChannelId = ChannelId(value = ChannelId.undefinedValue)
}

object ChannelId {
  val undefinedValue = 0L
}

case class ChannelName(name: String) extends ValueObject {
  require(name.length > 0 && name.length <= 128)
}

class Channel(val id: ChannelId, val name: ChannelName, val participants: Set[MemberId]) extends Entity {

  def join(member: Member): Channel = {
    this.copy(participants = participants + member.id)
  }

  def leave(member: Member): Channel = {
    this.copy(participants = participants - member.id)
  }

  def changeName(name: ChannelName): Channel = {
    this.copy(name = name)
  }

  def copy(id: ChannelId = this.id,
           name: ChannelName = this.name,
           participants: Set[MemberId] = this.participants): Channel = {
    new Channel(id, name, participants)
  }

  def canEqual(other: Any): Boolean = other.isInstanceOf[Channel]

  override def equals(other: Any): Boolean = other match {
    case that: Channel =>
      (that canEqual this) &&
        id == that.id
    case _ => false
  }

  override def hashCode(): Int = {
    val state = Seq(id)
    state.map(_.hashCode()).foldLeft(0)((a, b) => 31 * a + b)
  }

}

object Channel {

  def apply(id: ChannelId, name: ChannelName, participants: Set[MemberId]): Channel = {
    new Channel(id, name, participants)
  }

}

Change channel model from case class to class


/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

package scala.collection.parallel

import java.util.concurrent.ThreadPoolExecutor
import scala.concurrent.forkjoin.ForkJoinPool
import scala.concurrent.ExecutionContext

trait TaskSupport extends Tasks

private[collection] class ForkJoinTaskSupport(val environment: ForkJoinPool = ForkJoinTasks.defaultForkJoinPool)
extends TaskSupport with AdaptiveWorkStealingForkJoinTasks

private[collection] class ThreadPoolTaskSupport(val environment: ThreadPoolExecutor = ThreadPoolTasks.defaultThreadPool)
extends TaskSupport with AdaptiveWorkStealingThreadPoolTasks

private[collection] class ExecutionContextTaskSupport(val environment: ExecutionContext = scala.concurrent.executionContext)
extends TaskSupport with ExecutionContextTasks

/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

package scala.collection.parallel

import java.util.concurrent.ThreadPoolExecutor
import scala.concurrent.forkjoin.ForkJoinPool
import scala.concurrent.ExecutionContext

/** A trait implementing the scheduling of
 *  a parallel collection operation.
 *
 *  Task support objects handle how a task is split and
 *  distributed across processors. A task support object can be
 *  changed in a parallel collection after it has been created,
 *  but only during a quiescent period, i.e. while there are no
 *  concurrent invocations to parallel collection methods.
 */
trait TaskSupport extends Tasks

/** A task support that uses a fork join pool to schedule tasks */
class ForkJoinTaskSupport(val environment: ForkJoinPool = ForkJoinTasks.defaultForkJoinPool)
extends TaskSupport with AdaptiveWorkStealingForkJoinTasks

/** A task support that uses a thread pool executor to schedule tasks */
class ThreadPoolTaskSupport(val environment: ThreadPoolExecutor = ThreadPoolTasks.defaultThreadPool)
extends TaskSupport with AdaptiveWorkStealingThreadPoolTasks

/** A task support that uses an execution context to schedule tasks.
 *
 *  It can be used with the default execution context implementation in the `scala.concurrent` package.
 *  It internally forwards the call to either a forkjoin based task support or a thread pool executor one,
 *  depending on what the execution context uses.
 *
 *  By default, parallel collections are parametrized with this task support object, so parallel collections
 *  share the same execution context backend as the rest of the `scala.concurrent` package.
 */
class ExecutionContextTaskSupport(val environment: ExecutionContext = scala.concurrent.executionContext)
extends TaskSupport with ExecutionContextTasks

Make task support implementations public.


package uk.ac.wellcome.models.transformable.sierra.test.utils

import scala.util.Random

trait SierraUtil {

  /** Returns a random digit as a string.  This is copied from the
    * definition of Random.alphanumeric.
    */
  private def randomNumeric: Stream[Char] = {
    def nextDigit: Char = {
      val chars = '0' to '9'
      chars charAt Random.nextInt(chars.length)
    }

    Stream continually nextDigit
  }

  def createSierraRecordNumberString: String =
    randomNumeric take 7 mkString

}

package uk.ac.wellcome.models.transformable.sierra.test.utils

import java.time.Instant

import uk.ac.wellcome.models.transformable.sierra.SierraItemRecord

import scala.util.Random

trait SierraUtil {

  // A lot of Sierra tests (e.g. mergers) check the behaviour when merging
  // a record with a newer version, or vice versa.  Provide two dates here
  // for convenience.
  val olderDate: Instant = Instant.parse("1999-09-09T09:09:09Z")
  val newerDate: Instant = Instant.parse("2001-01-01T01:01:01Z")

  /** Returns a random digit as a string.  This is copied from the
    * definition of Random.alphanumeric.
    */
  private def randomNumeric: Stream[Char] = {
    def nextDigit: Char = {
      val chars = '0' to '9'
      chars charAt Random.nextInt(chars.length)
    }

    Stream continually nextDigit
  }

  def createSierraRecordNumberString: String =
    randomNumeric take 7 mkString

  def createSierraItemRecordWith(
    id: String = createSierraRecordNumberString,
    data: String = "",
    modifiedDate: Instant = Instant.now,
    bibIds: List[String] = List(),
    unlinkedBibIds: List[String] = List(),
    version: Int = 0
  ): SierraItemRecord = {
    val recordData = if (data == "") {
      s"""{"id": "$id"}"""
    } else data

    SierraItemRecord(
      id = id,
      data = recordData,
      modifiedDate = modifiedDate,
      bibIds = bibIds,
      unlinkedBibIds = unlinkedBibIds,
      version = version
    )
  }

  def createSierraItemRecord: SierraItemRecord = createSierraItemRecordWith()
}

Create some helper methods for instances of SierraItemRecord


import sbt._
import Keys._

object ApplicationBuild extends Build {

  val appName         = "play-scala-mongodb"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    "org.reactivemongo" %% "play2-reactivemongo" % "0.9" exclude("org.scala-stm", "scala-stm_2.10.0")
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
  )

}

import sbt._
import Keys._

object ApplicationBuild extends Build {

  val appName         = "play-scala-mongodb"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka22" exclude("org.scala-stm", "scala-stm_2.10.0")
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
  )

}

Update reactivemongo version to one that supports play 2.2.


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.23"

exportJars := true

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

exportJars := true

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


import AndroidKeys._

AndroidProject.androidSettings

AndroidManifestGenerator.settings

TypedResources.settings

AndroidMarketPublish.settings

name := "Spiel"

version := "2.1.1"

versionCode := 12

scalaVersion := "2.9.2"

scalacOptions ++= Seq("-deprecation")

platformName in Android := "android-16"

keystorePath in Android := Path.userHome / ".keystore" / "spiel.keystore"

keyalias in Android := "spiel"

libraryDependencies := Seq(
  "com.google.android" % "support-v4" % "r7",
  "rhino" % "js" % "1.7R2" from "http://android-scripting.googlecode.com/hg/rhino/rhino1_7R2.jar",
  "net.databinder" % "dispatch-lift-json_2.9.1" % "0.7.8",
  "org.ccil.cowan.tagsoup" % "tagsoup" % "1.2.1"
)

proguardOption in Android := """
  -keep class info.spielproject.spiel.** { *; }
  -keep class org.mozilla.javascript.** { *; }
"""

import AndroidKeys._

AndroidProject.androidSettings

AndroidManifestGenerator.settings

TypedResources.settings

AndroidMarketPublish.settings

name := "Spiel"

version := "2.1.1"

versionCode := 13

scalaVersion := "2.9.2"

scalacOptions ++= Seq("-deprecation")

platformName in Android := "android-16"

keystorePath in Android := Path.userHome / ".keystore" / "spiel.keystore"

keyalias in Android := "spiel"

libraryDependencies := Seq(
  "com.google.android" % "support-v4" % "r7",
  "rhino" % "js" % "1.7R2" from "http://android-scripting.googlecode.com/hg/rhino/rhino1_7R2.jar",
  "net.databinder" % "dispatch-lift-json_2.9.1" % "0.7.8",
  "org.ccil.cowan.tagsoup" % "tagsoup" % "1.2.1"
)

proguardOption in Android := """
  -keep class info.spielproject.spiel.** { *; }
  -keep class org.mozilla.javascript.** { *; }
"""

Bump versionCode to 13 in preparation for multi-APK 2.1.1 release.

--HG--
extra : convert_revision : 6345bd2e026d86251b7d8d9f26312fbabb1b8752


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.5"

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

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

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

scalacOptions ++= allScalacOptions

version := "0.2.81"

autocommit: Update configuration to record version 0.2.81


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

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.39"

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

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

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

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.0.40"

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


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.5"

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

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

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

version := "0.1.68"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.5"

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

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

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

version := "0.1.69"

autocommit: Update configuration to record version 0.1.69


import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.38"

exportJars := true

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

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

import com.github.retronym.SbtOneJar._

oneJarSettings

name := "api-build"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

version := "0.1.39"

exportJars := true

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

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

autocommit: Update configuration to record version 0.1.39


package info.spielproject

import android.content._
import android.util.Log
import android.view.accessibility._

package object spiel {

  implicit def accessibilityEvent2RichEvent(e:AccessibilityEvent) =
    new RichEvent(e)

  implicit def accessibilityNodeInfo2RichNode(n:AccessibilityNodeInfo) =
    RichNode(n)

  implicit def fToBroadcastReceiver(f:(Context, Intent) => Unit) =
    new BroadcastReceiver {
      override def onReceive(c:Context, i:Intent) {
        try {
          f(c, i)
        } catch {
          case e:Throwable =>
            Log.e("spiel", "Error receiving broadcast", e)
        }
      }
    }

}

package info.spielproject

import android.content._
import android.util.Log
import android.view.accessibility._

package object spiel {

  implicit def accessibilityEvent2RichEvent(e:AccessibilityEvent) =
    new RichEvent(e)

  implicit def accessibilityNodeInfo2RichNode(n:AccessibilityNodeInfo) =
    RichNode(n)

  implicit def fToBroadcastReceiver(f:(Context, Intent) => Unit) =
    new BroadcastReceiver {
      override def onReceive(c:Context, i:Intent) {
        try {
          f(c, i)
        } catch {
          case e:Throwable =>
            Log.e("spiel", "Error receiving broadcast", e)
        }
      }
    }

  implicit def fToRunnable(f: => Unit) = new Runnable {
    def run() { f }
  }

}

Add implicit conversion to Runnable.

Add implicit conversion to Runnable.


import ReleaseTransformations._

organization := "org.konstructs"

name := "konstructs-server"

scalaVersion := "2.10.4"

licenses += ("MIT", url("http://opensource.org/licenses/MIT"))

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

val akkaVersion = "2.2.4"

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

libraryDependencies ++= Seq(
  "org.konstructs"         %  "konstructs-server-api" % "0.1.17",
  "com.typesafe.akka"      %% "akka-actor"            % akkaVersion,
  "commons-io"             %  "commons-io"            % "2.4",
  "com.google.code.gson"   %  "gson"                  % "2.6.2",
  "com.sksamuel.scrimage"  %% "scrimage-core"         % "1.4.2",
  "org.scalatest"          %% "scalatest"             % "2.2.1"  % "test"
)

bintrayOrganization := Some("konstructs")

fork in run := true

releaseProcess := Seq[ReleaseStep](
  checkSnapshotDependencies,
  inquireVersions,
  runTest,
  setReleaseVersion,
  commitReleaseVersion,
  tagRelease,
  setNextVersion,
  commitNextVersion,
  pushChanges
)

assemblyJarName in assembly := s"${name.value}-${version.value}.jar"

import ReleaseTransformations._

organization := "org.konstructs"

name := "konstructs-server"

scalaVersion := "2.10.4"

licenses += ("MIT", url("http://opensource.org/licenses/MIT"))

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

val akkaVersion = "2.2.4"

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

libraryDependencies ++= Seq(
  "org.konstructs"         %  "konstructs-server-api" % "0.1.18",
  "com.typesafe.akka"      %% "akka-actor"            % akkaVersion,
  "commons-io"             %  "commons-io"            % "2.4",
  "com.google.code.gson"   %  "gson"                  % "2.6.2",
  "com.sksamuel.scrimage"  %% "scrimage-core"         % "1.4.2",
  "org.scalatest"          %% "scalatest"             % "2.2.1"  % "test"
)

bintrayOrganization := Some("konstructs")

fork in run := true

releaseProcess := Seq[ReleaseStep](
  checkSnapshotDependencies,
  inquireVersions,
  runTest,
  setReleaseVersion,
  commitReleaseVersion,
  tagRelease,
  setNextVersion,
  commitNextVersion,
  pushChanges
)

assemblyJarName in assembly := s"${name.value}-${version.value}.jar"

Use API that is backwards compatible with old JSON


name := "lib-reference"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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

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

name := "lib-reference"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

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

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

autocommit: Update configuration to record version 0.0.2


package mesosphere.chaos.http

import org.eclipse.jetty.server.NCSARequestLog
import org.slf4j.LoggerFactory

class ChaosRequestLog extends NCSARequestLog {

  val lineSepLength = System.lineSeparator().length

  private[this] val log = LoggerFactory.getLogger(getClass.getName)

  override def write(requestEntry: String) {
    // Remove line separator because jul will add it
    log.info(requestEntry.substring(0, requestEntry.length - lineSepLength))
  }
}

package mesosphere.chaos.http

import org.eclipse.jetty.server.NCSARequestLog
import org.slf4j.LoggerFactory

class ChaosRequestLog extends NCSARequestLog {

  val lineSepLength = System.lineSeparator().length

  private[this] val log = LoggerFactory.getLogger(getClass.getName)

  setLogLatency(true)

  override def write(requestEntry: String) {
    // Remove line separator because jul will add it
    log.info(requestEntry.substring(0, requestEntry.length - lineSepLength))
  }
}

Add request time to the logs

Add request time to the logs


/**
 * Copyright (C) 2017 Orbeon, Inc.
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the
 * GNU Lesser General Public License as published by the Free Software Foundation; either version
 * 2.1 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
 */
package org.orbeon.xforms

// Scala.js starting point for XForms
object XFormsApp extends App {

  def load(): Unit = {
    InitSupport
    StateHandling
    Upload
  }
}

/**
 * Copyright (C) 2017 Orbeon, Inc.
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the
 * GNU Lesser General Public License as published by the Free Software Foundation; either version
 * 2.1 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
 */
package org.orbeon.xforms

// Scala.js starting point for XForms
object XFormsApp extends App {

  def load(): Unit = {
    // NOTE: `object`s which have `@JSExportTopLevel` do not need to be explicitly called here.
    Upload
  }
}

Remove unneeded calls to objects

Remove unneeded calls to objects


package dregex

import org.scalatest.FunSuite
import dregex.impl.Util

class PerformanceTest extends FunSuite {

    test("slow regexs") {
      val (regexes, elapsed1) = Util.time {
        Regex.compile(Seq(
            "qwertyuiopasd",
            "/aaaaaa/(?!xxc)(?!xxd)(?!xxe)(?!xxf)(?!xxg)(?!xxh).*",
            "/aaaaaa/(?!x+c)(?!x+d)(?!x+e)(?!x+f)(?!x+g)(?!x+h).*",
            "/aaaaaa/(?!x+c|x+d|x+e|x+f|x+g|x+h).*",
            "/aaaaaa/(?!xxc)a(?!xxd)b(?!xxe)c(?!xxf).*", // disables lookahead combinations
            "/aaaaaa/(?!xxc|xxd|xxe|xxf|xxg|xxh).*"
          )).unzip._2
      }
      info(s"compilation time: ${elapsed1 / 1000} ms")
      val (_, elapsed2) = Util.time {
        regexes.tail.foreach(_ doIntersect regexes.head)
      }
      info(s"intersection time: ${elapsed2 / 1000} ms")
    }

}

package dregex

import org.scalatest.FunSuite
import dregex.impl.Util

class PerformanceTest extends FunSuite {

  test("slow regexs") {
    val (regexes, elapsed1) = Util.time {
      Regex.compile(Seq(
        "qwertyuiopasd",
        "/aaaaaa/(?!xxc)(?!xxd)(?!xxe)(?!xxf)(?!xxg)(?!xxh)[a-zA-Z0-9]{7}.*",
        "/aaaaaa/(?!x+c)(?!x+d)(?!x+e)(?!x+f)(?!x+g)(?!x+h)[a-zA-Z0-9]{7}.*",
        "/aaaaaa/(?!x+c|x+d|x+e|x+f|x+g|x+h)[a-zA-Z0-9]{7}.*",
        "/aaaaaa/(?!xxc)a(?!xxd)b(?!xxx)c(?!xxf)[a-zA-Z0-9]{7}.*", // disables lookahead combinations
        "/aaaaaa/(?!xxc|xxd|xxe|xxf|xxg|xxh)[a-zA-Z0-9]{7}.*",
        "/aaaaaa/(?!xxc.*)(?!xxd.*)(?!xxe.*)(?!xxf.*)(?!xxg.*)[a-zA-Z0-9]{7}.*"
        )).unzip._2
    }
    info(s"compilation time: $elapsed1")
    val (_, elapsed2) = Util.time {
      regexes.tail.foreach(_ doIntersect regexes.head)
    }
    info(s"intersection time: $elapsed2")
  }

}

Make performance test more strict

Make performance test more strict


package org.http4s.examples.blaze

/**
* @author Bryce Anderson
*         Created on 3/26/14.
*/

import org.http4s.blaze.BlazeServer
import org.http4s.examples.ExampleService

object BlazeExample extends App {
  println("Starting Http4s-blaze example")
  BlazeServer.newBuilder
    .mountService(ExampleService.service, "/http4s")
    .run()
}

package org.http4s.examples.blaze

import org.http4s.blaze.BlazeServer
import org.http4s.examples.ExampleService

object BlazeExample extends App {
  println("Starting Http4s-blaze example")
  BlazeServer.newBuilder
    .mountService(ExampleService.service, "/http4s")
    .run()
}

Remove author tags. Fix type error with Message.

We need to avoid code of the form
```scala
def foo = { ??? }       // BAD
def bar: Int = { ??? }  // GOOD
```
due to possible unintended types happening when refactoring etc.


lazy val server = (project in file("server"))
  .settings(commonSettings)
  .settings(
    scalaJSProjects := Seq(client),
    pipelineStages in Assets := Seq(scalaJSPipeline),
    pipelineStages := Seq(digest, gzip),
    // triggers scalaJSPipeline when using compile or continuous compilation
    compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value,
    libraryDependencies ++= Seq(
      "com.vmunier" %% "scalajs-scripts" % "1.1.4",
      guice,
      specs2 % Test
    ),
    // Compile the project before generating Eclipse files, so that generated .scala or .class files for views and routes are present
    EclipseKeys.preTasks := Seq(compile in Compile)
  )
  .enablePlugins(PlayScala)
  .dependsOn(sharedJvm)

lazy val client = (project in file("client"))
  .settings(commonSettings)
  .settings(
    scalaJSUseMainModuleInitializer := true,
    libraryDependencies ++= Seq(
      "org.scala-js" %%% "scalajs-dom" % "1.0.0"
    )
  )
  .enablePlugins(ScalaJSPlugin, ScalaJSWeb)
  .dependsOn(sharedJs)

lazy val shared = crossProject(JSPlatform, JVMPlatform)
  .crossType(CrossType.Pure)
  .in(file("shared"))
  .settings(commonSettings)
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js

lazy val commonSettings = Seq(
  scalaVersion := "2.13.1",
  organization := "$organization$"
)

lazy val server = (project in file("server"))
  .settings(commonSettings)
  .settings(
    scalaJSProjects := Seq(client),
    pipelineStages in Assets := Seq(scalaJSPipeline),
    pipelineStages := Seq(digest, gzip),
    // triggers scalaJSPipeline when using compile or continuous compilation
    compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value,
    libraryDependencies ++= Seq(
      "com.vmunier" %% "scalajs-scripts" % "1.1.4",
      guice,
      specs2 % Test
    ),
    // Compile the project before generating Eclipse files, so that generated .scala or .class files for views and routes are present
    EclipseKeys.preTasks := Seq(compile in Compile)
  )
  .enablePlugins(PlayScala)
  .dependsOn(sharedJvm)

lazy val client = (project in file("client"))
  .settings(commonSettings)
  .settings(
    scalaJSUseMainModuleInitializer := true,
    libraryDependencies ++= Seq(
      "org.scala-js" %%% "scalajs-dom" % "1.0.0"
    )
  )
  .enablePlugins(ScalaJSPlugin, ScalaJSWeb)
  .dependsOn(sharedJs)

lazy val shared = crossProject(JSPlatform, JVMPlatform)
  .crossType(CrossType.Pure)
  .in(file("shared"))
  .settings(commonSettings)
  .jsConfigure(_.enablePlugins(ScalaJSWeb))
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js

lazy val commonSettings = Seq(
  scalaVersion := "2.13.1",
  organization := "$organization$"
)

Enable ScalaJSWeb on the shared project

Enable ScalaJSWeb on the shared project


package latis.writer

import java.io.OutputStream
import java.io.DataOutputStream
import latis.dm._
import java.nio.ByteOrder
import java.nio.ByteBuffer
import java.nio.charset.Charset
import latis.util.StringUtils
import java.io.ByteArrayOutputStream

/**
 * Write data as binary to an in memory array of Bytes.
 */
class ByteArrayWriter extends BinaryWriter {

  /**
   * Override to always write to a ByteArrayOutputStream.
   */
  override def getOutputStream = _out
  private val _out = new ByteArrayOutputStream()
  //TODO: do we need to close this?

  /**
   * Provide access to the array of Bytes (after writing the Dataset).
   */
  def getBytes: Array[Byte] = _out.toByteArray()

}

object ByteArrayWriter {

  def apply(): ByteArrayWriter = new ByteArrayWriter

  /**
   * Convenience method to get the array of bytes from a dataset.
   */
  def getBytes(dataset: Dataset): Array[Byte] = {
    val writer = ByteArrayWriter()
    writer.write(dataset)
    writer.getBytes
  }
}

package latis.writer

import java.io.OutputStream
import java.io.DataOutputStream
import latis.dm._
import java.nio.ByteOrder
import java.nio.ByteBuffer
import java.nio.charset.Charset
import latis.util.StringUtils
import java.io.ByteArrayOutputStream

/**
 * Write data as binary to an in memory array of Bytes.
 */
class ByteArrayWriter extends BinaryWriter {

  /**
   * Override to always write to a ByteArrayOutputStream.
   */
  override def getOutputStream = _out
  private val _out = new ByteArrayOutputStream()

  /**
   * Provide access to the array of Bytes (after writing the Dataset).
   */
  def getBytes: Array[Byte] = _out.toByteArray()

}

object ByteArrayWriter {

  def apply(): ByteArrayWriter = new ByteArrayWriter

  /**
   * Convenience method to get the array of bytes from a dataset.
   */
  def getBytes(dataset: Dataset): Array[Byte] = {
    val writer = ByteArrayWriter()
    writer.write(dataset)
    writer.getBytes
  }
}

Remove TODO. No need to worry about closing the ByteArrayOutoutStream.

Former-commit-id: c1f1b383fcb32dff3ae6869f790158b3d59ae229


scalaVersion := "2.10.2"

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

libraryDependencies ++= Seq(
  "edu.berkeley.cs" %% "chisel" % "latest.release"
)

scalaVersion := "2.10.2"

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

libraryDependencies ++= Seq(
  "edu.berkeley.cs" %% "chisel" % "2.2.21"
)

Set the chisel version to be fixed at 2.2.21.

The latest version; 2.2.22, is buggy. The expect function is broken on
the ROM test. It will give a PASS even though the expect function is
given two different values.


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

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

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

case object NullConstant extends Constant {
  type Value = Null

  def value: Null = ???

  val tpe: Type = NullType
}

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

  val tpe: Type = TypeUtils.stringClassType
}

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

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

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

case object NullConstant extends Constant {
  type Value = Null

  def value: Null = ???

  val tpe: Type = NullType
}

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

  lazy val tpe: Type = TypeUtils.stringClassType
}

Make tpe for StringConstant a lazy val

Make tpe for StringConstant a lazy val


/*
 * class A { { val x = this } }
class B(x: Int) {
  class C(x: Int)
      extends B({
        val test = this
        x
      }) {
    def this() = {
      this({
        1
      })
    }
  }
}
*/
// Minimized version
class D(x: Int) {
  class E(x: Int) extends D({val test = D.this; x})
}

class A { { val x = this } }
class B(x: Int) {
  class C(x: Int)
      extends B({
        val test = this
        x
      }) {
    def this() = {
      this({
        1
      })
    }
  }
}

// Minimized version
class D(x: Int) {
  class E(x: Int) extends D({val test = D.this; x})
}

Add original test to test case

Add original test to test case


package com.lucidworks.spark

import scala.collection.concurrent.TrieMap

/**
  * Spark made it impossible to lookup an accumulator by name. Holding a global singleton here, so that external
  * clients that use this library can access the accumulators that are created by spark-solr for reading/writing
  * Get rid of this once Spark ties accumulators to the context SPARK-13051
  *
  * Not really happy about the global singleton but I don't see any other way to do it
  */
object SparkSolrAccumulatorContext {

  private val accMapping = TrieMap.empty[String, Long]

  def remove(name: String): Unit = {
    accMapping.remove(name)
  }

  def add(name: String, id: Long): Unit = {
    accMapping.put(name, id)
  }

  def getId(name: String): Option[Long] = {
    accMapping.get(name)
  }
}

package com.lucidworks.spark

import scala.collection.concurrent.TrieMap

/**
  * Spark made it impossible to lookup an accumulator by name. Holding a global singleton here, so that external
  * clients that use this library can access the accumulators that are created by spark-solr for reading/writing
  * Get rid of this once Spark ties accumulators to the context SPARK-13051
  *
  * Not really happy about the global singleton but I don't see any other way to do it
  */
object SparkSolrAccumulatorContext {

  private val accMapping = TrieMap.empty[String, Long]

  def remove(name: String): Unit = {
    accMapping.remove(name)
  }

  def add(name: String, id: Long): Unit = {
    accMapping.put(name, id)
  }

  def getId(name: String): Option[Long] = {
    accMapping.get(name)
  }

  override def toString = s"SparkSolrAccumulatorContext($accMapping)"
}

Add toString method to accumulator context


package io.rouz

import java.lang.Thread.currentThread

import io.rouz.flo.dsl.FloTask.named
import io.rouz.flo.dsl.TaskBuilder0

import scala.language.implicitConversions
import scala.reflect.ClassTag
import scala.util.DynamicVariable

/**
  * Package object with task wiring dsl helpers
  */
package object flo {

  def defTask[T: ClassTag](args: Any*): TaskBuilder0[T] =
    named[T](currentMethodName(), args: _*)

  def defTaskNamed[T: ClassTag](name: String, args: Any*): TaskBuilder0[T] =
    named[T](name, args: _*)

  implicit def toTask[T](t: => T): Task[T] = currentBuilder.process(t)

  implicit class TB0Dsl[T](val tb0: TaskBuilder0[T]) extends AnyVal {
    def dsl(f: => Task[T]): Task[T] =
      dynamicBuilder.withValue(tb0)(f)
  }

  def $[T]: TaskBuilder0[T] = currentBuilder
  def ▫[T]: TaskBuilder0[T] = currentBuilder

  private def currentBuilder[T]: TaskBuilder0[T] = {
    val builder = dynamicBuilder.value
    if (builder == null) {
      throw new RuntimeException("Builder accessor used outside a defTask scope")
    }

    builder.asInstanceOf[TaskBuilder0[T]]
  }
  private val dynamicBuilder = new DynamicVariable[TaskBuilder0[_]](null)
  private def currentMethodName(): String =
    currentThread.getStackTrace()(3).getMethodName.replaceAll("\\$.*$", "")
}

package io.rouz

import java.lang.Thread.currentThread

import io.rouz.flo.dsl.FloTask.named
import io.rouz.flo.dsl.TaskBuilder0

import scala.language.implicitConversions
import scala.reflect.ClassTag
import scala.util.DynamicVariable

/**
  * Package object with task wiring dsl helpers
  */
package object flo {

  def defTask[T: ClassTag](args: Any*): TaskBuilder0[T] =
    named[T](currentMethodName(), args: _*)

  def defTaskNamed[T: ClassTag](name: String, args: Any*): TaskBuilder0[T] =
    named[T](name, args: _*)

  implicit class TB0Dsl[T](val tb0: TaskBuilder0[T]) extends AnyVal {
    def dsl(f: => Task[T]): Task[T] =
      dynamicBuilder.withValue(tb0)(f)
  }

  def $[T]: TaskBuilder0[T] = currentBuilder
  def ▫[T]: TaskBuilder0[T] = currentBuilder

  private def currentBuilder[T]: TaskBuilder0[T] = {
    val builder = dynamicBuilder.value
    if (builder == null) {
      throw new RuntimeException("Builder accessor used outside a defTask scope")
    }

    builder.asInstanceOf[TaskBuilder0[T]]
  }
  private val dynamicBuilder = new DynamicVariable[TaskBuilder0[_]](null)
  private def currentMethodName(): String =
    currentThread.getStackTrace()(3).getMethodName.replaceAll("\\$.*$", "")
}

Remove unused implicit conversion function


package spark

import org.scalatest.FunSuite
import java.io.{ByteArrayOutputStream, ByteArrayInputStream}
import util.Random

class UtilsSuite extends FunSuite {

  test("memoryBytesToString") {
    assert(Utils.memoryBytesToString(10) === "10.0B")
    assert(Utils.memoryBytesToString(1500) === "1500.0B")
    assert(Utils.memoryBytesToString(2000000) === "1953.1KB")
    assert(Utils.memoryBytesToString(2097152) === "2.0MB")
    assert(Utils.memoryBytesToString(2306867) === "2.2MB")
    assert(Utils.memoryBytesToString(5368709120L) === "5.0GB")
  }

  test("copyStream") {
    //input array initialization
    val bytes = Array.ofDim[Byte](9000)
    Random.nextBytes(bytes)

    val os = new ByteArrayOutputStream()
    Utils.copyStream(new ByteArrayInputStream(bytes), os)

    assert(os.toByteArray.toList.equals(bytes.toList))
  }
}

package spark

import org.scalatest.FunSuite
import java.io.{ByteArrayOutputStream, ByteArrayInputStream}
import scala.util.Random

class UtilsSuite extends FunSuite {

  test("memoryBytesToString") {
    assert(Utils.memoryBytesToString(10) === "10.0B")
    assert(Utils.memoryBytesToString(1500) === "1500.0B")
    assert(Utils.memoryBytesToString(2000000) === "1953.1KB")
    assert(Utils.memoryBytesToString(2097152) === "2.0MB")
    assert(Utils.memoryBytesToString(2306867) === "2.2MB")
    assert(Utils.memoryBytesToString(5368709120L) === "5.0GB")
  }

  test("copyStream") {
    //input array initialization
    val bytes = Array.ofDim[Byte](9000)
    Random.nextBytes(bytes)

    val os = new ByteArrayOutputStream()
    Utils.copyStream(new ByteArrayInputStream(bytes), os)

    assert(os.toByteArray.toList.equals(bytes.toList))
  }
}

Use full package name in import

Use full package name in import


import Settings._
import Testing._

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

lazy val backend = (project in file("backend"))
  .dependsOn(core % "test->test;compile->compile")
  .settings(backendSettings:_*)

lazy val engine = (project in file("engine"))
  .dependsOn(core % "test->test;compile->compile", backend)
  .settings(engineSettings:_*)

lazy val root = (project in file("."))
  .dependsOn(engine % "test->test;compile->compile", core % "test->test;compile->compile", backend)
  .aggregate(core, backend, engine)
  .settings(rootSettings:_*)
  .configs(AllTests).settings(inConfig(AllTests)(Defaults.testTasks): _*)
  .configs(NoTests).settings(inConfig(NoTests)(Defaults.testTasks): _*)
  .configs(DockerTest).settings(inConfig(DockerTest)(Defaults.testTasks): _*)
  .configs(NoDockerTest).settings(inConfig(NoDockerTest)(Defaults.testTasks): _*)
  .configs(CromwellIntegrationTest).settings(inConfig(CromwellIntegrationTest)(Defaults.testTasks): _*)
  .configs(CromwellNoIntegrationTest).settings(inConfig(CromwellNoIntegrationTest)(Defaults.testTasks): _*)

import Settings._
import Testing._

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

lazy val backend = (project in file("backend"))
  .dependsOn(core % "test->test;compile->compile")
  .settings(backendSettings:_*)

lazy val engine = (project in file("engine"))
  .dependsOn(core % "test->test;compile->compile", backend)
  .settings(engineSettings:_*)
  .configs(AllTests).settings(inConfig(AllTests)(Defaults.testTasks): _*)
  .configs(NoTests).settings(inConfig(NoTests)(Defaults.testTasks): _*)
  .configs(DockerTest).settings(inConfig(DockerTest)(Defaults.testTasks): _*)
  .configs(NoDockerTest).settings(inConfig(NoDockerTest)(Defaults.testTasks): _*)
  .configs(CromwellIntegrationTest).settings(inConfig(CromwellIntegrationTest)(Defaults.testTasks): _*)
  .configs(CromwellNoIntegrationTest).settings(inConfig(CromwellNoIntegrationTest)(Defaults.testTasks): _*)

lazy val root = (project in file("."))
  .dependsOn(engine % "test->test;compile->compile", core % "test->test;compile->compile", backend)
  .aggregate(core, backend, engine)
  .settings(rootSettings:_*)
  .configs(AllTests).settings(inConfig(AllTests)(Defaults.testTasks): _*)
  .configs(NoTests).settings(inConfig(NoTests)(Defaults.testTasks): _*)
  .configs(DockerTest).settings(inConfig(DockerTest)(Defaults.testTasks): _*)
  .configs(NoDockerTest).settings(inConfig(NoDockerTest)(Defaults.testTasks): _*)
  .configs(CromwellIntegrationTest).settings(inConfig(CromwellIntegrationTest)(Defaults.testTasks): _*)
  .configs(CromwellNoIntegrationTest).settings(inConfig(CromwellNoIntegrationTest)(Defaults.testTasks): _*)

Make sure the test configs can cascade through


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.6"

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

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

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

scalacOptions ++= allScalacOptions

version := "0.2.96"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.6"

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

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

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

scalacOptions ++= allScalacOptions

version := "0.2.97"

autocommit: Update configuration to record version 0.2.97


lazy val root = (project in file(".")).settings(
  name := "scalactic",
  version := "scalactic-220826-ecr",
  scalaVersion := "2.13.5",
  libraryDependencies ++= Seq(
    "org.scalatestplus.play" %% "scalatestplus-play" % "4.0.3"
  ),
  fork := false,
  Docker / packageName := "artima/scalactic-website",
  Docker / maintainer := "Artima Inc.",
  dockerExposedPorts ++= Seq(9000),
  dockerUpdateLatest := true,
  Universal / javaOptions ++= Seq(
    // -J params will be added as jvm parameters
    "-J-Xmx256m",
    "-J-Xms128m"
  )
  //classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat  // Added in sbt 1.3 (https://www.scala-sbt.org/1.x/docs/sbt-1.3-Release-Notes.html), but still not working, so we fall back to sbt 1.2.
).enablePlugins(PlayScala, JavaServerAppPackaging, DockerPlugin)

lazy val root = (project in file(".")).settings(
  name := "scalactic",
  version := "scalactic-220916-ecr",
  scalaVersion := "2.13.5",
  libraryDependencies ++= Seq(
    "org.scalatestplus.play" %% "scalatestplus-play" % "4.0.3"
  ),
  fork := false,
  Docker / packageName := "artima/scalactic-website",
  Docker / maintainer := "Artima Inc.",
  dockerExposedPorts ++= Seq(9000),
  dockerUpdateLatest := true,
  Universal / javaOptions ++= Seq(
    // -J params will be added as jvm parameters
    "-J-Xmx128m",
    "-J-Xms64m"
  )
  //classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat  // Added in sbt 1.3 (https://www.scala-sbt.org/1.x/docs/sbt-1.3-Release-Notes.html), but still not working, so we fall back to sbt 1.2.
).enablePlugins(PlayScala, JavaServerAppPackaging, DockerPlugin)

Set heap size to 64-128mb.

Set heap size to 64-128mb.


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.2"

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

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

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

version := "0.1.27"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.2"

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

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

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

version := "0.1.28"

autocommit: Update configuration to record version 0.1.28


import play.PlayImport._

name := """minecraft-rcon"""

organization := "io.rampant.minecraft"

version := "1.1-SNAPSHOT"

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

S3Resolver.defaults

scalaVersion := "2.11.1"

resolvers += "spray repo" at "http://repo.spray.io"

resolvers ++= Seq[Resolver](
	s3resolver.value("Releases resolver", s3("rampant.io.releases")),
	s3resolver.value("Snapshots resolver", s3("rampant.io.snapshots"))
)

libraryDependencies ++= Seq(
	cache, ws,
	"io.rampant.minecraft" %% "scala-rcon" % "0.1-SNAPSHOT" changing() withSources(),
	"org.webjars" % "bootstrap" % "3.2.0",
	"com.decodified" %% "scala-ssh" % "0.6.4",
	"org.bouncycastle" % "bcprov-jdk16" % "1.46",
	"com.jcraft" % "jzlib" % "1.1.3"
)

import play.PlayImport._

name := """minecraft-rcon"""

organization := "io.rampant.minecraft"

version := "1.1-SNAPSHOT"

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

S3Resolver.defaults

scalaVersion := "2.11.1"

resolvers += "spray repo" at "http://repo.spray.io"

resolvers ++= Seq[Resolver](
	"Rampant I/O Releases" at s3("rampant.io.releases").toHttp,
	"Rampant I/O Snapshots" at s3("rampant.io.snapshots").toHttp
)

libraryDependencies ++= Seq(
	cache, ws,
	"io.rampant.minecraft" %% "scala-rcon" % "0.1-SNAPSHOT" changing() withSources(),
	"org.webjars" % "bootstrap" % "3.2.0",
	"com.decodified" %% "scala-ssh" % "0.6.4",
	"org.bouncycastle" % "bcprov-jdk16" % "1.46",
	"com.jcraft" % "jzlib" % "1.1.3"
)

Update to use public http for s3 resolvers


import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.3.10"

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

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

import play.PlayImport.PlayKeys._

name := "lib-play"

organization := "io.flow"

scalaVersion in ThisBuild := "2.11.8"

crossScalaVersions := Seq("2.11.8")

version := "0.3.11"

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

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

autocommit: Update configuration to record version 0.3.11


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.6"

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

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

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

scalacOptions ++= allScalacOptions

version := "0.2.97"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion := "2.13.6"

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

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

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

scalacOptions ++= allScalacOptions

version := "0.2.98"

autocommit: Update configuration to record version 0.2.98


name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.2"

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

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

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

version := "0.1.25"

name := "lib-reference-scala"

organization := "io.flow"

scalaVersion in ThisBuild := "2.12.2"

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

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

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

version := "0.1.26"

autocommit: Update configuration to record version 0.1.26


name := "test"

version := "1.0"

scalaVersion := "2.11.8"

libraryDependencies ++= Seq(
  "org.apache.commons" % "commons-email" % "1.3.2",

  "org.scalatest" %% "scalatest" % "2.2.1" % "test"
)

name := "slick-repo"

version := "1.0-SNAPSHOT"

scalaVersion := "2.11.8"

libraryDependencies ++= Seq(
  "org.scalatest" %% "scalatest" % "2.2.1" % "test"
)

Remove initial test project setup and configure first snapshot


package enju.ccg.parser
import enju.ccg.lexicon.{PoS, JapanesePoS, Category}
import enju.ccg.lexicon.Direction._

trait HeadFinder {
  type NodeInfo = HeadFinder.NodeInfo
  def get(left:NodeInfo, right:NodeInfo): Direction
}
object HeadFinder {
  case class NodeInfo(pos:PoS, category:Category, headCategory:Category)
}

// TODO: write rule; currently deterministic
object EnglishHeadFinder extends HeadFinder { def get(left:NodeInfo, right:NodeInfo) = Right }

object JapaneseHeadFinder extends HeadFinder {
  def get(left:NodeInfo, right:NodeInfo) = Right // (left, right) match {
  //   case (JapanesePoS(_,vL,conjL,hierarL), JapanesePoS(_,vR,conjR,hierarR)) => Right
  //   case _ => throw new RuntimeException("JapaneseHeadFinder should be used with JapanesePoS")
  // }
}

package enju.ccg.parser
import enju.ccg.lexicon.{PoS, JapanesePoS, Category}
import enju.ccg.lexicon.Direction._

trait HeadFinder {
  type NodeInfo = HeadFinder.NodeInfo
  def get(left:NodeInfo, right:NodeInfo): Direction
}
object HeadFinder {
  case class NodeInfo(pos:PoS, category:Category, headCategory:Category)
}

// TODO: write rule; currently deterministic
object EnglishHeadFinder extends HeadFinder { def get(left:NodeInfo, right:NodeInfo) = Right }

object JapaneseHeadFinder extends HeadFinder {
  val Symbol = "記号"
  def get(left:NodeInfo, right:NodeInfo) = {
    val leftPos = left.pos.first.v
    val rightPos = right.pos.first.v
    if (rightPos == Symbol) Left else Right
  }
}

Implement hard-coded head finding rules for Japanese based on PoS


addSbtPlugin("com.github.sbt"       % "sbt-pgp"                       % "2.1.2")
addSbtPlugin("org.scoverage"        % "sbt-scoverage"                 % "1.6.0")
addSbtPlugin("com.typesafe.sbt"     % "sbt-git"                       % "1.0.1")
addSbtPlugin("org.scala-js"         % "sbt-scalajs"                   % "1.6.0")
addSbtPlugin("org.portable-scala"   % "sbt-scalajs-crossproject"      % "1.0.0")
addSbtPlugin("org.portable-scala"   % "sbt-scala-native-crossproject" % "1.0.0")
addSbtPlugin("org.xerial.sbt"       % "sbt-sonatype"                  % "3.9.7")
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.0")

// 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("org.scoverage"        % "sbt-scoverage"                 % "1.6.0")
addSbtPlugin("com.typesafe.sbt"     % "sbt-git"                       % "1.0.1")
addSbtPlugin("org.scala-js"         % "sbt-scalajs"                   % "1.6.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.7")
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.0")

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

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


addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.10.1")

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

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

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

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

addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.10.1")

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

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

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

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

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


package com.campudus.scycle

import com.campudus.scycle.Scycle._
import com.campudus.scycle.dom._
import rxscalajs._

import scala.scalajs.js.JSApp
import scala.scalajs.js.annotation.JSExport

@JSExport
object ScycleApp extends JSApp {

  @JSExport
  def main(): Unit = {
    println("main export")

    Scycle.run(logic, drivers)
  }

  val drivers: DriversDefinition = Map[String, DriverFunction[_, _]](
    "dom" -> new DomDriver
  )

  def logic(drivers: Sources): Sinks = {
    println(s"ScycleApp.logic($drivers)")
    val domDriver$ = drivers("dom").asInstanceOf[Subject[DomDriver]]
    val clicks$ = domDriver$.flatMap(driver => driver.selectEvent("#app", "click"))
    var counter = 0

    Map(
      "dom" -> {
        Observable.just(null)/*.concat(clicks$)*/.map(_ => {
          counter += 1
          Div(id = "app", children = Seq(Text(s"hello from scycle - clicks=$counter")))
        })
      }
    )
  }

}

package com.campudus.scycle

import com.campudus.scycle.Scycle._
import com.campudus.scycle.dom._
import rxscalajs._

import scala.scalajs.js.JSApp
import scala.scalajs.js.annotation.JSExport

@JSExport
object ScycleApp extends JSApp {

  @JSExport
  def main(): Unit = {
    println("main export")

    Scycle.run(logic, drivers)
  }

  val drivers: DriversDefinition = Map[String, DriverFunction[_, _]](
    "dom" -> new DomDriver
  )

  def logic(drivers: Sources): Sinks = {
    println(s"ScycleApp.logic($drivers)")
    val domDriver$ = drivers("dom").asInstanceOf[Subject[DomDriver]]
    val clicks$ = domDriver$.flatMap(driver => {
      println(s"ScycleApp.logic($drivers):clicks$$ -> driver=$driver")
      driver.selectEvent("#app", "click")
    })
    var counter = 0

    clicks$.subscribe(_ => println("dont care"))

    Map(
      "dom" -> {
        println("ScycleApp.return:before clicks$")
        clicks$.map(ev => {
          println(s"ScycleApp.return:in clicks$$:$ev")
          counter += 1
          Div(id = "app", children = Seq(Text(s"hello from scycle - clicks=$counter")))
        })
      }
    )
  }

}

Add non-printing debug messages :(

Add non-printing debug messages :(

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


scalacOptions := Seq(
  "-deprecation"
)

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

scalacOptions := Seq(
  "-deprecation"
)

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

Update http4s-blaze-client, http4s-circe, ... to 0.21.14