Skip to content

Commit e236878

Browse files
Natalia Margarita Gonzalez Herrerajenkins
Natalia Margarita Gonzalez Herrera
authored and
jenkins
committed
util/util-slf4j-api: scala3 migration
**Problem** We're migrating util-slf4j-api to scala3. Dotty has new syntax rules that need to be addressed. This project also depends on util-mock and therefore on mockito-scala, which is incompatible with scala3. **Solution** Use migration flags to solve syntax warnings. Remove dependency on mockito-scala and use mockito-core instead in LoggingTest and MarkerLoggingTest. JIRA Issues: CSL-11110 Differential Revision: https://phabricator.twitter.biz/D725491
1 parent 6131382 commit e236878

File tree

6 files changed

+193
-186
lines changed

6 files changed

+193
-186
lines changed

CHANGELOG.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ Note that ``PHAB_ID=#`` and ``RB_ID=#`` correspond to associated messages in com
66

77
Unreleased
88
----------
9+
* util-sl4j-api: Experimentally crossbuilds with Scala 3. ``PHAB_ID=D725491``
10+
911
* util-cache-guava: Experimentally crossbuilds with Scala 3. ``PHAB_ID=D716101``.
1012

1113
* util-cache: Experimentally crossbuilds with Scala 3. ``PHAB_ID=D714304``.
1214

1315
New Features
1416
~~~~~~~~~~~~
15-
1617
* util-zk-test: Experimentally crossbuilds with Scala 3. ``PHAB_ID=D720603``
1718

1819
21.8.0 (No 21.7.0 Release)

build.sbt

+5-5
Original file line numberDiff line numberDiff line change
@@ -583,15 +583,15 @@ lazy val utilSlf4jApi = Project(
583583
id = "util-slf4j-api",
584584
base = file("util-slf4j-api")
585585
).settings(
586-
sharedSettings
586+
sharedScala3EnabledSettings
587587
).settings(
588588
name := "util-slf4j-api",
589589
libraryDependencies ++= Seq(
590590
slf4jApi,
591-
"org.mockito" %% "mockito-scala" % mockitoScalaVersion % "test",
592-
"org.slf4j" % "slf4j-simple" % slf4jVersion % "test"
593-
)
594-
).dependsOn(utilCore % "test", utilMock % "test")
591+
"org.mockito" % "mockito-core" % mockitoVersion % "test",
592+
"org.slf4j" % "slf4j-simple" % slf4jVersion % "test",
593+
) ++ scalatestMockitoVersionedDep(scalaVersion.value)
594+
).dependsOn(utilCore % "test")
595595

596596
lazy val utilSlf4jJulBridge = Project(
597597
id = "util-slf4j-jul-bridge",

util-slf4j-api/src/test/scala/com/twitter/util/logging/BUILD

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ scala_library(
77
],
88
tags = ["bazel-compatible"],
99
dependencies = [
10+
"3rdparty/jvm/org/mockito:mockito-core",
11+
"3rdparty/jvm/org/scalatest",
12+
"3rdparty/jvm/org/scalatestplus:junit",
13+
"3rdparty/jvm/org/scalatestplus:mockito-3-3",
14+
"3rdparty/jvm/org/scalatestplus:scalacheck",
1015
"3rdparty/jvm/org/slf4j:slf4j-api",
1116
"util/util-core/src/main/scala/com/twitter/io",
1217
"util/util-slf4j-api/src/main/scala/com/twitter/util/logging",

0 commit comments

Comments
 (0)