Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
Support Scala 3 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Nov 29, 2023
1 parent 576a8e0 commit 8fe052f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .bsp/sbt.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"sbt","version":"1.4.6","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/usr/lib/jvm/java-14-openjdk/bin/java","-Xms100m","-Xmx100m","-classpath","/usr/share/sbt/bin/sbt-launch.jar","xsbt.boot.Boot","-bsp"]}
{"name":"sbt","version":"1.9.7","bspVersion":"2.1.0-M1","languages":["scala"],"argv":["/nix/store/cil2nww912vap0q84y2z1rjv8vnfhjbs-openjdk-19.0.2+7/lib/openjdk/bin/java","-Xms100m","-Xmx100m","-classpath","/nix/store/k9xwny18ihx78qh8pyxrnz7mrbqj962p-sbt-1.9.7/share/sbt/bin/sbt-launch.jar","-Dsbt.script=/home/sam/.nix-profile/bin/sbt","xsbt.boot.Boot","-bsp"]}
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
- name: SBT tests and artifacts
run: sbt test
run: sbt +test
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ lazy val octopushAkka = project
name := "octopush-akka",
organization := "net.rfc1149",
version := "0.0.2",
scalaVersion := "2.13.12",
crossScalaVersions := List("2.13.12", "3.3.1"),
scalaVersion := "3.3.1",
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature"),
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.8.5",
Expand Down
7 changes: 4 additions & 3 deletions src/main/scala/net.rfc1149/octopush/Octopush.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import java.security.MessageDigest

import akka.NotUsed
import akka.actor.ActorSystem
import akka.event.LoggingAdapter
import akka.http.scaladsl.Http
import akka.http.scaladsl.client.RequestBuilding.Post
import akka.http.scaladsl.marshallers.xml.ScalaXmlSupport
Expand All @@ -13,7 +14,7 @@ import akka.http.scaladsl.unmarshalling.{Unmarshal, Unmarshaller}
import akka.http.scaladsl.util.FastFuture
import akka.stream.scaladsl.{Sink, Source}

import scala.concurrent.Future
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration.Duration
import scala.util.{Failure, Success}
import scala.xml.NodeSeq
Expand All @@ -22,8 +23,8 @@ class Octopush(userLogin: String, apiKey: String)(implicit system: ActorSystem)

import Octopush._

private[this] implicit val executionContext = system.dispatcher
private[this] implicit val log = system.log
private[this] implicit val executionContext: ExecutionContext = system.dispatcher
private[this] implicit val log: LoggingAdapter = system.log
private[this] val apiPool = Http().cachedHostConnectionPoolHttps[NotUsed]("www.octopush-dm.com")

private[this] def apiRequest[T](path: String, fields: (String, String)*)(implicit ev: Unmarshaller[NodeSeq, T]): Future[T] = {
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/OctopushSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import net.rfc1149.octopush.{ErrorCodes, Octopush}
import org.specs2.mutable._
import org.specs2.specification.Scope

import scala.concurrent.Await
import scala.concurrent.{Await, ExecutionContext}
import scala.concurrent.duration._

class OctopushSpec extends Specification {
Expand All @@ -13,8 +13,8 @@ class OctopushSpec extends Specification {

val octopush: Octopush

implicit val system = ActorSystem()
implicit val dispatcher = system.dispatcher
implicit val system: ActorSystem = ActorSystem()
implicit val dispatcher: ExecutionContext = system.dispatcher

override def after = {
system.terminate()
Expand Down

0 comments on commit 8fe052f

Please sign in to comment.