As you might have guessed, you can set a default Scala version with sdk default scala 2. Type scala in the Terminal and itâll open up an interactive Scala REPL with Scala 2.11.12. Type sdk use scala 2.11.12 to switch to the Scala version you just downloaded. When compiling source for the different Scala versions, they will be written out to the respective target directories:įor more information read the SBT documentation on cross building. Install Scala 2.11.12 with sdk install scala 2.11.12. For example to switch to Scala 2.12 use: ++ 2.12 To switch to a specific Scala version use ++. For example to run tests across all versions use: + test When compiling your project simply use the + directive before a task to denote cross building the project across all Scala versions for that task. src// scala directory will be used for common changes.Since SBT 0.13.8 (thanks to this PR) you can simply separate your src directories to versioned equivalents and have everything just work as expected.įor example to support custom code for Scala 2.11 and 2.12, youâd create the following directories: If you want to dig deeper, there are a few references at your disposal: The Scala 3 Book targets developers new to the Scala language. Here we provide you with a quick overview of the most important changes. Scala 2.13.10 - Released on OctoLatest 2.12.x maintenance release: Scala 2.12.17 - Released on SeptemLast 2.11. That's why I included "which at the moment is 2.13.CrossScalaVersions := Seq ( "2.11.8", "2.12.2" )Ä«ut how do you go about supporting APIs that exist in one version but not the other version of Scala within the same project? The exciting new version of Scala 3 brings many improvements and new features. Indeed, but on first run it you'll see a fixed version number that you're free to swap in for the varying one. When using 2.nightly, it would download some file from /ui/api/v1/ui/nativeBrowser/scala-integration/org/scala-lang/scala-compiler every single time that can be seen as a more powerful version of Javas checked exceptions. ⢠those following the Scala 2 development process have seen On JDK 21, ClassfileParser doesn't handle MethodParameter attributes without names scala/bug#12783 and/or the PRs that are linked from it Scala is a strong statically typed high-level general-purpose programming language that. 0.0.1-SNAPSHOT 2.10.4 <>1.7</>.
0 Comments
Leave a Reply. |