-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
337 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ node_modules | |
|
||
# Production | ||
build | ||
book | ||
|
||
# Generated files | ||
.docusaurus | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[book] | ||
authors = ["Eugene Yokota"] | ||
language = "en" | ||
multilingual = false | ||
src = "src/reference" | ||
title = "The book of sbt" | ||
|
||
[output.html] | ||
theme = "theme" | ||
additional-css = ["src/reference/custom-2024.css"] | ||
cname = "www.scala-sbt.org" | ||
|
||
[preprocessor.variables] | ||
|
||
[preprocessor.variables.variables] | ||
sbt_version = "2.0.0-alpha7" | ||
sbt_runner_version = "1.9.8" | ||
scala3ExampleVersion = "3.3.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import sbt.* | ||
import Keys.* | ||
import com.typesafe.sbt.site.SitePlugin.autoImport.siteSubdirName | ||
import com.typesafe.sbt.site.SitePlugin | ||
import com.typesafe.sbt.site.util.SiteHelpers | ||
import scala.annotation.nowarn | ||
|
||
object MdBookSitePlugin extends AutoPlugin { | ||
override def requires = SitePlugin | ||
override def trigger = noTrigger | ||
override def projectSettings = mdbookSettings(Compile) | ||
|
||
object autoImport { | ||
val MdBook = config("mdbook") | ||
val mdbookBuild = taskKey[File]("") | ||
val mdbookDirectory = settingKey[File]("Directory where docs are located") | ||
} | ||
import autoImport.* | ||
|
||
@nowarn | ||
def mdbookSettings(config: Configuration): Seq[Setting[_]] = | ||
inConfig(if (config == Compile) MdBook else config)( | ||
List( | ||
siteSubdirName := "", | ||
mdbookDirectory := baseDirectory.value, | ||
config / mdbookBuild := { | ||
import scala.sys.process.* | ||
val dir = mdbookDirectory.value | ||
Process(List("mdbook", "build"), cwd = dir).! | ||
val out = dir / "book" | ||
out | ||
}, | ||
) | ||
) ++ | ||
SiteHelpers.watchSettings(ThisScope.in(config, mdbookBuild.key)) ++ | ||
SiteHelpers.addMappingsToSiteDir( | ||
(config / mdbookBuild) | ||
.map(SiteHelpers.selectSubpaths(_, AllPassFilter)), | ||
(if (config == Compile) MdBook else config) / siteSubdirName | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site-paradox" % "1.5.0") | ||
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always | ||
addSbtPlugin("com.github.sbt" % "sbt-site" % "1.5.0") | ||
addSbtPlugin("com.github.sbt" % "sbt-ghpages" % "0.7.0") | ||
libraryDependencies += "org.foundweekends" %% "pamflet-library" % "0.11.0" | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") | ||
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.6.9") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
The book of sbt | ||
=============== | ||
|
||
![sbt logo](files/sbt-logo.svg) | ||
|
||
sbt is a simple build tool for Scala and Java. | ||
sbt downloads your library dependencies via Coursier, | ||
incrementally compiles and tests your projects, | ||
integrates with IDEs like IntelliJ and VS Code, | ||
makes JAR packages, and publishes them to [Maven Central](https://central.sonatype.com/), | ||
JVM community's package registry. | ||
|
||
```scala | ||
scalaVersion := "{{scala3ExampleVersion}}" | ||
``` | ||
|
||
You just need one line of `build.sbt` to get started with Scala. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Summary | ||
|
||
[Introduction](README.md) | ||
|
||
# Quick Start | ||
|
||
- [Installing sbt runner](Setup.md) | ||
- [sbt by example](sbt-by-example.md) | ||
|
||
---- | ||
|
||
# Appendix | ||
|
||
- [Setup notes](setup-notes.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Installing sbt runner | ||
===================== | ||
|
||
To build an sbt project, you'll need to take these steps: | ||
|
||
- Install JDK (We recommend Eclipse Adoptium Temurin JDK 8, 11, or 17, or Zulu JDK 8 for macOS with ARM chips). | ||
- Install sbt runner. | ||
|
||
sbt runner is a script that invokes a declared version of sbt, downloading it beforehand if necessary. This allows build authors to precisely control | ||
the sbt version, instead of relying on users' machine environment. | ||
|
||
### Prerequisites | ||
|
||
sbt runs on all major operating systems; however, it requires JDK 8 or higher to run. | ||
|
||
```bash | ||
java -version | ||
# openjdk version "1.8.0_352" | ||
``` | ||
|
||
### Install sbt with **cs setup** | ||
|
||
Follow [Install](https://www.scala-lang.org/download/) page, and install Scala using Coursier. | ||
|
||
```bash | ||
cs setup | ||
``` | ||
|
||
This should install the latest stable version of `sbt`. | ||
|
||
### Installing from SDKMAN | ||
|
||
To install both JDK and sbt, consider using [SDKMAN](https://sdkman.io/). | ||
|
||
```bash | ||
sdk install java $(sdk list java | grep -o "\b8\.[0-9]*\.[0-9]*\-tem" | head -1) | ||
sdk install sbt | ||
``` | ||
|
||
### Universal packages | ||
|
||
- [sbt-{{sbt_runner_version}}.zip][ZIP] | ||
- [sbt-{{sbt_runner_version}}.tgz][TGZ] | ||
- [sbt-{{sbt_runner_version}}.msi][MSI] | ||
|
||
Verify the sbt runner | ||
--------------------- | ||
|
||
```bash | ||
sbt --script-version | ||
# {{sbt_runner_version}} | ||
``` | ||
|
||
[MSI]: https://github.com/sbt/sbt/releases/download/v{{sbt_runner_version}}/sbt-{{sbt_runner_version}}.msi | ||
[ZIP]: https://github.com/sbt/sbt/releases/download/v{{sbt_runner_version}}/sbt-{{sbt_runner_version}}.zip | ||
[TGZ]: https://github.com/sbt/sbt/releases/download/v{{sbt_runner_version}}/sbt-{{sbt_runner_version}}.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
html { | ||
font-family: "Helvetica Neue", "Roboto", "Arial", sans-serif; | ||
} | ||
|
||
pre { | ||
border: solid 1px lightgray; | ||
} |
Oops, something went wrong.