MENU
Contact
Contact

How to be a part of Scala’s Open Community Build

Picture of Wojciech Mazur, Tooling Software Developer

Wojciech Mazur

Tooling Software Developer
Sep 22, 2022|23 min read
Image Alt
1import scala.collection.SeqOps
2
3extension[A, CC[B] <: SeqOps[B, CC, CC[B]]](seq: CC[A])
4 def isRotationOf(that: CC[A]): Boolean = ???
5
6@main def Test =
7 Seq('A','B','C', 'D') isRotationOf "DAB" // ok
8 ("ABCD": Seq[Char]) isRotationOf "DAB" // ok (1)
9 wrapString("ABCD") isRotationOf "DAB" // ok (2)
10 "ABCD" isRotationOf "DAB" // error, no such method (3)
1someSetting :=
2 if(scalaVersion.value == “3.1.3”) someValue
3 else if (scalaVersion.value == Scala3) someOtherValue
4 else defaultValue
1 someSetting := CrossVersion.partialVersion(scalaVersion.value) match {
2 case Some((3, 2)) => someScala3Value
3 case Some((2, 13)) => someScala2Value
4 }
1 someSetting := CrossVersion.partialVersion(scalaVersion.value) match {
2 case Some((3, 1)) => someVerySpecificScala31Value
3 case Some((3, _)) => someScala3Value
4 case Some((2, _)) => someScala2Value
5 }
1someSetting :=
2 if (scalaVersion.value.startsWith(“3.1.”)) someVerySpecificScala31Value
3 else if (scalaVersion.value.startsWith(“3.”)) someScala3Value
4 else defaultScala2Value
1tests = compile-only // default for the project
2projects.overrides {
3 subModuleA.tests = full // compile and execute tests in project named `subModuleA`
4 benchmarks { tests = disabled } // ignore tests in project name `benchmarks`
5}
1mill.options = ["-J-Xss2M"]
2sbt.options = [ “-Dproject.in.ci=true”, “-J-Xmx5G”]
1sbt.commands = [
2 “genAdditionalSources”,
3 "set every Test/classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat",
4 """set Test/unmanagedSources/excludeFilter ~= { _ || “FailingTest.scala" }"""
5]
1 uses-compiler-plugins = true
2
1scala-cli \
2 https://raw.githubusercontent.com/VirtusLab/community-build3/master/cli/scb-cli.scala \
3 run virtuslab/avocado 3.2.1-RC1

Scala 3 Support and Migration

Curated by Sebastian Synowiec

Subscribe to our newsletter and never miss an article