Skip to content

Commit e460e84

Browse files
authored
initial changes to drop Scala 2.12 support (#770)
* initial changes to drop Scala 2.12 support * remove imm code * Create remove-scala2.12-compat.excludes
1 parent a3c4126 commit e460e84

File tree

24 files changed

+25
-444
lines changed

24 files changed

+25
-444
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
SCALA_VERSION: [2.12, 2.13, 3]
24+
SCALA_VERSION: [2.13, 3]
2525
JDK: [17, 21]
2626
PEKKO_VERSION: ['default']
2727
steps:

.github/workflows/validate-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
strategy:
7171
fail-fast: false
7272
matrix:
73-
SCALA_VERSION: [2.12, 2.13, 3.3]
73+
SCALA_VERSION: [2.13, 3.3]
7474
JDK: [17]
7575
steps:
7676
- name: Checkout

LICENSE

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,6 @@ Copyright 2014 Twitter, Inc.
210210

211211
---------------
212212

213-
pekko-http-core contains code from scala-collection-compat in the `org.apache.pekko.http.ccompat` package
214-
distributed under the Apache 2.0 license.
215-
- http-core/src/main/scala-2.13-/org/apache/pekko/http/ccompat/package.scala
216-
- http-core/src/main/scala-2.13-/org/apache/pekko/http/ccompat/CompatImpl.scala
217-
218-
Copyright EPFL and Lightbend, Inc.
219-
220-
---------------
221-
222213
pekko-http-core contains code from https://bjoern.hoehrmann.de/utf-8/decoder/dfa/
223214
in `org.apache.pekko.http.impl.engine.ws.Utf8Decoder.scala` that was distributed under a MIT license.
224215

NOTICE

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,6 @@ Apache License, Version 2.0 License.
1212

1313
---------------
1414

15-
pekko-http-core contains code from scala-collection-compat distributed under the Apache 2.0 license.
16-
17-
scala-collection-compat
18-
Copyright (c) 2002-2023 EPFL
19-
Copyright (c) 2011-2023 Lightbend, Inc.
20-
21-
Scala includes software developed at
22-
LAMP/EPFL (https://lamp.epfl.ch/) and
23-
Lightbend, Inc. (https://www.lightbend.com/).
24-
25-
Licensed under the Apache License, Version 2.0 (the "License").
26-
Unless required by applicable law or agreed to in writing, software
27-
distributed under the License is distributed on an "AS IS" BASIS,
28-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29-
See the License for the specific language governing permissions and
30-
limitations under the License.
31-
32-
---------------
33-
3415
pekko-http-core and pekko-http-tests contain code based on akka-sse <https://github.com/hseeberger/akka-sse>
3516
distributed under the Apache 2.0 license.
3617

build.sbt

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -88,40 +88,17 @@ lazy val root = Project(
8888
Compile / headerCreate / unmanagedSources := (baseDirectory.value / "project").**("*.scala").get)
8989
.aggregate(aggregatedProjects: _*)
9090

91-
/**
92-
* Adds a `src/.../scala-2.13+` source directory for Scala 2.13 and newer
93-
* and a `src/.../scala-2.13-` source directory for Scala version older than 2.13
94-
*/
95-
def add213CrossDirs(config: Configuration): Seq[Setting[_]] = Seq(
96-
config / unmanagedSourceDirectories += {
97-
val sourceDir = (config / sourceDirectory).value
98-
CrossVersion.partialVersion(scalaVersion.value) match {
99-
case Some((e, n)) if e > 2 || (e == 2 && n >= 13) => sourceDir / "scala-2.13+"
100-
case _ => sourceDir / "scala-2.13-"
101-
}
102-
})
103-
104-
val commonSettings =
105-
add213CrossDirs(Compile) ++
106-
add213CrossDirs(Test)
107-
10891
val scalaMacroSupport = Seq(
10992
scalacOptions ++= {
11093
CrossVersion.partialVersion(scalaVersion.value) match {
111-
case Some((2, n)) if n >= 13 =>
94+
case Some((2, n)) =>
11295
Seq("-Ymacro-annotations")
11396
case _ =>
11497
Seq.empty
11598
}
116-
},
117-
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
118-
case Some((2, n)) if n < 13 =>
119-
Seq(compilerPlugin(("org.scalamacros" % "paradise" % "2.1.1").cross(CrossVersion.full)))
120-
case _ => Seq.empty
121-
}))
99+
})
122100

123101
lazy val parsing = project("parsing")
124-
.settings(commonSettings)
125102
.settings(AutomaticModuleName.settings("pekko.http.parsing"))
126103
.addPekkoModuleDependency("pekko-actor", "provided", PekkoCoreDependency.default)
127104
.settings(Dependencies.parsing)
@@ -132,7 +109,6 @@ lazy val parsing = project("parsing")
132109
.disablePlugins(MimaPlugin)
133110

134111
lazy val httpCore = project("http-core")
135-
.settings(commonSettings)
136112
.settings(AutomaticModuleName.settings("pekko.http.core"))
137113
.settings(AddMetaInfLicenseFiles.httpCoreSettings)
138114
.dependsOn(parsing /*, httpScalafixRules % ScalafixConfig*/ )
@@ -152,7 +128,6 @@ lazy val httpCore = project("http-core")
152128
.disablePlugins(ScalafixPlugin)
153129

154130
lazy val http = project("http")
155-
.settings(commonSettings)
156131
.settings(AutomaticModuleName.settings("pekko.http"))
157132
.dependsOn(httpCore)
158133
.addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
@@ -167,7 +142,6 @@ lazy val http = project("http")
167142
.enablePlugins(ReproducibleBuildsPlugin)
168143

169144
lazy val http2Tests = project("http2-tests")
170-
.settings(commonSettings)
171145
.settings(AutomaticModuleName.settings("pekko.http.http2"))
172146
.dependsOn(httpCore, httpTestkit % "test", httpCore % "test->test")
173147
.addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
@@ -209,7 +183,6 @@ lazy val http2Tests = project("http2-tests")
209183
.disablePlugins(MimaPlugin) // experimental module still
210184

211185
lazy val httpTestkit = project("http-testkit")
212-
.settings(commonSettings)
213186
.settings(AutomaticModuleName.settings("pekko.http.testkit"))
214187
.dependsOn(http)
215188
.addPekkoModuleDependency("pekko-stream-testkit", "provided", PekkoCoreDependency.default)
@@ -225,7 +198,6 @@ lazy val httpTestkit = project("http-testkit")
225198
.disablePlugins(MimaPlugin) // testkit, no bin compat guaranteed
226199

227200
lazy val httpTestkitMunit = project("http-testkit-munit")
228-
.settings(commonSettings)
229201
.settings(AutomaticModuleName.settings("pekko.http.testkit.munit"))
230202
.dependsOn(http, httpTestkit)
231203
.addPekkoModuleDependency("pekko-stream-testkit", "provided", PekkoCoreDependency.default)
@@ -234,7 +206,6 @@ lazy val httpTestkitMunit = project("http-testkit-munit")
234206
.disablePlugins(MimaPlugin) // testkit, no bin compat guaranteed
235207

236208
lazy val httpTests = project("http-tests")
237-
.settings(commonSettings)
238209
.settings(Dependencies.httpTests)
239210
.dependsOn(httpSprayJson, httpXml, httpJackson,
240211
httpTestkit % "test", httpCore % "test->test",
@@ -261,15 +232,13 @@ lazy val httpTests = project("http-tests")
261232
})
262233

263234
lazy val httpJmhBench = project("http-bench-jmh")
264-
.settings(commonSettings)
265235
.dependsOn(http, httpCors, http2Tests % "compile->compile,test")
266236
.addPekkoModuleDependency("pekko-stream", "", PekkoCoreDependency.default)
267237
.enablePlugins(JmhPlugin)
268238
.enablePlugins(NoPublish) // don't release benchs
269239
.disablePlugins(MimaPlugin)
270240

271241
lazy val httpMarshallersScala = project("http-marshallers-scala")
272-
.settings(commonSettings)
273242
.enablePlugins(NoPublish /*, AggregatePRValidation*/ )
274243
.disablePlugins(MimaPlugin)
275244
.aggregate(httpSprayJson, httpXml)
@@ -287,7 +256,6 @@ lazy val httpSprayJson =
287256
.settings(Dependencies.httpSprayJson)
288257

289258
lazy val httpMarshallersJava = project("http-marshallers-java")
290-
.settings(commonSettings)
291259
.enablePlugins(NoPublish /*, AggregatePRValidation*/ )
292260
.disablePlugins(MimaPlugin)
293261
.aggregate(httpJackson)
@@ -304,7 +272,6 @@ lazy val httpJackson =
304272
lazy val httpCaching = project("http-caching")
305273
.settings(
306274
name := "pekko-http-caching")
307-
.settings(commonSettings)
308275
.settings(AutomaticModuleName.settings("pekko.http.caching"))
309276
.addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
310277
.addPekkoModuleDependency("pekko-stream-testkit", "provided", PekkoCoreDependency.default)
@@ -315,7 +282,6 @@ lazy val httpCaching = project("http-caching")
315282
lazy val httpCors = project("http-cors")
316283
.settings(
317284
name := "pekko-http-cors")
318-
.settings(commonSettings)
319285
.settings(AutomaticModuleName.settings("pekko.http.cors"))
320286
.settings(AddMetaInfLicenseFiles.httpCorsSettings)
321287
.addPekkoModuleDependency("pekko-stream", "provided", PekkoCoreDependency.default)
@@ -335,7 +301,6 @@ def httpMarshallersScalaSubproject(moduleName: String) =
335301
.dependsOn(http)
336302
.settings(
337303
name := s"pekko-http-$moduleName")
338-
.settings(commonSettings)
339304
.enablePlugins(BootstrapGenjavadoc)
340305
.enablePlugins(ReproducibleBuildsPlugin)
341306

@@ -346,7 +311,6 @@ def httpMarshallersJavaSubproject(moduleName: String) =
346311
.settings(
347312
name := s"pekko-http-$moduleName")
348313
.dependsOn(http)
349-
.settings(commonSettings)
350314
.enablePlugins(BootstrapGenjavadoc)
351315
.enablePlugins(ReproducibleBuildsPlugin)
352316

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Remove Scala 2.12 compatibility support
19+
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.http.ccompat.imm.package")
20+
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.http.ccompat.imm.package$")

http-core/src/main/scala-2.13+/org/apache/pekko/http/ccompat/imm/package.scala

Lines changed: 0 additions & 21 deletions
This file was deleted.

http-core/src/main/scala-2.13-/org/apache/pekko/http/ccompat/CompatImpl.scala

Lines changed: 0 additions & 43 deletions
This file was deleted.

http-core/src/main/scala-2.13-/org/apache/pekko/http/ccompat/MapHelpers.scala

Lines changed: 0 additions & 24 deletions
This file was deleted.

http-core/src/main/scala-2.13-/org/apache/pekko/http/ccompat/imm/package.scala

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)