diff --git a/.travis.yml b/.travis.yml index 92ffa3e..9b27b66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ language: scala scala: - 2.10.7 - 2.11.12 - - 2.12.5 - - 2.13.0-M4 + - 2.12.8 + - 2.13.0-RC2 jdk: - oraclejdk8 diff --git a/build.sbt b/build.sbt index 0c12e90..9709a3c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ import ReleaseTransformations._ -import sbtcrossproject.crossProject +import sbtcrossproject.CrossPlugin.autoImport.crossProject organization in ThisBuild := "io.estatico" @@ -23,17 +23,20 @@ lazy val catsTests = crossProject(JSPlatform, JVMPlatform).in(file("cats-tests") .settings( name := "newtype-cats-tests", description := "Test suite for newtype + cats interop", - libraryDependencies ++= Seq( - "org.typelevel" %%% "cats-core" % "1.2.0" - ) + libraryDependencies += { + if (scalaVersion.value.startsWith("2.10.")) + "org.typelevel" %%% "cats-core" % "1.2.0" + else + "org.typelevel" %%% "cats-core" % "2.0.0-M2" + } ) lazy val catsTestsJVM = catsTests.jvm lazy val catsTestsJS = catsTests.js lazy val noPublishSettings = Seq( - publish := (), - publishLocal := (), + publish := {}, + publishLocal := {}, publishArtifact := false ) @@ -127,8 +130,8 @@ lazy val defaultLibraryDependencies = libraryDependencies ++= Seq( "org.typelevel" %% "macro-compat" % "1.1.1", scalaOrganization.value % "scala-reflect" % scalaVersion.value % Provided, scalaOrganization.value % "scala-compiler" % scalaVersion.value % Provided, - "org.scalacheck" %%% "scalacheck" % "1.14.0" % "test", - "org.scalatest" %%% "scalatest" % "3.0.6-SNAP1" % "test" + "org.scalacheck" %%% "scalacheck" % "1.14.0" % Test, + "org.scalatest" %%% "scalatest" % "3.0.8-RC4" % Test ) def scalaPartV = Def.setting(CrossVersion.partialVersion(scalaVersion.value)) diff --git a/cats-tests/shared/src/test/scala/io/estatico/newtype/NewTypeCatsTest.scala b/cats-tests/shared/src/test/scala/io/estatico/newtype/NewTypeCatsTest.scala index 3f5fd8c..20168c6 100644 --- a/cats-tests/shared/src/test/scala/io/estatico/newtype/NewTypeCatsTest.scala +++ b/cats-tests/shared/src/test/scala/io/estatico/newtype/NewTypeCatsTest.scala @@ -5,9 +5,9 @@ import cats.implicits._ import io.estatico.newtype.ops._ import io.estatico.newtype.macros.{newsubtype, newtype} import org.scalatest.{FlatSpec, Matchers} -import org.scalatest.prop.GeneratorDrivenPropertyChecks +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks -class NewTypeCatsTest extends FlatSpec with Matchers with GeneratorDrivenPropertyChecks { +class NewTypeCatsTest extends FlatSpec with Matchers with ScalaCheckPropertyChecks { import NewTypeCatsTest._ diff --git a/jvm/src/test/scala/io/estatico/newtype/macros/NewTypeMacrosJVMTest.scala b/jvm/src/test/scala/io/estatico/newtype/macros/NewTypeMacrosJVMTest.scala index fd9165e..1078567 100644 --- a/jvm/src/test/scala/io/estatico/newtype/macros/NewTypeMacrosJVMTest.scala +++ b/jvm/src/test/scala/io/estatico/newtype/macros/NewTypeMacrosJVMTest.scala @@ -8,7 +8,7 @@ class NewTypeMacrosJVMTest extends FlatSpec with Matchers { it should "not box primitives" in { // Introspect the runtime type returned by the `apply` method - def ctorReturnType(o: Any) = List(o.getClass.getMethods: _*).find(_.getName == "apply").get.getReturnType + def ctorReturnType(o: Any) = scala.Predef.genericArrayOps(o.getClass.getMethods).find(_.getName == "apply").get.getReturnType // newtypes will box primitive values. @newtype case class BoxedInt(private val x: Int) diff --git a/project/build.properties b/project/build.properties index 0db266d..dca663d 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 0.13.17 +sbt.version = 1.2.8 diff --git a/project/plugins.sbt b/project/plugins.sbt index 0e5bd0f..f7cee7b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.1") -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.4") -addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.1.0") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.23") -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.5.0") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1") +addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11") +addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.1.3") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0") diff --git a/shared/src/main/scala/io/estatico/newtype/macros/NewTypeMacros.scala b/shared/src/main/scala/io/estatico/newtype/macros/NewTypeMacros.scala index fda5084..39889ba 100644 --- a/shared/src/main/scala/io/estatico/newtype/macros/NewTypeMacros.scala +++ b/shared/src/main/scala/io/estatico/newtype/macros/NewTypeMacros.scala @@ -228,7 +228,7 @@ private[macros] class NewTypeMacros(val c: blackbox.Context) clsDef: ClassDef, valDef: ValDef, tparamsNoVar: List[TypeDef], tparamNames: List[TypeName] ): List[Tree] = { val extensionMethods = - maybeGenerateValMethod(clsDef, valDef) ++ getInstanceMethods(clsDef) + maybeGenerateValMethod(clsDef, valDef).toList ++ getInstanceMethods(clsDef) if (extensionMethods.isEmpty) { Nil diff --git a/shared/src/test/scala/io/estatico/newtype/NewTypeTest.scala b/shared/src/test/scala/io/estatico/newtype/NewTypeTest.scala index bd006e4..a02a01d 100644 --- a/shared/src/test/scala/io/estatico/newtype/NewTypeTest.scala +++ b/shared/src/test/scala/io/estatico/newtype/NewTypeTest.scala @@ -1,10 +1,10 @@ package io.estatico.newtype import org.scalacheck.Arbitrary -import org.scalatest.prop.PropertyChecks +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks import org.scalatest.{FlatSpec, Matchers} -class NewTypeTest extends FlatSpec with PropertyChecks with Matchers { +class NewTypeTest extends FlatSpec with ScalaCheckPropertyChecks with Matchers { import NewTypeTest._