Skip to content

Commit af7176c

Browse files
committed
Build: move 2.13-only sources to 2.13+
1 parent dd25c98 commit af7176c

8 files changed

Lines changed: 10 additions & 2 deletions

File tree

build.sbt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ inThisBuild(
1010
)
1111
)
1212

13+
def scala213PlusSourceDirectory(baseDir: File, sourceScope: String, scalaV: String): Seq[File] =
14+
CrossVersion.partialVersion(scalaV) match {
15+
case Some((2, 13)) | Some((3, _)) => Seq(baseDir / "src" / sourceScope / "scala-2.13+")
16+
case _ => Seq.empty
17+
}
18+
1319
lazy val commonSettings =
1420
Seq(
1521
organization := "org.mockito",
@@ -43,10 +49,12 @@ lazy val commonSettings =
4349
case Some((2, major)) if major <= 12 =>
4450
Seq()
4551
case _ =>
46-
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.2.0")
52+
Seq(Dependencies.scalaParallelCollections)
4753
}
4854
},
49-
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.13.0"
55+
libraryDependencies += Dependencies.scalaCollectionCompat,
56+
Compile / unmanagedSourceDirectories ++= scala213PlusSourceDirectory(baseDirectory.value, "main", scalaVersion.value),
57+
Test / unmanagedSourceDirectories ++= scala213PlusSourceDirectory(baseDirectory.value, "test", scalaVersion.value)
5058
)
5159

5260
lazy val publishSettings = Seq(

common/src/main/scala-2.13/org/mockito/internal/handler/package.scala renamed to common/src/main/scala-2.13+/org/mockito/internal/handler/package.scala

File renamed without changes.

common/src/main/scala-2.13/org/mockito/stubbing/ReturnsEmptyValues.scala renamed to common/src/main/scala-2.13+/org/mockito/stubbing/ReturnsEmptyValues.scala

File renamed without changes.

scalatest/src/test/scala-2.13/user/org/mockito/IdiomaticMockitoTest_213.scala renamed to scalatest/src/test/scala-2.13+/user/org/mockito/IdiomaticMockitoTest_213.scala

File renamed without changes.

scalatest/src/test/scala-2.13/user/org/mockito/Issue352_213.scala renamed to scalatest/src/test/scala-2.13+/user/org/mockito/Issue352_213.scala

File renamed without changes.

scalatest/src/test/scala-2.13/user/org/mockito/MockitoSugarTest_213.scala renamed to scalatest/src/test/scala-2.13+/user/org/mockito/MockitoSugarTest_213.scala

File renamed without changes.

scalatest/src/test/scala-2.13/user/org/mockito/scalatest/AsyncIdiomaticMockitoTest_213.scala renamed to scalatest/src/test/scala-2.13+/user/org/mockito/scalatest/AsyncIdiomaticMockitoTest_213.scala

File renamed without changes.

scalatest/src/test/scala-2.13/user/org/mockito/stubbing/ReturnsEmptyValuesTest.scala renamed to scalatest/src/test/scala-2.13+/user/org/mockito/stubbing/ReturnsEmptyValuesTest.scala

File renamed without changes.

0 commit comments

Comments
 (0)