diff options
Diffstat (limited to 'docs/docs/contributing')
-rw-r--r-- | docs/docs/contributing/getting-started.md | 43 | ||||
-rw-r--r-- | docs/docs/contributing/workflow.md | 30 |
2 files changed, 55 insertions, 18 deletions
diff --git a/docs/docs/contributing/getting-started.md b/docs/docs/contributing/getting-started.md index bea5b6962..4c7299914 100644 --- a/docs/docs/contributing/getting-started.md +++ b/docs/docs/contributing/getting-started.md @@ -19,21 +19,48 @@ Requirements Make sure that you are using Java 8 or later, the output of `java -version` should contain `1.8`. -Compiling and running code --------------------------- +Compiling and Running +--------------------- +Start by cloning the repository: + +```none +$ git clone https://github.com/lampepfl/dotty.git +$ cd dotty +``` + +Dotty provides a standard sbt build: compiling, running and starting a repl can +all be done from within sbt using + +```none +$ sbt +> dotc tests/pos/HelloWorld.scala +> dotr HelloWorld +hello world +``` + +there is also a bash script that can be used in the same way: + ```bash -git clone https://github.com/lampepfl/dotty.git -cd dotty -# Clone dotty-compatible stdlib. Needed for running the test suite. -git clone -b dotty-library https://github.com/DarkDimius/scala.git scala-scala # Compile code using Dotty ./bin/dotc tests/pos/HelloWorld.scala # Run it with the proper classpath ./bin/dotr HelloWorld ``` + Starting a REPL --------------- -```bash -./bin/dotr +```none +$ sbt +> repl +Welcome to Scala.next (pre-alpha) (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_101). +Type in expressions to have them evaluated. +Type :help for more information. +scala> +``` + +or via bash: + +```none +$ ./bin/dotr ``` diff --git a/docs/docs/contributing/workflow.md b/docs/docs/contributing/workflow.md index a0b9fd528..48f71053e 100644 --- a/docs/docs/contributing/workflow.md +++ b/docs/docs/contributing/workflow.md @@ -5,17 +5,27 @@ title: "Workflow" This document details common workflow patterns when working with Dotty. +## Cloning and building ## + +```bash +# Start by cloning the repository: +git clone https://github.com/lampepfl/dotty.git +cd dotty +# Clone dotty-compatible stdlib. Needed for running the test suite. +git clone -b dotty-library https://github.com/DarkDimius/scala.git scala-scala +``` + ## Compiling files with dotc ## From sbt: -```bash -> run <OPTIONS> <FILE> +```none +> dotc <OPTIONS> <FILE> ``` From terminal: -```bash +```none $ ./bin/dotc <OPTIONS> <FILE> ``` @@ -37,7 +47,7 @@ Additional logging information can be obtained by changes some `noPrinter` to ## Running tests ## -```bash +```none $ sbt > partest --show-diff --verbose ``` @@ -45,21 +55,21 @@ $ sbt ## Running single tests ## To test a specific test tests/x/y.scala (for example tests/pos/t210.scala): -```bash +```none > partest-only-no-bootstrap --show-diff --verbose tests/partest-generated/x/y.scala ``` -Currently this will re-run some tests and do some preprocessing because of the -way partest has been set up. +Currently this will re-run some unit tests and do some preprocessing because of +the way partest has been set up. ## Inspecting Trees with Type Stealer ## There is no power mode for the REPL yet, but you can inspect types with the type stealer: -```bash -$ ./bin/dotr -scala> import test.DottyTypeStealer._; import dotty.tools.dotc.core._; import Contexts._,Types._ +```none +> repl +scala> import dotty.tools.DottyTypeStealer._; import dotty.tools.dotc.core._; import Contexts._,Types._ ``` Now, you can define types and access their representation. For example: |