Skip to content

Commit

Permalink
bump: paradox 0.10.3 (was 0.5.5); Java 11; fix ref links (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
ennru authored Dec 19, 2022
1 parent 24d13db commit 8312f46
Show file tree
Hide file tree
Showing 28 changed files with 88 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
include:
- { sbtCrossVersion: "1.4.9", jvmName: "temurin:1.8.0" }
- { sbtCrossVersion: "1.4.9", jvmName: "temurin:1.11.0" }
# { jvmName: "temurin:1.11.0" }
# { jvmName: "temurin:1.17.0" }
steps:
Expand Down
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ scalacOptions ++= Seq("-deprecation", "-unchecked")

resolvers ++= Resolver.sonatypeOssRepos("releases")

val unfilteredVersion = "0.9.1"
val unfilteredVersion = "0.10.4"

libraryDependencies ++= Seq(
"ws.unfiltered" %% "unfiltered-directives" % unfilteredVersion,
"ws.unfiltered" %% "unfiltered-filter" % unfilteredVersion,
"ws.unfiltered" %% "unfiltered-jetty" % unfilteredVersion,
"ws.unfiltered" %% "unfiltered-specs2" % unfilteredVersion % "test",
"org.foundweekends" %% "pamflet-library" % "0.8.0",
"org.yaml" % "snakeyaml" % "1.24",
"com.typesafe" % "config" % "1.3.4",
"org.yaml" % "snakeyaml" % "1.33",
"com.typesafe" % "config" % "1.4.2",
"org.asciidoctor" % "asciidoctorj" % "2.1.0",
"org.asciidoctor" % "asciidoctorj-diagram" % "1.5.18"
)

addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.5.5")
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.3")

libraryDependencies +=
Defaults.sbtPluginExtra(
Expand Down
2 changes: 1 addition & 1 deletion src/main/paradox/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Before upgrading please consult the @github:[release notes](/notes/). Instructio

@@@ note

* Version 1.5+ is published for sbt >= 1.4.9.
* Version 1.5+ is published for sbt >= 1.4.9 and requires Java 11+.
* Version 1.4+ is published for sbt 1.2.x.
* Version 1.3+ is cross published to both sbt 0.13 and sbt 1.x.
* As of sbt-site version 1.x.x, sbt version 0.13.10+ or 1.0.0-RC2+ is supported.
Expand Down
2 changes: 1 addition & 1 deletion src/main/paradox/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The following examples show how you can define nested directory via a custom set

In the `PreprocessPlugin`, the key `preprocessExts: SettingKey[Set[String]]` has been replaced by `preprocessIncludeFilter: SettingKey[FileFilter]`.

[Preprocess]: preprocess.md#variable-substitution
[Preprocess]: preprocess.md#substitution
[Jekyll]: generators/jekyll.md
[Sphinx]: generators/sphinx.md
[Pamflet]: generators/pamflet.md
Expand Down
4 changes: 2 additions & 2 deletions src/main/paradox/notes/1.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ See the [1.3.0 milestone] for the full list of related tickets and PRs.
## Using sbt-site with sbt version 1.0

This release adds support for sbt 1.0, however, the
[Laika](../src/main/paradox/generators/laika.md) and
[Paradox](../src/main/paradox/generators/paradox.md) generators are only
@ref:[Laika](../generators/laika.md) and
@ref:[Paradox](../generators/paradox.md) generators are only
available for sbt 0.13.

[1.3.0 milestone]: https://github.com/sbt/sbt-site/milestone/5
Expand Down
2 changes: 2 additions & 0 deletions src/main/paradox/notes/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Release Notes

See [GitHub Releases](https://github.com/sbt/sbt-site/releases)

@@toc { depth=1 }

@@@ index
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/com/typesafe/sbt/site/SitePreviewPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ object SitePreviewPlugin extends AutoPlugin {
val path = previewPath.value

val port = portOption.getOrElse(Port.any)
val url = s"http://localhost:$port/$path"
val server = createServer(file, port).start()
val sLog = streams.value.log
sLog.info(s"SitePreviewPlugin server started on port $port. Press any key to exit.")
if (browser)
Browser.open("http://localhost:%d/%s".format(port, path))
sLog.info(s"SitePreviewPlugin serving at $url Press return to exit.")
if (browser) Browser.open(url)
try System.in.read
finally {
server.stop()
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/gitbook/can-manage-installation/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name := "test"
enablePlugins(GitBookPlugin)

//#gitbookInstallDir
gitbookInstallDir in GitBook := Some(baseDirectory.value / "node_modules" / "gitbook")
GitBook / gitbookInstallDir := Some(baseDirectory.value / "node_modules" / "gitbook")
//#gitbookInstallDir

TaskKey[Unit]("checkContent") := {
val installDir = (gitbookInstallDir in GitBook).value
val dest = (target in makeSite).value / (siteSubdirName in GitBook).value
val installDir = (GitBook / gitbookInstallDir).value
val dest = (makeSite / target).value / (GitBook / siteSubdirName).value

assert(installDir.isDefined, "gitbookInstallDir setting is not defined")

Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/gitbook/can-use-gitbook/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def gitbookProject(version: String)(project: Project): Project = project
.enablePlugins(GitBookPlugin)
.settings(
checkContentTask,
siteSubdirName in GitBook := "docs"
GitBook / siteSubdirName := "docs"
)

def checkContentTask = checkContent := {
val dest = (target in makeSite).value / (siteSubdirName in GitBook).value
val dest = (makeSite / target).value / (GitBook / siteSubdirName).value

val expectedFilesAndWords = Map(
dest / "index.html" -> Seq("sbt", "GitBook", "User"),
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/gitbook/ignore-dot-files/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ name := "test"
enablePlugins(GitBookPlugin)
//#enablePlugin

sourceDirectory in GitBook := baseDirectory.value
GitBook / sourceDirectory := baseDirectory.value

//#siteSubdirName
// Puts output in `target/site/book`
siteSubdirName in GitBook := "book"
GitBook / siteSubdirName := "book"
//#siteSubdirName

val gitHeadPath = ".git/HEAD"
Expand All @@ -19,7 +19,7 @@ initialize := {
}

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in GitBook).value
val dest = (makeSite / target).value / (GitBook / siteSubdirName).value

val generatedGitFile = baseDirectory.value / gitHeadPath
assert(generatedGitFile.exists, s"${generatedGitFile.getAbsolutePath} did not exist")
Expand Down
8 changes: 4 additions & 4 deletions src/sbt-test/hugo/can-use-hugo/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ enablePlugins(HugoPlugin)
//#enablePlugin

//#baseURL
baseURL in Hugo := uri("https://yourdomain.com")
Hugo / baseURL := uri("https://yourdomain.com")
//#baseURL

siteSubdirName in Hugo := "thisIsHugo"
Hugo / siteSubdirName := "thisIsHugo"

//#extraEnv
extraEnv in Hugo := Map("MY_ENV" -> "Is set!", "MY_OTHER_ENV" -> "Is also set.")
Hugo / extraEnv := Map("MY_ENV" -> "Is set!", "MY_OTHER_ENV" -> "Is also set.")
//#extraEnv

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in Hugo).value
val dest = (makeSite / target).value / (Hugo / siteSubdirName).value
val index = dest / "index.html"
assert(index.exists, s"${index.getAbsolutePath} did not exist")
val content = IO.readLines(index)
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/jekyll/can-use-jekyll/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ enablePlugins(JekyllPlugin)

//#siteSubdirName
// Puts output in `target/site/notJekyllButHyde`
siteSubdirName in Jekyll := "notJekyllButHyde"
Jekyll / siteSubdirName := "notJekyllButHyde"
//#siteSubdirName

/* FIXME: This currently fails
Expand All @@ -26,7 +26,7 @@ requiredGems := Map(
*/

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in Jekyll).value
val dest = (makeSite / target).value / (Jekyll / siteSubdirName).value
val index = dest / "index.html"
assert(index.exists, s"${index.getAbsolutePath} did not exist")
val content = IO.readLines(index)
Expand Down
10 changes: 5 additions & 5 deletions src/sbt-test/laika/blog-post/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ name := "test"
enablePlugins(LaikaSitePlugin)
//#enablePlugin

sourceDirectory in LaikaSite := sourceDirectory.value / "blog"
LaikaSite / sourceDirectory := sourceDirectory.value / "blog"

siteSubdirName in LaikaSite := "blog"
LaikaSite / siteSubdirName := "blog"

//#laikaSbtPluginCustomization
laikaBlockDirectives in LaikaSite += CustomDirectives.postsToc
laikaSiteRenderers in LaikaSite += CustomDirectives.postsRenderer
LaikaSite / laikaBlockDirectives += CustomDirectives.postsToc
LaikaSite / laikaSiteRenderers += CustomDirectives.postsRenderer
//#laikaSbtPluginCustomization

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in LaikaSite).value
val dest = (makeSite / target).value / (LaikaSite / siteSubdirName).value

val expectedFilesAndWords = Map(
dest / "index.html" -> Seq("Start Bootstrap Template", "Blog Post Title", "Second Post Title"),
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/laika/minimal/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ name := "test"
enablePlugins(LaikaSitePlugin)
//#enablePlugin

siteSubdirName in LaikaSite := "minimal"
LaikaSite / siteSubdirName := "minimal"

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in LaikaSite).value
val dest = (makeSite / target).value / (LaikaSite / siteSubdirName).value

val expectedFilesAndWords = Map(
dest / "index.html" -> Seq("test", "Minimal")
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/nanoc/can-use-nanoc/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ enablePlugins(NanocPlugin)

//#siteSubdirName
// Puts output in `target/site/conan`
siteSubdirName in Nanoc := "conan"
Nanoc / siteSubdirName := "conan"
//#siteSubdirName

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in Nanoc).value
val dest = (makeSite / target).value / (Nanoc / siteSubdirName).value
val index = dest / "index.html"
assert(index.exists, s"${index.getAbsolutePath} did not exist")
val content = IO.readLines(index)
Expand Down
12 changes: 6 additions & 6 deletions src/sbt-test/pamflet/can-have-multi-sites/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ val Site2 = config("site2")

PamfletPlugin.pamfletSettings(Site1)

sourceDirectory in Site1 := sourceDirectory.value / "pamflet-site-1"
Site1 / sourceDirectory := sourceDirectory.value / "pamflet-site-1"

siteSubdirName in Site1 := "chapter1"
Site1 / siteSubdirName := "chapter1"

PamfletPlugin.pamfletSettings(Site2)

sourceDirectory in Site2 := sourceDirectory.value / "pamflet-site-2"
Site2 / sourceDirectory := sourceDirectory.value / "pamflet-site-2"

siteSubdirName in Site2 := "chapter2"
Site2 / siteSubdirName := "chapter2"

TaskKey[Unit]("checkContent") := {
val dest1 = (target in makeSite).value / (siteSubdirName in Site1).value
val dest2 = (target in makeSite).value / (siteSubdirName in Site2).value
val dest1 = (makeSite / target).value / (Site1 / siteSubdirName).value
val dest2 = (makeSite / target).value / (Site2 / siteSubdirName).value
for ((dest, i) Seq(dest1, dest2).zipWithIndex) {
val index = dest / s"Pamphlet+Testing+${i+1}.html"
assert(index.exists, s"${index.getAbsolutePath} did not exist")
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/pamflet/can-use-pamflet/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ enablePlugins(PamfletPlugin)

//#siteSubdirName
// Puts output in `target/site/parchment`
siteSubdirName in Pamflet := "parchment"
Pamflet / siteSubdirName := "parchment"
//#siteSubdirName

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in Pamflet).value
val dest = (makeSite / target).value / (Pamflet / siteSubdirName).value
val index = dest / "Pamphlet+Testing.html"
assert(index.exists, s"${index.getAbsolutePath} did not exist")
val content = IO.readLines(index)
Expand Down
8 changes: 4 additions & 4 deletions src/sbt-test/preprocess/does-transform-variables/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ name := "preprocess test"
version := "0.0-ABCD"

//#preprocessVars
preprocessVars in Preprocess := Map("VERSION" -> version.value, "DATE" -> new Date().toString)
Preprocess / preprocessVars := Map("VERSION" -> version.value, "DATE" -> new Date().toString)
//#preprocessVars

preprocessRules in Preprocess := Seq(
Preprocess / preprocessRules := Seq(
("Author: ([a-z]+)".r, _.group(0).toUpperCase)
)

Expand All @@ -21,11 +21,11 @@ preprocessIncludeFilter := "*.md" | "*.markdown"
//#preprocessIncludeFilter

//#sourceDirectory
sourceDirectory in Preprocess := sourceDirectory.value / "site-preprocess"
Preprocess / sourceDirectory := sourceDirectory.value / "site-preprocess"
//#sourceDirectory

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in Preprocess).value
val dest = (makeSite / target).value / (Preprocess / siteSubdirName).value
val readme = dest / "README.md"
assert(readme.exists, s"${readme.getAbsolutePath} did not exist")
val content = IO.readLines(readme)
Expand Down
10 changes: 5 additions & 5 deletions src/sbt-test/preprocess/transform-scaladoc/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scalacOptions in (Compile, doc) ++= Seq(
Compile / doc / scalacOptions ++= Seq(
"-sourcepath", baseDirectory.value.toString,
"-doc-source-url", {
val branch = if (isSnapshot.value) "master" else s"v${version.value}"
Expand All @@ -8,9 +8,9 @@ scalacOptions in (Compile, doc) ++= Seq(

enablePlugins(PreprocessPlugin)

sourceDirectory in Preprocess := (target in (Compile, doc)).value
siteSubdirName in Preprocess := "api"
makeSite := makeSite.dependsOn(doc in Compile).value
Preprocess / sourceDirectory := (Compile / doc / target).value
Preprocess / siteSubdirName := "api"
makeSite := makeSite.dependsOn(Compile / doc).value

//#preprocessRules
preprocessRules in Preprocess := Seq(
Expand All @@ -19,7 +19,7 @@ preprocessRules in Preprocess := Seq(
//#preprocessRules

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in Preprocess).value
val dest = (makeSite / target).value / (Preprocess / siteSubdirName).value
val app = dest / "App.html"
assert(app.exists, s"${app.getAbsolutePath} did not exist")
val content = IO.readLines(app)
Expand Down
8 changes: 4 additions & 4 deletions src/sbt-test/scaladoc/can-add-scaladoc/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ enablePlugins(SiteScaladocPlugin)

//#siteSubdirName
// Puts Scaladoc output in `target/site/api/latest`
siteSubdirName in SiteScaladoc := "api/latest"
SiteScaladoc / siteSubdirName := "api/latest"
//#siteSubdirName

version := "0.0.meow"

scalaVersion := "2.10.6"
scalaVersion := "2.12.17"

TaskKey[Unit]("checkContent") := {
val dest = (target in makeSite).value / (siteSubdirName in SiteScaladoc).value
val index = dest / "index.html"
val dest = (makeSite / target).value / (SiteScaladoc / siteSubdirName).value
val index = dest / "cats" / "preowned" / "index.html"
assert(index.exists, s"${index.getAbsolutePath} did not exist")
val content = IO.readLines(index)
assert(content.exists(_.contains("cats.preowned.Meow")), s"Did not find expected content in:\n${content.mkString("\n")}")
Expand Down
Loading

0 comments on commit 8312f46

Please sign in to comment.