|
| 1 | +--- |
| 2 | +layout: doc-page |
| 3 | +title: Command Cheatsheet |
| 4 | +--- |
| 5 | + |
| 6 | +## sbt commands |
| 7 | + |
| 8 | +Below is a cheat sheet of some frequently used commands to be used from SBT |
| 9 | +console – `sbt`. |
| 10 | + |
| 11 | + |
| 12 | +| Command | Description | |
| 13 | +|------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------| |
| 14 | +| `scala3/scalac` | Run the compiler directly, with any current changes. | |
| 15 | +| `scala3/scala` | Run the main method of a given class name. | |
| 16 | +| `scalac ../issues/Playground.scala` | Compile the given file – path relative to the Dotty directory. Output the compiled class files to the Dotty directory itself. | |
| 17 | +| `scala Playground` | Run the compiled class `Playground`. Dotty directory is on classpath by default. | |
| 18 | +| `repl` | Start REPL | |
| 19 | +| `scala3/scalac -print-tasty Foo.tasty` | Print the TASTy of top-level class `Foo` | |
| 20 | +| `scala3-bootstrapped/test` | Run all tests for Scala 3. (Slow, recommended for CI only) | |
| 21 | +| `scala3-bootstrapped/publishLocal` | Build Scala 3 locally. (Use to debug a specific project) | |
| 22 | +| `testOnly dotty.tools.dotc.CompilationTests -- *pos` | Run test (method) `pos` from `CompilationTests` suite. | |
| 23 | +| `testCompilation sample` | In all test suites, run test files containing the word `sample` in their title. | |
| 24 | +| `scala3-compiler/Test/runMain dotty.tools.printTypes`| Print types underlying representation | |
| 25 | +| `scaladoc/generateScalaDocumentation` | Build the documentation website (published to https://dotty.epfl.ch) | |
| 26 | +| `scaladoc/generateReferenceDocumentation` | Build the reference documentation website (published to https://docs.scala-lang.org/scala3/reference) | |
| 27 | + |
| 28 | + |
| 29 | +## Shell Commands |
| 30 | + |
| 31 | +Below is a cheat sheet of some frequently used commands to be used from your |
| 32 | +shell. |
| 33 | + |
| 34 | +| Command | Description | |
| 35 | +|--------------------------------------|------------------------------------------------------------------| |
| 36 | +| `rm -rv *.tasty *.class out || true` | clean all compiled artifacts, from root dotty directory | |
| 37 | +| `git clean -fdx` | a full clean of all files in the codebase not tracked by git | |
0 commit comments