Skip to content

Commit ceb7593

Browse files
authored
Merge pull request #1061 from yadavan88/scala-core-migration-scala3
Scala 3 Migration of modules
2 parents 6f78fcd + 06405ce commit ceb7593

File tree

228 files changed

+80
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+80
-77
lines changed

build.sbt

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ val zioVersion = "2.0.19"
2525
lazy val scala_core = (project in file("scala-core-modules/scala-core"))
2626
.settings(
2727
name := "scala-core",
28+
scalaVersion := scala3Version,
2829
libraryDependencies ++=
2930
Seq(
30-
jUnitInterface,
31-
catsEffect
31+
jUnitInterface
3232
) ++ scalaTestDeps
3333
)
3434

@@ -43,15 +43,32 @@ lazy val scala_core_2 = (project in file("scala-core-modules/scala-core-2"))
4343
lazy val scala_core_3 = (project in file("scala-core-modules/scala-core-3"))
4444
.settings(
4545
name := "scala-core-3",
46+
scalaVersion := scala3Version,
4647
libraryDependencies ++= scalaTestDeps,
4748
libraryDependencies += jUnitInterface,
48-
libraryDependencies += scalaReflection,
4949
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "2.2.0"
5050
)
5151

52+
lazy val scala2_core = (project in file("scala-core-modules/scala2-core"))
53+
.settings(
54+
name := "scala2-core",
55+
libraryDependencies ++= scalaTestDeps,
56+
libraryDependencies += jUnitInterface,
57+
libraryDependencies += scalaReflection,
58+
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "2.2.0",
59+
libraryDependencies += "com.github.scopt" %% "scopt" % "4.1.0",
60+
libraryDependencies += "org.rogach" %% "scallop" % "5.0.1",
61+
libraryDependencies += "org.backuity.clist" %% "clist-core" % "3.5.1",
62+
libraryDependencies += "org.backuity.clist" %% "clist-macros" % "3.5.1" % "provided",
63+
libraryDependencies += "args4j" % "args4j" % "2.33",
64+
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "test",
65+
libraryDependencies += catsEffect
66+
)
67+
5268
lazy val scala_core_4 = (project in file("scala-core-modules/scala-core-4"))
5369
.settings(
5470
name := "scala-core-4",
71+
scalaVersion := scala3Version,
5572
libraryDependencies ++= scalaTestDeps,
5673
libraryDependencies += jUnitInterface,
5774
libraryDependencies += scalaReflection
@@ -60,36 +77,32 @@ lazy val scala_core_4 = (project in file("scala-core-modules/scala-core-4"))
6077
lazy val scala_core_5 = (project in file("scala-core-modules/scala-core-5"))
6178
.settings(
6279
name := "scala-core-5",
80+
scalaVersion := scala3Version,
6381
libraryDependencies ++= scalaTestDeps,
64-
libraryDependencies += jUnitInterface,
65-
libraryDependencies += scalaReflection
82+
libraryDependencies += jUnitInterface
6683
)
6784

6885
lazy val scala_core_6 = (project in file("scala-core-modules/scala-core-6"))
6986
.settings(
7087
name := "scala-core-6",
88+
scalaVersion := scala3Version,
7189
libraryDependencies ++= scalaTestDeps,
7290
libraryDependencies += jUnitInterface
7391
)
7492

7593
lazy val scala_core_7 = (project in file("scala-core-modules/scala-core-7"))
7694
.settings(
7795
name := "scala-core-7",
96+
scalaVersion := scala3Version,
7897
libraryDependencies ++= scalaTestDeps,
7998
libraryDependencies += jUnitInterface,
80-
libraryDependencies += "com.github.scopt" %% "scopt" % "4.1.0",
81-
libraryDependencies += "org.rogach" %% "scallop" % "5.0.1",
82-
libraryDependencies += "org.backuity.clist" %% "clist-core" % "3.5.1",
83-
libraryDependencies += "org.backuity.clist" %% "clist-macros" % "3.5.1" % "provided",
84-
libraryDependencies += "args4j" % "args4j" % "2.33"
8599
)
86100

87101
lazy val scala_core_8 = (project in file("scala-core-modules/scala-core-8"))
88102
.settings(
89103
name := "scala-core-8",
90-
libraryDependencies += scalaReflection,
91104
libraryDependencies ++= scalaTestDeps,
92-
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "test",
105+
scalaVersion := scala3Version,
93106
libraryDependencies += "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2",
94107
libraryDependencies += "com.typesafe" % "config" % "1.2.1"
95108
// scalacOptions += "-Ymacro-debug-lite"
@@ -106,6 +119,7 @@ lazy val scala_core_io = (project in file("scala-core-modules/scala-core-io"))
106119
lazy val scala_core_oop = (project in file("scala-core-modules/scala-core-oop"))
107120
.settings(
108121
name := "scala-core-oop",
122+
scalaVersion := scala3Version,
109123
libraryDependencies ++=
110124
Seq(catsEffect, jUnitInterface) ++ scalaTestDeps
111125
)

scala-core-modules/scala-core-2/src/test/scala/com/baeldung/scala/exceptionhandling/ExceptionHandlingUnitTest.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
package com.baeldung.scala.exceptionhandling
22

3-
import com.baeldung.scala.exceptionhandling.ExceptionHandling.{
4-
DivideByZero,
5-
divideWithEither,
6-
divideWithOption,
7-
divideWithTry
8-
}
3+
import com.baeldung.scala.exceptionhandling.ExceptionHandling._
94
import org.scalatest.flatspec.AnyFlatSpec
105
import org.scalatest.matchers.should.Matchers
116

0 commit comments

Comments
 (0)