sbt / sbt-buildinfo

I know this because build.sbt knows this.
MIT License
555 stars 89 forks source link

Scala 3 compatibility broken for ToJson #191

Open crispywalrus opened 1 year ago

crispywalrus commented 1 year ago

BuildInfoOption.ToJson generates code that doesn't compile with scala 3.x. It uses _ wildcards and tries to match against scala.Int (and many other types) These have been changed in scala 3 so perhaps we need a option or fork that produces scala 3 compatible code.

arixmkii commented 1 year ago

No need to fork. It could be added with Scala3 renderers and then users could opt in to use this renderers, when they need Scala3 code. I never tried using generated sources for multiple Scala version, so, I don't know if it is possible to just generate for both Scala2 and Scala3 at the same time (w/o requiring additional support from SBT).

rreckel commented 1 year ago

Hi,

I just opened a pull request that should solve this issue. Hope it helps