From 7fbb4513489df11f831d69ca07a58a809493361e Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 3 Nov 2016 15:32:34 +0100 Subject: Update documentation for new sbt commands --- docs/css/main.scss | 7 ++++- docs/docs/contributing/getting-started.md | 43 +++++++++++++++++++++++++------ docs/docs/contributing/workflow.md | 30 ++++++++++++++------- docs/docs/index.md | 4 +-- 4 files changed, 63 insertions(+), 21 deletions(-) (limited to 'docs') diff --git a/docs/css/main.scss b/docs/css/main.scss index dbc5153e2..f8354e6de 100644 --- a/docs/css/main.scss +++ b/docs/css/main.scss @@ -207,7 +207,7 @@ ul.post-list { } } -pre, code { +pre, code, code.hljs { padding: 0; border: 0; border-radius: 3px; @@ -221,6 +221,11 @@ code { padding-right: 0.1em; } +pre { + padding: 0.5em; + background-color: $grey !important; +} + body { font: 400 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; color: $text-color; 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 +```none +> dotc ``` From terminal: -```bash +```none $ ./bin/dotc ``` @@ -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: diff --git a/docs/docs/index.md b/docs/docs/index.md index 699fcecb1..8fceedbd0 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -11,8 +11,8 @@ Index ----- * Usage - [Migrating from Scala 2](usage/migrating.md) - - [Using Dotty with cbt](usage/cbt-projects.md) - - [Using Dotty with sbt](usage/sbt-projects.md) + - [Dotty projects with cbt](usage/cbt-projects.md) + - [Dotty projects with sbt](usage/sbt-projects.md) * Contributing - [Getting Started](contributing/getting-started.md) details on how to run tests, use the cli scripts -- cgit v1.2.3