Skip to content

Commit

Permalink
Merge pull request #19 from mcsherrylabs/cross-build-scala213
Browse files Browse the repository at this point in the history
Cross compile for 2.13 from 2.12.
  • Loading branch information
kushti authored Mar 31, 2020
2 parents 720916e + cf95b07 commit 3dc334f
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 39 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ language: scala
scala:
- 2.12.10
- 2.11.12
- 2.13.1
jdk:
- oraclejdk8
cache:
Expand Down
31 changes: 18 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ organization := "org.scorexfoundation"

lazy val scala212 = "2.12.10"
lazy val scala211 = "2.11.12"
crossScalaVersions := Seq(scala212, scala211)
lazy val scala213 = "2.13.1"
crossScalaVersions := Seq(scala212, scala211, scala213)
scalaVersion := scala212

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

resolvers ++= Seq("Sonatype Releases" at "https://oss.sonatype.org/content/repositories/releases/",
Expand All @@ -22,10 +23,13 @@ resolvers ++= Seq("Sonatype Releases" at "https://oss.sonatype.org/content/repos
)

libraryDependencies ++= Seq(
"org.rudogma" %% "supertagged" % "1.4",
"org.rudogma" %% "supertagged" % "1.5",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
"org.scalatest" %% "scalatest" % "3.0.3" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.+" % "test"
"org.scalatest" %% "scalatest" % "3.1.1" % Test,
"org.scalacheck" %% "scalacheck" % "1.14.+" % Test,
// https://mvnrepository.com/artifact/org.scalatestplus/scalatestplus-scalacheck
"org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test

)

publishMavenStyle in ThisBuild := true
Expand All @@ -44,13 +48,13 @@ pomIncludeRepository in ThisBuild := { _ => false }
licenses := Seq("CC0" -> url("https://creativecommons.org/publicdomain/zero/1.0/legalcode"))
homepage := Some(url("https://github.com/ScorexFoundation/scorex-util"))
pomExtra :=
<developers>
<developer>
<id>kushti</id>
<name>Alexander Chepurnoy</name>
<url>http://chepurnoy.org/</url>
</developer>
</developers>
<developers>
<developer>
<id>kushti</id>
<name>Alexander Chepurnoy</name>
<url>http://chepurnoy.org/</url>
</developer>
</developers>

enablePlugins(GitVersioning)

Expand Down Expand Up @@ -89,3 +93,4 @@ pgpPublicRing := file("ci/pubring.asc")
pgpSecretRing := file("ci/secring.asc")
pgpPassphrase := sys.env.get("PGP_PASSPHRASE").map(_.toArray)
usePgpKeyHex("9D73AA38C08FD6AE5A51D3C11E4BF6F443599431")

2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/scorex/util/encode/Base58.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ object Base58 extends BytesEncoder {
if (bi > 0) {
while (bi >= Base) {
val (newBi, mod) = bi /% Base
s.insert(0, Alphabet.charAt(mod.intValue()))
s.insert(0, Alphabet.charAt(mod.intValue))
bi = newBi
}
s.insert(0, Alphabet.charAt(bi.intValue()))
s.insert(0, Alphabet.charAt(bi.intValue))
}
// Convert leading zeros too.
input.takeWhile(_ == 0).foldLeft(s) { case (ss, _) =>
Expand Down
6 changes: 4 additions & 2 deletions src/test/scala/scorex/ModifierIdSpec.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package scorex

import org.scalatest.matchers.should.Matchers
import org.scalatest.flatspec.AnyFlatSpec
import scorex.util._
import org.scalatest.{FlatSpec, Matchers}

class ModifierIdSpec extends FlatSpec with Matchers {

class ModifierIdSpec extends AnyFlatSpec with Matchers {

"ModifierId" should "convert to/from bytes" in {
val bytes = Array.fill[Byte](32)(1)
Expand Down
11 changes: 6 additions & 5 deletions src/test/scala/scorex/util/ExtensionsSpecification.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package scorex.util

import org.scalatest.{Matchers, PropSpec}
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import Extensions._
import org.scalacheck.Gen
import org.scalatest.propspec.AnyPropSpec

class ExtensionsSpecification extends PropSpec
with GeneratorDrivenPropertyChecks
class ExtensionsSpecification extends AnyPropSpec
with ScalaCheckDrivenPropertyChecks
with Matchers {

property("ByteOps.toUByte") {
Expand Down Expand Up @@ -103,7 +104,7 @@ class ExtensionsSpecification extends PropSpec

property("TraversableOps.cast") {
List(1,2,3,4).cast[Int] shouldBe List(1,2,3,4)
an[IllegalArgumentException] should be thrownBy List(1,"2",3,4).cast
an[IllegalArgumentException] should be thrownBy List(1,"2",3,4).cast[Int]
}

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package scorex.util.encode

import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec

trait BytesEncoderSpecification extends PropSpec
with PropertyChecks
with GeneratorDrivenPropertyChecks
trait BytesEncoderSpecification extends AnyPropSpec
with ScalaCheckPropertyChecks
with ScalaCheckDrivenPropertyChecks
with Matchers {

val encoder: BytesEncoder
Expand Down
9 changes: 5 additions & 4 deletions src/test/scala/scorex/util/encode/ZigZagSpecification.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package scorex.util.encode

import org.scalacheck.Gen
import org.scalatest.prop.PropertyChecks
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.propspec.AnyPropSpec
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.util.Generators
import scorex.util.encode.ZigZagEncoder._

class ZigZagSpecification extends PropSpec
class ZigZagSpecification extends AnyPropSpec
with Generators
with PropertyChecks
with ScalaCheckPropertyChecks
with Matchers {

property("ZigZag encoding format") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package scorex.util.serialization

import org.scalatest.prop.PropertyChecks
import org.scalatest.{Matchers, PropSpec}

import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.util.ByteArrayBuilder

class ByteArrayBuilderTests extends PropSpec with PropertyChecks with Matchers {
class ByteArrayBuilderTests extends AnyPropSpec with ScalaCheckPropertyChecks with Matchers {

property("Append basic types") {
val b = new ByteArrayBuilder(1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package scorex.util.serialization

import org.scalacheck.{Arbitrary, Gen}
import org.scalatest.prop.PropertyChecks
import org.scalatest.{Assertion, Matchers, PropSpec}
import org.scalatest.Assertion
import org.scalatest.propspec.AnyPropSpec
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.util.TestHelpers._
import scorex.util.Generators

trait VLQReaderWriterSpecification extends PropSpec
trait VLQReaderWriterSpecification extends AnyPropSpec
with Generators
with PropertyChecks
with ScalaCheckPropertyChecks
with Matchers {

def byteBufReader(bytes: Array[Byte]): VLQReader
Expand Down

0 comments on commit 3dc334f

Please sign in to comment.