How to add Scala 3 specific functionality in a cross built project?

Viewed 58

I am building a Scala library using

ThisBuild / crossScalaVersions := List("2.13.8", "3.2.0")

This works as long as I use Scala 2 syntax for the entire project for compatibility. When I run command +publish from sbt, it publishes two modules, one prefixed with 2.13 and another one prefixed with _3.

I now want to build some exclusive functionality for Scala 3 users in the Scala 3 generated artefact. More specifically, I want to provide a macro derivation for scala 3 users.

How do I do that?

0 Answers
Related