From 986f5e4a3e03fe1e80763b4abd33be750dbafadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Tue, 23 Apr 2024 08:14:31 +0200 Subject: [PATCH] docs: Document that you need Scala 3.4 or 2.13.x with `-Xsource:3` Closes #88 --- site-in/other-features/flexible.md | 4 +++- site-in/setup.md | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/site-in/other-features/flexible.md b/site-in/other-features/flexible.md index 0de850cad8..a920d5651f 100644 --- a/site-in/other-features/flexible.md +++ b/site-in/other-features/flexible.md @@ -9,7 +9,9 @@ of integrating Typo piece-by-piece into your code base. ## Developed in the Scala 2/3 shared subset -Everything works on Scala 2.13 and 3.3. +Everything works on Scala 2.13 and 3.4. + +For *2.13* you need to set add `-Xsource:3` to `scalacOptions`. The shared subsets shrinks in size for every Scala 3 release, unfortunately. ## Bring your own DB library diff --git a/site-in/setup.md b/site-in/setup.md index a64a32aca3..7d614c594d 100644 --- a/site-in/setup.md +++ b/site-in/setup.md @@ -35,7 +35,7 @@ put it in `gen-db.sc` and run `scala-cli gen-db.sc` // remember to give the project a github star if you like it <3 // //> using dep "com.olvind.typo::typo:@VERSION@" -//> using scala "3.3.0" +//> using scala "3.4.0" import typo.* @@ -72,6 +72,11 @@ generateFromDb(options, targetFolder = targetDir, selector = selector, scriptsPa //scala.sys.process.Process(List("git", "add", targetDir.toString)).!! ``` +## Compiling the generated code + +For **Scala 2** you need to set add `-Xsource:3` to `scalacOptions`, with a recent version of Scala 2.13. +For **Scala 3** you'll need 3.4.0 or later. + ## `selector` You can customize which relations you generate code for, see [customize selected relations](customization/customize-selected-relations.md)