Skip to content

Commit 770d51b

Browse files
authored
add "Nightly Versions of Scala" to Overviews page (#3058)
undefined
1 parent 1828c47 commit 770d51b

File tree

5 files changed

+93
-3
lines changed

5 files changed

+93
-3
lines changed

_data/overviews.yml

+3
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@
161161
description: "A diverse and comprehensive set of libraries is important to any productive software ecosystem. While it is easy to develop and distribute Scala libraries, good library authorship goes beyond just writing code and publishing it. In this guide, we cover the important topic of Binary Compatibility."
162162
icon: puzzle-piece
163163
url: "core/binary-compatibility-for-library-authors.html"
164+
- title: Nightly Versions of Scala
165+
description: "We regularly publish 'nightlies' of both Scala 3 and Scala 2 so that users can preview and test the contents of upcoming releases. Here's how to find and use these versions."
166+
url: "core/nightlies.html"
164167

165168
- category: "Tools"
166169
description: "Reference material on core Scala tools like the Scala REPL and Scaladoc generation."

_ja/overviews/macros/paradise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ title: マクロパラダイス
1919
マクロパラダイス (Macro paradise) とは Scala の複数のバージョンをサポートするコンパイラプラグインで、一般向けにリリースされている <code>scalac</code> と共に正しく動作するように設計されている。
2020
これによって、将来の Scala に取り込まれるよりもいち早く最新のマクロ機能を使えるようになっている。
2121
[サポートされている機能とバージョンの一覧](/ja/overviews/macros/roadmap.html))に関してはロードマップページを、
22-
動作の保証に関しては[マクロパラダイスのアナウンスメント](https://scalamacros.org/news/2013/08/07/roadmap-for-macro-paradise.html)を参照してほしい。
22+
動作の保証に関しては[マクロパラダイスのアナウンスメント](hxxps://scalamacros.org/news/2013/08/07/roadmap-for-macro-paradise.html)を参照してほしい。
2323

2424
~/210x $ scalac -Xplugin:paradise_*.jar -Xshow-phases
2525
phase name id description

_ja/overviews/macros/typemacros.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title: 型マクロ
99
**Eugene Yokota 訳**
1010

1111
型マクロ (type macro) は[マクロパラダイス](/ja/overviews/macros/paradise.html)の以前のバージョンから利用可能だったが、マクロパラダイス 2.0 ではサポートされなくなった。
12-
[the paradise 2.0 announcement](https://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) に説明と移行のための戦略が書かれている。
12+
[the paradise 2.0 announcement](hxxps://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) に説明と移行のための戦略が書かれている。
1313

1414
## 直観
1515

_ja/overviews/macros/untypedmacros.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title: 型指定の無いマクロ
99
**Eugene Yokota 訳**
1010

1111
型指定の無いマクロ (untyped macro) は[マクロパラダイス](/ja/overviews/macros/paradise.html)の以前のバージョンから利用可能だったが、マクロパラダイス 2.0 ではサポートされなくなった。
12-
[the paradise 2.0 announcement](https://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) に説明と移行のための戦略が書かれている。
12+
[the paradise 2.0 announcement](hxxps://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) に説明と移行のための戦略が書かれている。
1313

1414
## 直観
1515

_overviews/core/nightlies.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
layout: singlepage-overview
3+
title: Nightly Versions of Scala
4+
permalink: /overviews/core/:title.html
5+
---
6+
7+
We regularly publish nightly versions of both Scala 3 and 2 so that users can preview and test the contents of upcoming releases.
8+
9+
Here's how to find and use these versions.
10+
11+
## Scala 3
12+
13+
Scala 3 nightly versions are published to Maven Central. If you know the full version number of the nightly you want to use, you can use it just like any other Scala 3 version.
14+
15+
One quick way to get that version number is to visit [https://dotty.epfl.ch](https://dotty.epfl.ch) and look in the upper left corner.
16+
17+
Another way is to scrape Maven Central, as shown in this script: [https://raw.githubusercontent.com/VirtusLab/community-build3/master/scripts/lastVersionNightly.sc](https://raw.githubusercontent.com/VirtusLab/community-build3/master/scripts/lastVersionNightly.sc)
18+
19+
A third way is to use [scala-cli](https://scala-cli.virtuslab.org), as follows. (Since Scala 3.5.0, the `scala` command runs `scala-cli`.)
20+
21+
### scala-cli
22+
23+
You can run nightlies with commands such as:
24+
25+
scala-cli -S 3.nightly
26+
scala-cli -S 3.3.nightly
27+
28+
The default command is `repl`, but all the other scala-cli subcommands such as `compile` and `run` work, too. It also works with `//>` directives in your script itself, for example:
29+
30+
//> using scala 3.nightly
31+
32+
See this [scala-cli doc page](https://scala-cli.virtuslab.org/docs/commands/compile#scala-nightlies) for details.
33+
34+
## Scala 2.13 or 2.12
35+
36+
We informally refer to Scala 2 “nightly” versions, but technically it's a misnomer. A so-called “nightly” is built for every merged PR.
37+
38+
Scala 2 nightly versions are published to a special resolver. Unless you are using scala-cli, you'll need to add that resolver to your build configuration in order to use these versions.
39+
40+
### quick version (sbt)
41+
42+
Global / resolvers += "scala-integration" at
43+
"https://scala-ci.typesafe.com/artifactory/scala-integration/"
44+
scalaVersion := "2.13.15-bin-abcd123"
45+
46+
For a 2.12 nightly, substitute e.g. `2.12.20` for `2.13.15`; in either case, it's the version number of the _next_ release on that branch.
47+
48+
For `abcd123`, substitute the first 7 characters of the SHA of the latest commit to the [2.13.x branch](https://github.com/scala/scala/commits/2.13.x) or [2.12.x branch](https://github.com/scala/scala/commits/2.12.x) that has a green checkmark. (Clicking the checkmark will show a CI job name with the whole version in its name.)
49+
50+
A quick way to find out the full version number of a current nightly is to use [scala-cli](https://scala-cli.virtuslab.org), as follows.
51+
52+
### quick version (scala-cli)
53+
54+
You can run nightlies with:
55+
56+
scala-cli -S 2.13.nightly
57+
scala-cli -S 2.nightly # same as 2.13.nightly
58+
scala-cli -S 2.12.nightly
59+
60+
The default command is `repl`, but all the other scala-cli subcommands such as `compile` and `run` work, too. It also works with `//>` directives in your script itself, for example:
61+
62+
//> using scala 2.nightly
63+
64+
### Longer explanation
65+
66+
We no longer publish `-SNAPSHOT` versions of Scala 2.
67+
68+
But the team does publish nightly versions, each with its own fixed version number. The version number of a nightly looks like e.g. `2.13.1-bin-abcd123`. (`-bin-` signals binary compatibility to sbt; all 2.13.x releases since 2.13.0 are binary compatible with each other.)
69+
70+
To tell sbt to use one of these nightlies, you need to do three things.
71+
72+
First, add the resolver where the nightlies are kept:
73+
74+
Global / resolvers += "scala-integration" at
75+
"https://scala-ci.typesafe.com/artifactory/scala-integration/"
76+
77+
Second, specify the Scala version:
78+
79+
scalaVersion := "2.13.1-bin-abcd123"
80+
81+
But that isn't a real version number. Manually substitute a version number containing the 7-character SHA of the last commit in the [scala/scala repository](https://github.com/scala/scala) for which a nightly version was published. Look at [https://travis-ci.org/scala/scala/branches](https://travis-ci.org/scala/scala/branches) and you'll see the SHA in the upper right corner of the 2.13.x (or 2.12.x) section.
82+
83+
As soon as 2.13.1 is released, the version number in the nightly will bump to 2.13.2, and so on.
84+
85+
If you have a multiproject build, be sure you set these settings across all projects when you modify your build definition. Or, you may set them temporarily in the sbt shell with `++2.13.1-bin-abcd123` (sbt 0.13.x) or `++2.13.1-bin-abcd123!` (sbt 1.x; the added exclamation point is necessary to force a version not included in `crossScalaVersions` to be used).
86+
87+
Ideally, we would suggest an automated way to ask Travis-CI for the right SHA. This is presumably possible via Travis-CI's API, but as far as we know, nobody has looked into it yet. (Is there a volunteer?)

0 commit comments

Comments
 (0)