Skip to content

Commit b344239

Browse files
authored
doc(multi-staging): move setup/flags to create a new project
1 parent 946604b commit b344239

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

docs/docs/reference/metaprogramming/staging.md

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ From [lampepfl/dotty-staging.g8](https://github.com/lampepfl/dotty-staging.g8).
8181

8282
It will create a project with the necessary dependencies and some examples.
8383

84+
In case you prefer to create the project on your own, make sure to define the following dependency in your build.sbt
85+
86+
```scala
87+
libraryDependencies += "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value
88+
```
89+
90+
and in case you use `dotc`/`dotr` directly, then use the `-with-compiler` flag for both:
91+
```shell
92+
dotc -with-compiler -d out Test.scala
93+
dotr -with-compiler -classpath out Test
94+
```
95+
96+
8497
## Example
8598

8699
Now take exactly the same example as in [Macros](./macros.md). Assume that we
@@ -104,24 +117,3 @@ val f: Array[Int] => Int = run {
104117

105118
f.apply(Array(1, 2, 3)) // Returns 6
106119
```
107-
108-
Note that if we need to run the main (in an object called `Test`) after
109-
compilation we need to make available the compilation to the runtime:
110-
111-
```shell
112-
dotc -with-compiler -d out Test.scala
113-
dotr -with-compiler -classpath out Test
114-
```
115-
116-
Or, from SBT:
117-
118-
```scala
119-
libraryDependencies += "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value
120-
```
121-
122-
## Template project
123-
Using sbt version `1.1.5+`, do:
124-
```
125-
sbt new lampepfl/dotty-staging.g8
126-
```
127-
in the folder where you want to clone the template.

0 commit comments

Comments
 (0)