1
- # Example mill project that compiles using Dotty
1
+ # Example mill project that compiles using Scala 3
2
2
3
- ** NOTE** : Dotty support in mill is experimental. For now, sbt remains the
4
- preferred option, see http ://github.com/lampepfl/dotty -example-project for an
3
+ ** NOTE** : Scala 3 support in mill is experimental. For now, sbt remains the
4
+ preferred option. See https ://github.com/scala/scala3 -example-project for an
5
5
example sbt project.
6
6
7
7
## Usage
8
8
9
- This is a normal mill project, you can compile code with ` mill root.compile ` and run it
10
- with ` mill root.run ` , ` mill -i root.console ` will start a Dotty REPL.
9
+ This is a normal mill project. You can compile code with ` mill root.compile ` and run it
10
+ with ` mill root.run ` , ` mill -i root.console ` will start a Scala 3 REPL.
11
11
12
12
### IDE support
13
13
14
- Dotty comes built-in with IDE support, unfortunately this support is only
14
+ Scala 3 comes built-in with IDE support, unfortunately this support is only
15
15
available using sbt and not mill for now, see http://dotty.epfl.ch/docs/usage/ide-support.html
16
16
17
- ## Using Dotty in an existing project
17
+ ## Using Scala 3 in an existing project
18
18
19
19
### build.sc
20
- Any version number that starts with ` 0 .` is automatically recognized as Dotty,
20
+ Any version number that starts with ` 3 .` is automatically recognized as Scala 3;
21
21
you don't need to set up anything:
22
22
23
23
``` scala
24
24
def scalaVersion = " 3.0.1"
25
25
```
26
26
27
27
#### Nightly builds
28
- If the latest release of Dotty is missing a bugfix or feature you need, you may
29
- wish to use a nightly build. Look at the bottom of
30
- https://repo1.maven.org/maven2/ch/epfl/lamp/dotty_0.14/ to find the version
31
- number for the latest nightly build.
32
28
33
- ## Getting your project to compile with Dotty
29
+ If the latest release of Scala 3 is missing a bugfix or feature you need, you may
30
+ wish to use a nightly build. Look at the bottom of the list of
31
+ [ releases] ( https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/ )
32
+ to find the version number for the latest nightly build.
33
+
34
+ ## Getting your project to compile with Scala 3
34
35
35
36
When porting an existing project, it's a good idea to start out with the Scala 2
36
37
compatibility mode (note that this mode affects typechecking and thus may
37
- prevent some valid Dotty code from compiling) by adding to your ` build.sc ` :
38
+ prevent some valid Scala 3 code from compiling) by adding to your ` build.sc ` :
38
39
39
40
``` scala
40
41
def scalacOptions = T {
@@ -46,13 +47,13 @@ def scalacOptions = T {
46
47
```
47
48
48
49
Using the ` Dep.isDotty ` method ensures that this option will only be set when
49
- compiling with Dotty .
50
+ compiling with Scala 3 .
50
51
51
- A tool to port code from Scala 2.x to Dotty is currently in development at
52
- https://github.com/scalacenter/scalafix
52
+ A tool to port code from Scala 2.x to Scala 3 is available; see
53
+ https://scalacenter. github.io/scala-3-migration-guide/docs/tooling/scala-3-migrate-plugin.html
53
54
54
55
If your build contains dependencies that have only been published for Scala 2.x,
55
- you may be able to get them to work on Dotty by replacing:
56
+ you may be able to get them to work on Scala 3 by replacing:
56
57
57
58
``` scala
58
59
ivy " a::b:c "
63
64
``` scala
64
65
ivy " a::b:c " .withDottyCompat(scalaVersion())
65
66
```
66
-
67
- ## Discuss
68
-
69
- Feel free to come chat with us on the
70
- [ Dotty gitter] ( http://gitter.im/lampepfl/dotty ) !
0 commit comments