-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
tools and codegen-sbt compiles in scala3 making compile-time plugin available #1415
tools and codegen-sbt compiles in scala3 making compile-time plugin available #1415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you run fmt
to format the code and make the CI go to the next steps?
Also can you resolve the merge conflicts?
...le/modules/potatoes-clients/src/main/scala/poc/caliban/client/generated/potatoes/Color.scala
Outdated
Show resolved
Hide resolved
I guess we also need to modify |
About .circleci/config.yml, I guess so but I'm not familiar with this part. |
So basically here we create a build step that runs |
Ok. It does not work even for 2.13.8 right now because the test script is written with 2.12 hard dependencies. I'll have a look at it but because I'm gonna need to understand it first, it may take a few days (or months if my real work catches me up). |
codegen-sbt/src/main/scala/caliban/codegen/CompileTimeCalibanPlugin.scala
Show resolved
Hide resolved
It can be done and I've been able to pass the test manually but it is not simple as far as I can tell. We have several problems:
To run it, I need to fix the version in the main build.sbt file, (i.e. The process can be automated and changing temporarily This leads to two questions:
|
Hmm, maybe a simpler alternative for now could be just to add |
Ok, I'll write such tests based on the use we make of it in `Options.scala``. |
Guys, I was successfully running the scripted tests on all the Scala versions thanks to this change in the CI: https://github.com/ghostdogpr/caliban/pull/1264/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47R53-R56 IIRC, The issue is that when we're publishing Caliban locally, it generates 3 different version numbers: 1 per version of Scala. The fix is to force the version in the (Sorry if my response is a bit out of the blue, I only quickly read your conversation. Too quickly maybe) |
|
Since this is very useful and I will do a release, I will merge the PR already. With existing tests we know it doesn't break 2.x support, so it can only be better than before 😄 Feel free to add tests later if you have time. |
* tools and codegen-sbt now support scala3 * Moved sttp version to 3.7.1 * Merged scala-2.12 & 2.13 into scala-2, removed generated files from git added by mistake * fmt * Ran fmt on DescriptorUtils.scala in scala-3 * tools and codegen-sbt now support scala3 * Merged scala-2.12 & 2.13 into scala-2, removed generated files from git added by mistake * fmt * Now using scala 2.13.8 * now using the correct version, i.e 2.13 instead of 2.13.8 in test * testing back with version 2.12, not working * Preparing for merge * Now reading scala3 from crossScalaVersions, removed the useless setting used to do so before * Almost ready for push and PR * scalaFmt * Added tests for scala3 codegen sbt compile time plugins * Removed scripted3_jdk filter Co-authored-by: Pierre Ricadat <[email protected]>
This is a solution to #1239 and a Caliban 2 version of PR #1248.
The tests compile. I've also used it in a real project and it works for its scope.
Except for the Scala 3 changes, the problem was that the plugin generates the cached files in streams, without the usual scala version based directory structure.
It messed with +compile.
So I changed that.
In tools, a new problem is that the current zio.config.magnolia scala 3 implementation has a very different interface. So I had to add files specific to 2.12, 2.13 and 3.