Skip to content

Commit 5ef7b9b

Browse files
committed
updated site
1 parent 9b29ea8 commit 5ef7b9b

File tree

4 files changed

+106
-6
lines changed

4 files changed

+106
-6
lines changed

2.x/docs/en/changes/sbt-2.0-change-summary.html

+52-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ <h2 id="changes-with-compatibility-implications"><a class="header" href="#change
193193
<p>See also <a href="./migrating-from-sbt-1.x.html">Migrating from sbt 1.x</a>.</p>
194194
<ul>
195195
<li>sbt 2.x uses Scala 3.x for build definitions and plugins (Both sbt 1.x and 2.x are capable of building Scala 2.x and 3.x) by <a href="https://github.com/eed3si9n">@eed3si9n</a>, <a href="https://github.com/adpi2">@adpi2</a>, and others.</li>
196-
<li>Bare settings are added to all subprojects, as opposed to just the root subproject, and thus replacing the role that <code>ThisBuild</code> has played. by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/6746">#6746</a></li>
196+
<li>Bare settings are added to all subprojects, as opposed to just the root subproject, and thus replacing the role that <code>ThisBuild</code> has played.</li>
197197
<li><code>test</code> task is changed to be incremental test that can cache test results. Use <code>testFull</code> for full test by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7686">#7686</a></li>
198198
<li>sbt 2.x plugins are published with <code>_sbt2_3</code> suffix by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7671">#7671</a></li>
199199
<li>sbt 2.x adds <code>platform</code> setting so <code>ModuleID</code>'s <code>%%</code> operator can cross build on JVM as well as JS and Native, as opposed to <code>%%%</code> operator that was created in a plugin to workaround this issue, by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/6746">#6746</a></li>
@@ -206,8 +206,58 @@ <h3 id="dropped-dreprecations"><a class="header" href="#dropped-dreprecations">D
206206
<h2 id="features"><a class="header" href="#features">Features</a></h2>
207207
<ul>
208208
<li>Project matrix, which was available via plugin in sbt 1.x, is in-sourced.</li>
209-
<li>Local/remote hybrid cache system. sbt 2.x implements cached task, which can automatically cache the task results to local disk and Bazel-compatible remote cache. by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7464">#7464</a> / <a href="https://github.com/sbt/sbt/pull/7525">#7525</a></li>
209+
<li>sbt 2.x extends the unified slash syntax to support query of subprojects. Details below.</li>
210+
<li>Local/remote cache system. Details below</li>
210211
</ul>
212+
<h3 id="common-settings"><a class="header" href="#common-settings">Common settings</a></h3>
213+
<p>In sbt 2.x, the bare settings in <code>build.sbt</code> are interpreted to be common settings, and are injected to all subprojects. This means we can now set <code>scalaVersion</code> without using <code>ThisBuild</code> scoping:</p>
214+
<pre><code class="language-scala">scalaVersion := "3.3.3"
215+
</code></pre>
216+
<p>This also fixes the so-called dynamic dispatch problem:</p>
217+
<pre><code class="language-scala">lazy val hi = taskKey[String]("")
218+
hi := name.value + "!"
219+
</code></pre>
220+
<p>In sbt 1.x <code>hi</code> task will capture the name of the root project, but in sbt 2.x it will return the <code>name</code> of each subproject with <code>!</code>:</p>
221+
<pre><code class="language-scala">$ export SBT_NATIVE_CLIENT=true
222+
$ sbt show hi
223+
[info] entering *experimental* thin client - BEEP WHIRR
224+
[info] terminate the server with `shutdown`
225+
&gt; show hi
226+
[info] foo / hi
227+
[info] foo!
228+
[info] hi
229+
[info] root!
230+
</code></pre>
231+
<p>Contributed by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/6746">#6746</a></p>
232+
<h3 id="sbt-query"><a class="header" href="#sbt-query">sbt query</a></h3>
233+
<p>To filter down the subprojects, sbt 2.x introduces sbt query.</p>
234+
<pre><code class="language-bash">$ export SBT_NATIVE_CLIENT=true
235+
$ sbt foo.../test
236+
</code></pre>
237+
<p>The above runs all subprojects that begins with <code>foo</code>.</p>
238+
<pre><code class="language-bash">$ sbt ...@scalaBinaryVersion=3/test
239+
</code></pre>
240+
<p>The above runs all subprojects whose <code>scalaBinaryVersion</code> is <code>3</code>. Contributed by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7699">#7699</a></p>
241+
<h3 id="localremote-cache-system"><a class="header" href="#localremote-cache-system">Local/remote cache system</a></h3>
242+
<p>sbt 2.x implements cached task, which can automatically cache the task results to local disk and Bazel-compatible remote cache.</p>
243+
<pre><code class="language-scala">lazy val task1 = taskKey[String]("doc for task1")
244+
245+
task1 := (Def.cachedTask {
246+
name.value + version.value + "!"
247+
}).value
248+
</code></pre>
249+
<p>This tracks the inputs into the <code>task1</code> and creates a machine-wide disk cache, which can also be configured to also use a remote cache. Since it's common for sbt tasks to also produce files on the side, we also provide a mechanism to cache file contents:</p>
250+
<pre><code class="language-scala">lazy val task1 = taskKey[String]("doc for task1")
251+
252+
task1 := (Def.cachedTask {
253+
val converter = fileConverter.value
254+
....
255+
val output = converter.toVirtualFile(somefile)
256+
Def.declareOutput(output)
257+
name.value + version.value + "!"
258+
}).value
259+
</code></pre>
260+
<p>Contributed by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7464">#7464</a> / <a href="https://github.com/sbt/sbt/pull/7525">#7525</a></p>
211261
<h2 id="previously-on-sbt"><a class="header" href="#previously-on-sbt">Previously on sbt</a></h2>
212262
<p>See also:</p>
213263
<ul>

2.x/docs/en/print.html

+52-2
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ <h2 id="changes-with-compatibility-implications"><a class="header" href="#change
13681368
<p>See also <a href="changes/./migrating-from-sbt-1.x.html">Migrating from sbt 1.x</a>.</p>
13691369
<ul>
13701370
<li>sbt 2.x uses Scala 3.x for build definitions and plugins (Both sbt 1.x and 2.x are capable of building Scala 2.x and 3.x) by <a href="https://github.com/eed3si9n">@eed3si9n</a>, <a href="https://github.com/adpi2">@adpi2</a>, and others.</li>
1371-
<li>Bare settings are added to all subprojects, as opposed to just the root subproject, and thus replacing the role that <code>ThisBuild</code> has played. by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/6746">#6746</a></li>
1371+
<li>Bare settings are added to all subprojects, as opposed to just the root subproject, and thus replacing the role that <code>ThisBuild</code> has played.</li>
13721372
<li><code>test</code> task is changed to be incremental test that can cache test results. Use <code>testFull</code> for full test by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7686">#7686</a></li>
13731373
<li>sbt 2.x plugins are published with <code>_sbt2_3</code> suffix by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7671">#7671</a></li>
13741374
<li>sbt 2.x adds <code>platform</code> setting so <code>ModuleID</code>'s <code>%%</code> operator can cross build on JVM as well as JS and Native, as opposed to <code>%%%</code> operator that was created in a plugin to workaround this issue, by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/6746">#6746</a></li>
@@ -1381,8 +1381,58 @@ <h3 id="dropped-dreprecations"><a class="header" href="#dropped-dreprecations">D
13811381
<h2 id="features"><a class="header" href="#features">Features</a></h2>
13821382
<ul>
13831383
<li>Project matrix, which was available via plugin in sbt 1.x, is in-sourced.</li>
1384-
<li>Local/remote hybrid cache system. sbt 2.x implements cached task, which can automatically cache the task results to local disk and Bazel-compatible remote cache. by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7464">#7464</a> / <a href="https://github.com/sbt/sbt/pull/7525">#7525</a></li>
1384+
<li>sbt 2.x extends the unified slash syntax to support query of subprojects. Details below.</li>
1385+
<li>Local/remote cache system. Details below</li>
13851386
</ul>
1387+
<h3 id="common-settings"><a class="header" href="#common-settings">Common settings</a></h3>
1388+
<p>In sbt 2.x, the bare settings in <code>build.sbt</code> are interpreted to be common settings, and are injected to all subprojects. This means we can now set <code>scalaVersion</code> without using <code>ThisBuild</code> scoping:</p>
1389+
<pre><code class="language-scala">scalaVersion := "3.3.3"
1390+
</code></pre>
1391+
<p>This also fixes the so-called dynamic dispatch problem:</p>
1392+
<pre><code class="language-scala">lazy val hi = taskKey[String]("")
1393+
hi := name.value + "!"
1394+
</code></pre>
1395+
<p>In sbt 1.x <code>hi</code> task will capture the name of the root project, but in sbt 2.x it will return the <code>name</code> of each subproject with <code>!</code>:</p>
1396+
<pre><code class="language-scala">$ export SBT_NATIVE_CLIENT=true
1397+
$ sbt show hi
1398+
[info] entering *experimental* thin client - BEEP WHIRR
1399+
[info] terminate the server with `shutdown`
1400+
&gt; show hi
1401+
[info] foo / hi
1402+
[info] foo!
1403+
[info] hi
1404+
[info] root!
1405+
</code></pre>
1406+
<p>Contributed by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/6746">#6746</a></p>
1407+
<h3 id="sbt-query"><a class="header" href="#sbt-query">sbt query</a></h3>
1408+
<p>To filter down the subprojects, sbt 2.x introduces sbt query.</p>
1409+
<pre><code class="language-bash">$ export SBT_NATIVE_CLIENT=true
1410+
$ sbt foo.../test
1411+
</code></pre>
1412+
<p>The above runs all subprojects that begins with <code>foo</code>.</p>
1413+
<pre><code class="language-bash">$ sbt ...@scalaBinaryVersion=3/test
1414+
</code></pre>
1415+
<p>The above runs all subprojects whose <code>scalaBinaryVersion</code> is <code>3</code>. Contributed by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7699">#7699</a></p>
1416+
<h3 id="localremote-cache-system"><a class="header" href="#localremote-cache-system">Local/remote cache system</a></h3>
1417+
<p>sbt 2.x implements cached task, which can automatically cache the task results to local disk and Bazel-compatible remote cache.</p>
1418+
<pre><code class="language-scala">lazy val task1 = taskKey[String]("doc for task1")
1419+
1420+
task1 := (Def.cachedTask {
1421+
name.value + version.value + "!"
1422+
}).value
1423+
</code></pre>
1424+
<p>This tracks the inputs into the <code>task1</code> and creates a machine-wide disk cache, which can also be configured to also use a remote cache. Since it's common for sbt tasks to also produce files on the side, we also provide a mechanism to cache file contents:</p>
1425+
<pre><code class="language-scala">lazy val task1 = taskKey[String]("doc for task1")
1426+
1427+
task1 := (Def.cachedTask {
1428+
val converter = fileConverter.value
1429+
....
1430+
val output = converter.toVirtualFile(somefile)
1431+
Def.declareOutput(output)
1432+
name.value + version.value + "!"
1433+
}).value
1434+
</code></pre>
1435+
<p>Contributed by <a href="https://github.com/eed3si9n">@eed3si9n</a> in <a href="https://github.com/sbt/sbt/pull/7464">#7464</a> / <a href="https://github.com/sbt/sbt/pull/7525">#7525</a></p>
13861436
<h2 id="previously-on-sbt"><a class="header" href="#previously-on-sbt">Previously on sbt</a></h2>
13871437
<p>See also:</p>
13881438
<ul>

2.x/docs/en/searchindex.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

2.x/docs/en/searchindex.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)