Skip to content

Commit

Permalink
Remove Scala 2.11 support && Update ZIO to 2.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii committed Apr 11, 2023
1 parent 47d36c5 commit 952557b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 28 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ jobs:
with:
fetch-depth: 0
- name: Setup Scala and Java
uses: olafurpg/setup-scala@v10
uses: actions/setup-java@v3.10.0
with:
distribution: temurin
java-version: '17'
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Lint code
Expand All @@ -35,7 +39,11 @@ jobs:
- name: Checkout current branch
uses: actions/checkout@v2.4.0
- name: Setup Scala and Java
uses: olafurpg/setup-scala@v10
uses: actions/setup-java@v3.10.0
with:
distribution: temurin
java-version: '17'
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Check Document Generation
Expand All @@ -47,7 +55,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: ['adopt@1.8', 'adopt@1.11']
java: ['8', '11', '17']
scala: ['2.12.17', '2.13.10', '3.2.2']
platform: ['JVM', 'JS', 'Native']
steps:
Expand All @@ -56,9 +64,11 @@ jobs:
with:
fetch-depth: 0
- name: Setup Scala and Java
uses: olafurpg/setup-scala@v10
uses: actions/setup-java@v3.10.0
with:
distribution: temurin
java-version: ${{ matrix.java }}
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Run tests
Expand Down Expand Up @@ -86,7 +96,11 @@ jobs:
with:
fetch-depth: 0
- name: Setup Scala and Java
uses: olafurpg/setup-scala@v10
uses: actions/setup-java@v3.10.0
with:
distribution: temurin
java-version: '17'
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Release artifacts
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
In order to use this library, we need to add the following line in our `build.sbt` file:

```scala
libraryDependencies += "dev.zio" %% "zio-mock" % "1.0.0-RC9"
libraryDependencies += "dev.zio" %% "zio-mock" % "1.0.0-RC10"
```

## The Problem
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ addCommandAlias(
";mockNative/compile"
)

val zioVersion = "2.0.10"
val zioVersion = "2.0.12"

lazy val root = (project in file("."))
.aggregate(
Expand Down
3 changes: 1 addition & 2 deletions mock/shared/src/main/scala-2/zio/mock/MockableMacro.scala
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ private[mock] object MockableMacro {
wrapInUnsafe(q"rts.unsafe.run(proxy($tag, ..$paramNames)).getOrThrowFiberFailure()")
}

val noParams = info.symbol.paramLists.isEmpty // Scala 2.11 workaround. For some reason isVal == false in 2.11
if (info.symbol.isVal || (noParams && TestVersion.isScala211)) q"$mods val $name: $returnType = $returnValue"
if (info.symbol.isVal) q"$mods val $name: $returnType = $returnValue"
else {
info.symbol.paramLists.map(_.map { ts =>
val name = ts.asTerm.name
Expand Down
22 changes: 3 additions & 19 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,6 @@ object BuildHelper {
"-Xmax-classfile-name",
"242"
) ++ std2xOptions ++ optimizerOptions(optimize)
case Some((2, 11)) =>
Seq(
"-Ypartial-unification",
"-Yno-adapted-args",
"-Ywarn-inaccessible",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Xexperimental",
"-Ywarn-unused-import",
"-Xfuture",
"-Xsource:2.13",
"-Xmax-classfile-name",
"242"
) ++ std2xOptions
case _ => Seq.empty
}

Expand All @@ -190,14 +176,12 @@ object BuildHelper {

def crossPlatformSources(scalaVer: String, platform: String, conf: String, baseDir: File) = {
val versions = CrossVersion.partialVersion(scalaVer) match {
case Some((2, 11)) =>
List("2.11", "2.11+", "2.11-2.12", "2.x")
case Some((2, 12)) =>
List("2.12", "2.11+", "2.12+", "2.11-2.12", "2.12-2.13", "2.x")
List("2.12", "2.12+", "2.12-2.13", "2.x")
case Some((2, 13)) =>
List("2.13", "2.11+", "2.12+", "2.13+", "2.12-2.13", "2.x")
List("2.13", "2.12+", "2.13+", "2.12-2.13", "2.x")
case Some((3, 0)) =>
List("dotty", "2.11+", "2.12+", "2.13+", "3.x")
List("dotty", "2.12+", "2.13+", "3.x")
case _ =>
List()
}
Expand Down

0 comments on commit 952557b

Please sign in to comment.