Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build ciris-enumeratum with Scala 3 #643

Merged
merged 3 commits into from
Feb 8, 2023

Conversation

fthomas
Copy link
Contributor

@fthomas fthomas commented Feb 8, 2023

This PR cross builds ciris-enumeratum with Scala 3:

  • Scala 3 has been added to the enumeratum's crossScalaVersions
  • The TypeNameRuntimePlatform has been split for Scala 2 and Scala 3. The Scala 3 implementation has been copied from the refined module.
  • -Yretain-trees was added to the Scala 3 scalacOptions to fix test compilation errors:
    sbt:ciris> enumeratumJVM/test
    [info] compiling 2 Scala sources to modules/enumeratum/jvm/target/scala-3.2.2/test-classes ...
    [error] -- Error: modules/enumeratum/shared/src/test/scala/enumeratum/values/CirisValueEnumSpec.scala:216:17
    [error] 216 |    val values = findValues
    [error]     |                 ^^^^^^^^^^
    [error]     |                 Option -Yretain-trees must be set in scalacOptions.
    [error]     |                 In SBT settings:
    [error]     |
    [error]     |                   scalacOptions += "-Yretain-trees"
    
    It is expected that this must be set:
    https://github.com/lloydmeta/enumeratum/blob/1facfdddd9498411ac8eb270cd8089d4b4f4cab0/README.md?plain=1#L28

fthomas and others added 3 commits February 8, 2023 12:49
This PR cross builds ciris-enumeratum with Scala 3:

* Scala 3 has been added to the enumeratum's `crossScalaVersions`
* The `TypeNameRuntimePlatform` has been splitted for Scala 2 and
  Scala 3. The Scala 3 implementation has been copied from the refined
  module.
* `-Yretain-trees` was added to the Scala 3 `scalacOptions` to fix test
  compilation errors:
  ```
  sbt:ciris> enumeratumJVM/test
  [info] compiling 2 Scala sources to modules/enumeratum/jvm/target/scala-3.2.2/test-classes ...
  [error] -- Error: modules/enumeratum/shared/src/test/scala/enumeratum/values/CirisValueEnumSpec.scala:216:17
  [error] 216 |    val values = findValues
  [error]     |                 ^^^^^^^^^^
  [error]     |                 Option -Yretain-trees must be set in scalacOptions.
  [error]     |                 In SBT settings:
  [error]     |
  [error]     |                   scalacOptions += "-Yretain-trees"
  ```
  It is expected that this must be set:
  https://github.com/lloydmeta/enumeratum/blob/1facfdddd9498411ac8eb270cd8089d4b4f4cab0/README.md?plain=1#L28
@vlovgr
Copy link
Owner

vlovgr commented Feb 8, 2023

Thanks a lot for this @fthomas! Will cut a new release shortly.

Edit: v3.1.0 has been released with these changes.

@vlovgr vlovgr merged commit fa78c0f into vlovgr:master Feb 8, 2023
@fthomas fthomas deleted the topic/enumeratum-scala-3 branch February 8, 2023 16:27
@fthomas
Copy link
Contributor Author

fthomas commented Feb 8, 2023

Many thanks for releasing this so quickly, @vlovgr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants