Back to Scala3

Command Cheatsheet

docs/_docs/contributing/cheatsheet.md

3.8.33.4 KB
Original Source

sbt commands

Below is a cheat sheet of some frequently used commands to be used from SBT console – sbt.

CommandDescription
scala3/scalacRun the compiler directly, with any current changes.
scala3/scalaRun the main method of a given class name.
scalac ../issues/Playground.scalaCompile the given file – path relative to the Dotty directory. Output the compiled class files to the Dotty directory itself.
scala PlaygroundRun the compiled class Playground. Dotty directory is on classpath by default.
replStart REPL
scala3/scalac -print-tasty Foo.tastyPrint the TASTy of top-level class Foo
scala3-bootstrapped/testRun all tests for Scala 3. (Slow, recommended for CI only)
scala3-bootstrapped/publishLocalBuild Scala 3 locally. (Use to debug a specific project)
testOnly dotty.tools.dotc.CompilationTests -- *posRun test (method) pos from CompilationTests suite.
testCompilation sampleIn all test suites, run test files containing the word sample in their title.
scala3-compiler/Test/runMain dotty.tools.printTypesPrint types underlying representation
scaladoc/generateScalaDocumentationBuild the documentation website (published to https://nightly.scala-lang.org)
scaladoc/generateReferenceDocumentationBuild the reference documentation website (published to https://docs.scala-lang.org/scala3/reference)

Shell Commands

Below is a cheat sheet of some frequently used commands to be used from your shell.

CommandDescription
`rm -rv *.tasty *.class out
git clean -fdxa full clean of all files in the codebase not tracked by git