diff --git a/.travis.yml b/.travis.yml index cac15fb..9662816 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ jdk: language: scala -script: "sbt evicted test" +script: "sbt +evicted +test" deploy: provider: script - script: sbt publish + script: sbt +publish on: tags: true diff --git a/asterisk/src/main/scala/simpleivr/asterisk/Ami.scala b/asterisk/src/main/scala/simpleivr/asterisk/Ami.scala index e7a091e..54b6a8d 100644 --- a/asterisk/src/main/scala/simpleivr/asterisk/Ami.scala +++ b/asterisk/src/main/scala/simpleivr/asterisk/Ami.scala @@ -15,7 +15,7 @@ class Ami(settings: AmiSettings) val startTime = System.currentTimeMillis() println(s"Executing call for $scriptAndArgs at ${Instant.now}") var chan: Option[AsteriskChannel] = None - import scala.collection.JavaConverters._ + import scala.jdk.CollectionConverters._ originateToApplicationAsync( s"SIP/${settings.peer}/1$dest", "Agi", diff --git a/build.sbt b/build.sbt index a92fde0..813b5d7 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,5 @@ -ThisBuild / scalaVersion := "2.12.10" +ThisBuild / crossScalaVersions := Seq("2.12.10", "2.13.1") +ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.last ThisBuild / organization := "io.github.nafg.simpleivr" def ScalaTest = "org.scalatest" %% "scalatest" % "3.1.0" @@ -8,22 +9,20 @@ ThisBuild / scalacOptions ++= Seq( "-feature", "-unchecked", "-explaintypes", - "-Xfuture", - "-Xlint", - "-Yno-adapted-args", - "-Ypartial-unification", + "-Xlint:_", "-Ywarn-dead-code", "-Ywarn-extra-implicit", - "-Ywarn-inaccessible", - "-Ywarn-infer-any", - "-Ywarn-nullary-override", - "-Ywarn-nullary-unit", "-Ywarn-numeric-widen", - "-Ywarn-unused-import", - "-Ywarn-unused", + "-Ywarn-unused:_", "-Ywarn-value-discard" ) +ThisBuild / scalacOptions ++= + (if (scalaVersion.value.startsWith("2.12.")) + List("-language:higherKinds", "-Xfuture", "-Ypartial-unification") + else + Nil) + lazy val core = project .settings( name := "simpleivr-core", @@ -46,7 +45,8 @@ lazy val asterisk = project .dependsOn(core) .settings( name := "simpleivr-asterisk", - libraryDependencies += "org.asteriskjava" % "asterisk-java" % "2.0.2" + libraryDependencies += "org.asteriskjava" % "asterisk-java" % "2.0.2", + libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.1.3" ) skip in publish := true diff --git a/core/src/main/scala/simpleivr/IvrCommand.scala b/core/src/main/scala/simpleivr/IvrCommand.scala index 7038844..f044465 100644 --- a/core/src/main/scala/simpleivr/IvrCommand.scala +++ b/core/src/main/scala/simpleivr/IvrCommand.scala @@ -2,8 +2,6 @@ package simpleivr import java.io.File -import scala.language.higherKinds - import cats.Functor import cats.effect.IO import cats.free.Free