Skip to content

Commit

Permalink
Cross-build to Scala 2.13 (#228)
Browse files Browse the repository at this point in the history
* Cross-build to Scala 2.13 #40

* formatting

* Fix JavaAkkaGrpcClientHelpers on 2.12

* --ignore-source-errors not needed after all

and is jdk11-only
  • Loading branch information
raboof authored Mar 31, 2020
1 parent 9439d95 commit 7ddbe2e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ matrix:

before_install: curl -Ls https://git.io/jabba | bash && . ~/.jabba/jabba.sh
install: jabba install "adopt@~1.$TRAVIS_JDK.0-0" && jabba use "$_" && java -Xmx32m -version
script: sbt headerCheck test:headerCheck scalafmtCheckAll scalafmtSbtCheck test paradox
script: sbt headerCheck test:headerCheck scalafmtCheckAll scalafmtSbtCheck test paradox ++2.13.1 test

jobs:
include:
# - stage: whitesource
# script: git branch -f "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH" && sbt whitesourceCheckPolicies whitesourceUpdate
- stage: publish
script: sbt +publish
script: sbt ++2.12.8 publish ++2.13.1 publish
- stage: techhub-ping
script: curl -I https://ci.lightbend.com/job/techhub-publisher/build?token=$TECH_HUB_TOKEN

Expand Down
3 changes: 3 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import build.play.grpc.Dependencies
import build.play.grpc.Dependencies.Versions.scala212
import build.play.grpc.ProjectExtensions.AddPluginTest

ThisBuild / organization := "com.lightbend.play"
Expand Down Expand Up @@ -86,6 +87,8 @@ val playGenerators = Project("play-grpc-generators", file("play-generators"))
Dependencies.Compile.akkaGrpcCodegen,
Dependencies.Test.scalaTest,
),
// Only used in build tools (like sbt), so only 2.12 is needed:
crossScalaVersions := Seq(scala212),
)

val playTestkit = Project("play-grpc-testkit", file("play-testkit"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ public static ServerEndpoint getHttp2Endpoint(final ServerEndpoints serverEndpoi
// the user set
// `akka.grpc.client."".use-tls` to false for gRPC so this should return the non-TLS HTTP/2
// endpoint on the list.
return possibleEndpoints.filter(endpoint -> endpoint.ssl().isDefined()).head();
final scala.collection.Iterable<ServerEndpoint> sslEndpoints =
possibleEndpoints
.filter(endpoint -> endpoint.ssl().isDefined())
.toIterable();
return sslEndpoints.head();
}
}

Expand Down
6 changes: 6 additions & 0 deletions project/CommonPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package build.play.grpc

import sbt._
import sbt.Keys._
import Dependencies.Versions.scala212
import Dependencies.Versions.scala213

// WORKAROUND https://github.com/sbt/sbt/issues/2899
object CommonPlugin extends AutoPlugin {
Expand All @@ -12,6 +16,8 @@ object CommonPlugin extends AutoPlugin {
else
Nil
},
javacOptions in doc --= Seq("-Xlint:unchecked", "-Xlint:deprecation"),
crossScalaVersions := Seq(scala212, scala213),
)

val scalaVersionNumber = Def.setting(VersionNumber(scalaVersion.value))
Expand Down
3 changes: 3 additions & 0 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import sbt.Keys._
object Dependencies {

object Versions {
val scala212 = "2.12.8"
val scala213 = "2.13.1"

val akka = "2.6.4"

val akkaGrpc = "0.8.1" // TODO: obtain via sbt-akka-grpc?
Expand Down

0 comments on commit 7ddbe2e

Please sign in to comment.