aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-11-03 15:32:34 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-11-22 01:35:07 +0100
commit7fbb4513489df11f831d69ca07a58a809493361e (patch)
tree9d8c885d1a932f567e9ae6cf1316c1454bffbe8a /docs
parentb2143a1dd44b6a87b8a323c4440a5f2bc6897672 (diff)
downloaddotty-7fbb4513489df11f831d69ca07a58a809493361e.tar.gz
dotty-7fbb4513489df11f831d69ca07a58a809493361e.tar.bz2
dotty-7fbb4513489df11f831d69ca07a58a809493361e.zip
Update documentation for new sbt commands
Diffstat (limited to 'docs')
-rw-r--r--docs/css/main.scss7
-rw-r--r--docs/docs/contributing/getting-started.md43
-rw-r--r--docs/docs/contributing/workflow.md30
-rw-r--r--docs/docs/index.md4
4 files changed, 63 insertions, 21 deletions
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 <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:
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