Skip to content

Commit

Permalink
chore: Drop Scala 2.12
Browse files Browse the repository at this point in the history
* build plugins are still on 2.12
  • Loading branch information
patriknw committed Sep 22, 2023
1 parent 77b8e49 commit 78af157
Show file tree
Hide file tree
Showing 40 changed files with 99 additions and 90 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
strategy:
fail-fast: false
matrix:
scalaVersion: [2.12, 2.13, 3.3]
scalaVersion: [2.13, 3.3]
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -98,9 +98,9 @@ jobs:
matrix:
include:
- test-set: gen-scala-server
scala-version: 2.12
scala-version: 2.13
- test-set: gen-java
scala-version: 2.12
scala-version: 2.13
- test-set: scala-2_13
scala-version: 2.13
- test-set: scala3
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ jobs:
matrix:
include:
# leaving out combinations covered in `build-test.yml`
- { scalaVersion: "2.12", jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' }
# { scalaVersion: "2.12", jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { scalaVersion: "2.12", jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' }

- { scalaVersion: "2.13", jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' }
# { scalaVersion: "2.13", jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { scalaVersion: "2.13", jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' }
Expand Down
7 changes: 4 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ lazy val codegen = Project(id = akkaGrpcCodegenId, base = file("codegen"))
(assembly / assemblyOption) := (assembly / assemblyOption).value.withPrependShellScript(
Some(sbtassembly.AssemblyPlugin.defaultUniversalScript(shebang = true))),
crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin,
scalaVersion := scala212)
scalaVersion := Dependencies.Versions.CrossScalaForPlugin.head)
.settings(addArtifact((Compile / assembly / artifact), assembly))
.settings(addArtifact(Artifact(akkaGrpcCodegenId, "bat", "bat", "bat"), mkBatAssemblyTask))

Expand All @@ -48,6 +48,7 @@ lazy val runtime = Project(id = akkaGrpcRuntimeName, base = file("runtime"))
.settings(VersionGenerator.settings)
.settings(
crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
scalaVersion := Dependencies.Versions.CrossScalaForLib.head,
mimaFailOnNoPrevious := true,
mimaPreviousArtifacts :=
(if (scalaVersion.value.startsWith("2"))
Expand Down Expand Up @@ -218,7 +219,7 @@ lazy val pluginTesterScala = Project(id = "akka-grpc-plugin-tester-scala", base
(publish / skip) := true,
fork := true,
crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
scalaVersion := scala212,
scalaVersion := Dependencies.Versions.CrossScalaForLib.head,
ReflectiveCodeGen.codeGeneratorSettings ++= Seq("flat_package", "server_power_apis"))
.pluginTestingSettings

Expand All @@ -230,7 +231,7 @@ lazy val pluginTesterJava = Project(id = "akka-grpc-plugin-tester-java", base =
fork := true,
ReflectiveCodeGen.generatedLanguages := Seq("Java"),
crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
scalaVersion := scala212,
scalaVersion := Dependencies.Versions.CrossScalaForLib.head,
ReflectiveCodeGen.codeGeneratorSettings ++= Seq("server_power_apis"))
.pluginTestingSettings

Expand Down
2 changes: 1 addition & 1 deletion docs/release-train-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Variables to be expanded in this template:

- [ ] Check [API](https://doc.akka.io/api/akka-grpc/$VERSION$/) documentation
- [ ] Check [reference](https://doc.akka.io/docs/akka-grpc/$VERSION$/) documentation. Check that the reference docs were deployed and show a version warning (see section below on how to fix the version warning).
- [ ] Check the release on [Maven central](https://repo1.maven.org/maven2/com/lightbend/akka/grpc/akka-grpc-scalapb-protoc-plugin_2.12/$VERSION$/)
- [ ] Check the release on [Maven central](https://repo1.maven.org/maven2/com/lightbend/akka/grpc/akka-grpc-scalapb-protoc-plugin_2.13/$VERSION$/)

### When everything is on maven central
- [ ] Log into `gustav.akka.io` as `akkarepo`
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/paradox/client/walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Maven
<dependencies>
<dependency>
<groupId>com.lightbend.akka.grpc</groupId>
<artifactId>akka-grpc-runtime_2.12</artifactId>
<artifactId>akka-grpc-runtime_2.13</artifactId>
<version>${akka.grpc.version}</version>
</dependency>
<!-- for loading of cert, issue #89 -->
Expand Down Expand Up @@ -113,10 +113,10 @@ For example, this is the definition of a Hello World service:
From this definition, Akka gRPC generates interfaces that look like this:

Scala
: @@snip [helloworld.proto](/plugin-tester-scala/target/scala-2.12/src_managed/main/example/myapp/helloworld/grpc/GreeterService.scala)
: @@snip [helloworld.proto](/plugin-tester-scala/target/scala-2.13/src_managed/main/example/myapp/helloworld/grpc/GreeterService.scala)

Java
: @@snip [helloworld.proto](/plugin-tester-java/target/scala-2.12/src_managed/main/example/myapp/helloworld/grpc/GreeterService.java)
: @@snip [helloworld.proto](/plugin-tester-java/target/scala-2.13/src_managed/main/example/myapp/helloworld/grpc/GreeterService.java)

and model @scala[case ]classes for `HelloRequest` and `HelloResponse`.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/paradox/server/grpc-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Additionally, add the dependency as below.

@@dependency[sbt,Maven,Gradle] {
group="ch.megard"
artifact="akka-http-cors_2.12"
artifact="akka-http-cors_2.13"
version="0.4.2"
}

Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/paradox/server/walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Maven
<dependencies>
<dependency>
<groupId>com.lightbend.akka.grpc</groupId>
<artifactId>akka-grpc-runtime_2.12</artifactId>
<artifactId>akka-grpc-runtime_2.13</artifactId>
<version>${akka.grpc.version}</version>
</dependency>
</dependencies>
Expand Down Expand Up @@ -129,10 +129,10 @@ mvn akka-grpc:generate
From the above definition, Akka gRPC generates interfaces that look like this:

Scala
: @@snip [helloworld.proto](/plugin-tester-scala/target/scala-2.12/src_managed/main/example/myapp/helloworld/grpc/GreeterService.scala)
: @@snip [helloworld.proto](/plugin-tester-scala/target/scala-2.13/src_managed/main/example/myapp/helloworld/grpc/GreeterService.scala)

Java
: @@snip [helloworld.proto](/plugin-tester-java/target/scala-2.12/src_managed/main/example/myapp/helloworld/grpc/GreeterService.java)
: @@snip [helloworld.proto](/plugin-tester-java/target/scala-2.13/src_managed/main/example/myapp/helloworld/grpc/GreeterService.java)

and model @scala[case ]classes for `HelloRequest` and `HelloResponse`.

Expand Down
2 changes: 1 addition & 1 deletion gradle-plugin/src/test/groovy/helper/BaseSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ plugins {
id '$PLUGIN_CODE'
}
project.dependencies {
implementation "com.typesafe.scala-logging:scala-logging_2.12:3.9.2"
implementation "com.typesafe.scala-logging:scala-logging_2.13:3.9.2"
}
"""
}
Expand Down
6 changes: 3 additions & 3 deletions plugin-tester-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
<dependencies>
<dependency>
<groupId>com.lightbend.akka.grpc</groupId>
<artifactId>akka-grpc-runtime_2.12</artifactId>
<artifactId>akka-grpc-runtime_2.13</artifactId>
<version>${akka.grpc.project.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-pki_2.12</artifactId>
<artifactId>akka-pki_2.13</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>ch.megard</groupId>
<artifactId>akka-http-cors_2.12</artifactId>
<artifactId>akka-http-cors_2.13</artifactId>
<version>${akka.http.cors.version}</version>
</dependency>

Expand Down
12 changes: 6 additions & 6 deletions plugin-tester-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,37 @@
<dependencies>
<dependency>
<groupId>com.lightbend.akka.grpc</groupId>
<artifactId>akka-grpc-runtime_2.12</artifactId>
<artifactId>akka-grpc-runtime_2.13</artifactId>
<version>${akka.grpc.project.version}</version>
</dependency>
<dependency>
<groupId>ch.megard</groupId>
<artifactId>akka-http-cors_2.12</artifactId>
<artifactId>akka-http-cors_2.13</artifactId>
<version>${akka.http.cors.version}</version>
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream-testkit_2.12</artifactId>
<artifactId>akka-stream-testkit_2.13</artifactId>
<version>${akka.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor-testkit-typed_2.12</artifactId>
<artifactId>akka-actor-testkit-typed_2.13</artifactId>
<version>${akka.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-pki_2.12</artifactId>
<artifactId>akka-pki_2.13</artifactId>
<version>${akka.version}</version>
</dependency>

<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.12</artifactId>
<artifactId>scalatest_2.13</artifactId>
<version>3.0.5</version>
<scope>test</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object Dependencies {
val scala3 = "3.3.1"

// the order in the list is important because the head will be considered the default.
val CrossScalaForLib = Seq(scala212, scala213, scala3)
val CrossScalaForLib = Seq(scala213, scala3)
val CrossScalaForPlugin = Seq(scala212)

// We don't force Akka updates because downstream projects can upgrade
Expand Down
4 changes: 1 addition & 3 deletions sbt-plugin/src/sbt-test/gen-java/01-gen-basic-java/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Can be removed when we move to 2.12.14
// https://github.com/akka/akka-grpc/pull/1279
scalaVersion := "2.12.18"
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

Expand Down
10 changes: 5 additions & 5 deletions sbt-plugin/src/sbt-test/gen-java/01-gen-basic-java/test
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
> compile

$ exists target/scala-2.12/akka-grpc
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/HelloRequest.java
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/HelloReply.java
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/GreeterService.java
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/GreeterServiceClient.java
$ exists target/scala-2.13/akka-grpc
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/HelloRequest.java
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/HelloReply.java
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/GreeterService.java
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/GreeterServiceClient.java

> doc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Can be removed when we move to 2.12.14
// https://github.com/akka/akka-grpc/pull/1279
scalaVersion := "2.12.18"
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

Expand Down
10 changes: 5 additions & 5 deletions sbt-plugin/src/sbt-test/gen-java/02-server-reflection/test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
> compile

$ exists target/scala-2.12/akka-grpc
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/HelloRequest.java
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/HelloReply.java
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/GreeterService.java
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/GreeterServiceClient.java
$ exists target/scala-2.13/akka-grpc
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/HelloRequest.java
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/HelloReply.java
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/GreeterService.java
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/GreeterServiceClient.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Can be removed when we move to 2.12.14
// https://github.com/akka/akka-grpc/pull/1279
scalaVersion := "2.12.18"
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

Expand Down
2 changes: 1 addition & 1 deletion sbt-plugin/src/sbt-test/gen-java/03-no-java-package/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
> compile

$ exists target/scala-2.12/akka-grpc/main/helloworld/Helloworld.java
$ exists target/scala-2.13/akka-grpc/main/helloworld/Helloworld.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Can be removed when we move to 2.12.14
// https://github.com/akka/akka-grpc/pull/1279
scalaVersion := "2.12.18"
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Can be removed when we move to 2.12.14
// https://github.com/akka/akka-grpc/pull/1279
scalaVersion := "2.12.18"
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
> compile

$ exists target/scala-2.12/akka-grpc/main/helloworld/Helloworld.java
$ exists target/scala-2.13/akka-grpc/main/helloworld/Helloworld.java
2 changes: 2 additions & 0 deletions sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

organization := "com.lightbend.akka.grpc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TestServiceImpl(implicit sys: ActorSystem) extends TestService {
Status.fromCodeValue(reqStatus.code).withDescription(reqStatus.message)))
req
}).mapConcat(
_.responseParameters.to[immutable.Seq]).via(parametersToResponseFlow)
_.responseParameters.toList).via(parametersToResponseFlow)

override def halfDuplexCall(in: Source[StreamingOutputCallRequest, NotUsed]): Source[StreamingOutputCallResponse, NotUsed] = ???

Expand All @@ -82,7 +82,7 @@ class TestServiceImpl(implicit sys: ActorSystem) extends TestService {
}

override def streamingOutputCall(in: StreamingOutputCallRequest): Source[StreamingOutputCallResponse, NotUsed] =
Source(in.responseParameters.to[immutable.Seq]).via(parametersToResponseFlow)
Source(in.responseParameters.toList).via(parametersToResponseFlow)

override def unimplementedCall(in: Empty): Future[Empty] = ???
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

scalacOptions += "-Xfatal-warnings"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
> compile

$ exists target/scala-2.12/akka-grpc
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/HelloRequest.scala
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/HelloworldProto.scala
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/GreeterService.scala
$ exists target/scala-2.13/akka-grpc
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/HelloRequest.scala
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/HelloworldProto.scala
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/GreeterService.scala

# This will for example detect when we publish generated code that is
# already in scalapb-runtime
> assembly

# catch scaladoc errors
> doc
> doc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

enablePlugins(AkkaGrpcPlugin)
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

enablePlugins(AkkaGrpcPlugin)
Expand Down
12 changes: 6 additions & 6 deletions sbt-plugin/src/sbt-test/gen-scala-server/03-test-config/test
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
> test:compile

# the Scala server was generated in Compile
$ exists target/scala-2.12/akka-grpc/main/example/myapp/helloworld/grpc/GreeterServiceHandler.scala
$ exists target/scala-2.13/akka-grpc/main/example/myapp/helloworld/grpc/GreeterServiceHandler.scala

# only the Scala client was generated in Test
-$ exists target/scala-2.12/akka-grpc/test/example/myapp/helloworld/grpc/GreeterServiceHandler.scala
$ exists target/scala-2.12/akka-grpc/test/example/myapp/helloworld/grpc/GreeterServiceClient.scala
-$ exists target/scala-2.13/akka-grpc/test/example/myapp/helloworld/grpc/GreeterServiceHandler.scala
$ exists target/scala-2.13/akka-grpc/test/example/myapp/helloworld/grpc/GreeterServiceClient.scala

> it:protocGenerate

# only the Java server was generated in IntegrationTest
-$ exists target/scala-2.12/akka-grpc/it/example/myapp/helloworld/grpc/GreeterServiceHandler.scala
-$ exists target/scala-2.12/akka-grpc/it/example/myapp/helloworld/grpc/GreeterServiceClient.scala
$ exists target/scala-2.12/akka-grpc/it/example/myapp/helloworld/grpc/GreeterServiceHandlerFactory.java
-$ exists target/scala-2.13/akka-grpc/it/example/myapp/helloworld/grpc/GreeterServiceHandler.scala
-$ exists target/scala-2.13/akka-grpc/it/example/myapp/helloworld/grpc/GreeterServiceClient.scala
$ exists target/scala-2.13/akka-grpc/it/example/myapp/helloworld/grpc/GreeterServiceHandlerFactory.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
scalaVersion := "2.13.11"

resolvers += Resolver.sonatypeRepo("staging")

enablePlugins(AkkaGrpcPlugin)
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ object Main extends App {
ServiceHandler.concatOrNotFound(
greeterPartial,
echoPartial,
reflection),
reflection)
//#server-reflection-manual-concat

}
}
Loading

0 comments on commit 78af157

Please sign in to comment.