Skip to content

Commit 983202b

Browse files
authored
Merge pull request #2521 from Varunram/getting-started
Add Getting Started Page for Users
2 parents 3e0d6d3 + dc9c11f commit 983202b

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

docs/docs/contributing/getting-started.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,14 @@ or via bash:
6565
$ dotr
6666
```
6767

68+
69+
Generating Documentation
70+
-------------------------
71+
To generate this page and other static page docs, run
72+
```bash
73+
$ sbt
74+
> genDocs
75+
```
76+
6877
Before contributing to Dotty, we invite you to consult the
6978
[Dotty Developer Guidelines](https://github.com/lampepfl/dotty/blob/master/CONTRIBUTING).

docs/docs/usage/getting-started.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
layout: doc-page
3+
title: Getting Started: Users
4+
---
5+
6+
7+
8+
Basics
9+
------------
10+
Make sure that you are using Java 8 or later. The output of `java -version`
11+
should contain `1.8`.
12+
13+
14+
Option 1: Install Dotty
15+
-------------
16+
If you're a Mac user, you can install dotty with [brew](https://brew.sh/)
17+
18+
```bash
19+
brew install lampepfl/brew/dotty
20+
```
21+
22+
If you're a Linux or Windows user, download the [latest release](https://github.com/lampepfl/dotty/releases). Optionally add path of the folder `bin/` to the system environment variable `PATH`.
23+
24+
Option 2: Using Dotty directly from source
25+
-------------
26+
```bash
27+
$ git clone --recursive https://github.com/lampepfl/dotty.git
28+
$ cd dotty
29+
$ sbt managedSources # Needed for IDE import to succeed
30+
```
31+
32+
Dotty provides a standard sbt build: compiling, running and starting a repl can
33+
all be done from within sbt:
34+
35+
```bash
36+
$ sbt
37+
> dotc tests/pos/HelloWorld.scala
38+
> dotr HelloWorld
39+
hello world
40+
```
41+
42+
Try Dotty
43+
----------
44+
Try it in your browser with [Scastie](https://scastie.scala-lang.org/?target=dotty)
45+
46+
47+
Create a Dotty Project
48+
-----------------------
49+
The fastest way to create a new project in dotty is using [sbt (0.13.5+)](http://www.scala-sbt.org/)
50+
51+
Create a dotty project:
52+
```bash
53+
$ sbt new lampepfl/dotty.g8
54+
```
55+
56+
Or a Dotty project that cross compiles with Scala 2:
57+
```bash
58+
$ sbt new lampepfl/dotty-cross.g8
59+
```
60+
61+
For an example project, see the [Dotty Example Proejct](https://github.com/lampepfl/dotty-example-project)
62+
63+
64+
Bash Scripts
65+
-------------
66+
Assuming that you have cloned the Dotty repo locally, append the following line on your `.bash_profile`:
67+
68+
```shell
69+
$ export PATH=$HOME/dotty/bin:$PATH
70+
```
71+
72+
and you will be able to run the corresponding commands directly from your console:
73+
74+
```shell
75+
# Compile code using Dotty
76+
$ dotc tests/pos/HelloWorld.scala
77+
78+
# Run it with the proper classpath
79+
$ dotr HelloWorld
80+
```
81+
82+
83+
Starting a REPL
84+
----------------
85+
```bash
86+
$ sbt
87+
> repl
88+
Welcome to Scala.next (pre-alpha) (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_101).
89+
Type in expressions to have them evaluated.
90+
Type :help for more information.
91+
scala>
92+
```
93+
94+
or via bash:
95+
96+
```bash
97+
$ dotr
98+
```

docs/sidebar.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ sidebar:
33
url: blog/index.html
44
- title: Usage
55
subsection:
6+
- title: Getting Started
7+
url: docs/usage/getting-started.html
68
- title: sbt-projects
79
url: docs/usage/sbt-projects.html
810
- title: IDE support for Dotty

0 commit comments

Comments
 (0)